Skip to content

Commit d3ce8e6

Browse files
committed
Merge branch 'release/1.4.5'
2 parents acc4b02 + 3c5b2d5 commit d3ce8e6

File tree

9 files changed

+68
-74
lines changed

9 files changed

+68
-74
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/setup-java@v4
1212
with:
1313
distribution: 'zulu'
14-
java-version: 21
14+
java-version: 22
1515
cache: 'maven'
1616
- name: Ensure to use tagged version
1717
if: startsWith(github.ref, 'refs/tags/')
@@ -26,7 +26,7 @@ jobs:
2626
name: artifacts
2727
path: target/*.jar
2828
- name: Create Release
29-
uses: softprops/action-gh-release@v1
29+
uses: softprops/action-gh-release@v2
3030
if: startsWith(github.ref, 'refs/tags/')
3131
with:
3232
prerelease: true

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/setup-java@v4
2323
with:
2424
distribution: 'zulu'
25-
java-version: 21
25+
java-version: 22
2626
cache: 'maven'
2727
- name: Initialize CodeQL
2828
uses: github/codeql-action/init@v3

.github/workflows/dependency-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
runner-os: 'ubuntu-latest'
1616
java-distribution: 'temurin'
17-
java-version: 21
17+
java-version: 22
1818
secrets:
1919
nvd-api-key: ${{ secrets.NVD_API_KEY }}
2020
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}

.github/workflows/publish-central.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/setup-java@v4
1717
with:
1818
distribution: 'zulu'
19-
java-version: 21
19+
java-version: 22
2020
cache: 'maven'
2121
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
2222
server-username: MAVEN_USERNAME # env variable for username in deploy

.github/workflows/publish-github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/setup-java@v4
1212
with:
1313
distribution: 'zulu'
14-
java-version: 21
14+
java-version: 22
1515
cache: 'maven'
1616
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
1717
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>org.cryptomator</groupId>
77
<artifactId>integrations-linux</artifactId>
8-
<version>1.4.4</version>
8+
<version>1.4.5</version>
99

1010
<name>integrations-linux</name>
1111
<description>Provides optional Linux services used by Cryptomator</description>
@@ -36,21 +36,21 @@
3636

3737
<properties>
3838
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
39-
<project.jdk.version>21</project.jdk.version>
39+
<project.jdk.version>22</project.jdk.version>
4040

4141
<!-- runtime dependencies -->
4242

43-
<api.version>1.3.0</api.version>
44-
<secret-service.version>2.0.0-alpha</secret-service.version>
43+
<api.version>1.3.1</api.version>
44+
<secret-service.version>2.0.1-alpha</secret-service.version>
4545
<kdewallet.version>1.4.0</kdewallet.version>
46-
<appindicator.version>1.3.6</appindicator.version>
47-
<slf4j.version>2.0.11</slf4j.version>
46+
<slf4j.version>2.0.13</slf4j.version>
47+
<appindicator.version>1.4.0</appindicator.version>
4848

4949
<!-- test dependencies -->
50-
<junit.version>5.10.1</junit.version>
50+
<junit.version>5.10.2</junit.version>
5151

5252
<!-- build plugin dependencies -->
53-
<dependency-check.version>9.0.9</dependency-check.version>
53+
<dependency-check.version>9.1.0</dependency-check.version>
5454
<nexus-staging.version>1.6.8</nexus-staging.version>
5555
</properties>
5656

@@ -94,12 +94,9 @@
9494
<plugin>
9595
<groupId>org.apache.maven.plugins</groupId>
9696
<artifactId>maven-compiler-plugin</artifactId>
97-
<version>3.12.1</version>
97+
<version>3.13.0</version>
9898
<configuration>
9999
<release>${project.jdk.version}</release>
100-
<compilerArgs>
101-
<arg>--enable-preview</arg>
102-
</compilerArgs>
103100
</configuration>
104101
</plugin>
105102
<plugin>
@@ -131,7 +128,7 @@
131128
</plugin>
132129
<plugin>
133130
<artifactId>maven-source-plugin</artifactId>
134-
<version>3.3.0</version>
131+
<version>3.3.1</version>
135132
<executions>
136133
<execution>
137134
<id>attach-sources</id>
@@ -194,7 +191,6 @@
194191
<name>see</name>
195192
</tag>
196193
</tags>
197-
<additionalOptions>--enable-preview</additionalOptions>
198194
</configuration>
199195
</plugin>
200196
</plugins>
@@ -216,7 +212,7 @@
216212
<skipTestScope>true</skipTestScope>
217213
<detail>true</detail>
218214
<suppressionFile>suppression.xml</suppressionFile>
219-
<nvdApiKey>${env.NVD_API_KEY}</nvdApiKey>
215+
<nvdApiKeyEnvironmentVariable>NVD_API_KEY</nvdApiKeyEnvironmentVariable>
220216
</configuration>
221217
<executions>
222218
<execution>
@@ -237,7 +233,7 @@
237233
<plugins>
238234
<plugin>
239235
<artifactId>maven-gpg-plugin</artifactId>
240-
<version>3.1.0</version>
236+
<version>3.2.4</version>
241237
<executions>
242238
<execution>
243239
<id>sign-artifacts</id>
@@ -298,7 +294,7 @@
298294
<plugin>
299295
<groupId>org.apache.maven.plugins</groupId>
300296
<artifactId>maven-deploy-plugin</artifactId>
301-
<version>3.1.1</version>
297+
<version>3.1.2</version>
302298
</plugin>
303299
</plugins>
304300
</build>

src/main/java/org/cryptomator/linux/tray/ActionItemCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.slf4j.Logger;
66
import org.slf4j.LoggerFactory;
77

8-
record ActionItemCallback (ActionItem actionItem) implements GCallback {
8+
record ActionItemCallback (ActionItem actionItem) implements GCallback.Function {
99
private static final Logger LOG = LoggerFactory.getLogger(ActionItemCallback.class);
1010

1111
@Override

src/main/java/org/cryptomator/linux/tray/AppindicatorTrayMenuController.java

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@
1010
import org.cryptomator.integrations.tray.TrayMenuController;
1111
import org.cryptomator.integrations.tray.TrayMenuException;
1212
import org.cryptomator.integrations.tray.TrayMenuItem;
13+
import org.cryptomator.linux.util.CheckUtil;
14+
import org.purejava.appindicator.AppIndicator;
1315
import org.purejava.appindicator.GCallback;
14-
import org.purejava.appindicator.NativeLibUtilities;
16+
import org.purejava.appindicator.GObject;
17+
import org.purejava.appindicator.Gtk;
1518

1619
import java.lang.foreign.Arena;
1720
import java.lang.foreign.MemorySegment;
1821
import java.util.List;
19-
import java.util.Optional;
2022
import java.util.function.Consumer;
2123

22-
import static org.purejava.appindicator.app_indicator_h.*;
24+
import static org.purejava.appindicator.app_indicator_h.APP_INDICATOR_CATEGORY_APPLICATION_STATUS;
25+
import static org.purejava.appindicator.app_indicator_h.APP_INDICATOR_STATUS_ACTIVE;
2326

2427
@Priority(1000)
2528
@CheckAvailability
@@ -30,37 +33,36 @@ public class AppindicatorTrayMenuController implements TrayMenuController {
3033

3134
private static final Arena ARENA = Arena.global();
3235
private MemorySegment indicator;
33-
private MemorySegment menu = gtk_menu_new();
36+
private MemorySegment menu;
3437

3538
@CheckAvailability
3639
public static boolean isAvailable() {
37-
return NativeLibUtilities.isLoadedNativeLib();
40+
return AppIndicator.isLoaded();
3841
}
3942

4043
@Override
4144
public void showTrayIcon(Consumer<TrayIconLoader> iconLoader, Runnable runnable, String s) throws TrayMenuException {
45+
menu = Gtk.newMenu();
4246
TrayIconLoader.FreedesktopIconName callback = this::showTrayIconWithSVG;
4347
iconLoader.accept(callback);
44-
gtk_widget_show_all(menu);
45-
app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE());
48+
Gtk.widgetShowAll(menu);
49+
AppIndicator.setStatus(indicator, APP_INDICATOR_STATUS_ACTIVE());
4650
}
4751

48-
private void showTrayIconWithSVG(String s) {
49-
try (var arena = Arena.ofConfined()) {
50-
var svgSourcePath = System.getProperty(SVG_SOURCE_PROPERTY);
51-
// flatpak
52-
if (svgSourcePath == null) {
53-
indicator = app_indicator_new(arena.allocateUtf8String(APP_INDICATOR_ID),
54-
arena.allocateUtf8String(s),
55-
APP_INDICATOR_CATEGORY_APPLICATION_STATUS());
56-
// AppImage and ppa
57-
} else {
58-
indicator = app_indicator_new_with_path(arena.allocateUtf8String(APP_INDICATOR_ID),
59-
arena.allocateUtf8String(s),
60-
APP_INDICATOR_CATEGORY_APPLICATION_STATUS(),
61-
// find tray icons theme in mounted AppImage / installed on system by ppa
62-
arena.allocateUtf8String(svgSourcePath));
63-
}
52+
private void showTrayIconWithSVG(String iconName) {
53+
var svgSourcePath = System.getProperty(SVG_SOURCE_PROPERTY);
54+
// flatpak
55+
if (svgSourcePath == null) {
56+
indicator = AppIndicator.newIndicator(APP_INDICATOR_ID,
57+
iconName,
58+
APP_INDICATOR_CATEGORY_APPLICATION_STATUS());
59+
// AppImage and ppa
60+
} else {
61+
indicator = AppIndicator.newIndicatorWithPath(APP_INDICATOR_ID,
62+
iconName,
63+
APP_INDICATOR_CATEGORY_APPLICATION_STATUS(),
64+
// find tray icons theme in mounted AppImage / installed on system by ppa
65+
svgSourcePath);
6466
}
6567
}
6668

@@ -70,18 +72,18 @@ public void updateTrayIcon(Consumer<TrayIconLoader> iconLoader) {
7072
iconLoader.accept(callback);
7173
}
7274

73-
private void updateTrayIconWithSVG(String s) {
74-
try (var arena = Arena.ofConfined()) {
75-
app_indicator_set_icon(indicator, arena.allocateUtf8String(s));
76-
}
75+
private void updateTrayIconWithSVG(String iconName) {
76+
CheckUtil.checkState(indicator != null, "Appindicator is not setup. Call showTrayIcon(...) first.");
77+
AppIndicator.setIcon(indicator, iconName);
7778
}
7879

7980
@Override
8081
public void updateTrayMenu(List<TrayMenuItem> items) throws TrayMenuException {
81-
menu = gtk_menu_new();
82+
CheckUtil.checkState(indicator != null, "Appindicator is not setup. Call showTrayIcon(...) first.");
83+
menu = Gtk.newMenu();
8284
addChildren(menu, items);
83-
gtk_widget_show_all(menu);
84-
app_indicator_set_menu(indicator, menu);
85+
Gtk.widgetShowAll(menu);
86+
AppIndicator.setMenu(indicator, menu);
8587
}
8688

8789
@Override
@@ -93,30 +95,26 @@ private void addChildren(MemorySegment menu, List<TrayMenuItem> items) {
9395
for (var item : items) {
9496
switch (item) {
9597
case ActionItem a -> {
96-
var gtkMenuItem = gtk_menu_item_new();
97-
try (var arena = Arena.ofConfined()) {
98-
gtk_menu_item_set_label(gtkMenuItem, arena.allocateUtf8String(a.title()));
99-
g_signal_connect_object(gtkMenuItem,
100-
arena.allocateUtf8String("activate"),
101-
GCallback.allocate(new ActionItemCallback(a), ARENA),
102-
menu,
103-
0);
104-
}
105-
gtk_menu_shell_append(menu, gtkMenuItem);
98+
var gtkMenuItem = Gtk.newMenuItem();
99+
Gtk.menuItemSetLabel(gtkMenuItem, a.title());
100+
GObject.signalConnectObject(gtkMenuItem,
101+
"activate",
102+
GCallback.allocate(new ActionItemCallback(a), ARENA),
103+
menu,
104+
0);
105+
Gtk.menuShellAppend(menu, gtkMenuItem);
106106
}
107107
case SeparatorItem _ -> {
108-
var gtkSeparator = gtk_menu_item_new();
109-
gtk_menu_shell_append(menu, gtkSeparator);
108+
var gtkSeparator = Gtk.newMenuItem();
109+
Gtk.menuShellAppend(menu, gtkSeparator);
110110
}
111111
case SubMenuItem s -> {
112-
var gtkMenuItem = gtk_menu_item_new();
113-
var gtkSubmenu = gtk_menu_new();
114-
try (var arena = Arena.ofConfined()) {
115-
gtk_menu_item_set_label(gtkMenuItem, arena.allocateUtf8String(s.title()));
116-
}
112+
var gtkMenuItem = Gtk.newMenuItem();
113+
var gtkSubmenu = Gtk.newMenu();
114+
Gtk.menuItemSetLabel(gtkMenuItem, s.title());
117115
addChildren(gtkSubmenu, s.items());
118-
gtk_menu_item_set_submenu(gtkMenuItem, gtkSubmenu);
119-
gtk_menu_shell_append(menu, gtkMenuItem);
116+
Gtk.menuItemSetSubmenu(gtkMenuItem, gtkSubmenu);
117+
Gtk.menuShellAppend(menu, gtkMenuItem);
120118
}
121119
}
122120
}

0 commit comments

Comments
 (0)