12
12
import org .cryptomator .integrations .tray .TrayMenuItem ;
13
13
import org .purejava .appindicator .GCallback ;
14
14
import org .purejava .appindicator .MemoryAllocator ;
15
- import org .slf4j .Logger ;
16
- import org .slf4j .LoggerFactory ;
17
15
18
16
import java .lang .foreign .Arena ;
19
17
import java .lang .foreign .MemorySegment ;
27
25
@ OperatingSystem (OperatingSystem .Value .LINUX )
28
26
public class AppindicatorTrayMenuController implements TrayMenuController {
29
27
30
- private static final Logger LOG = LoggerFactory . getLogger ( AppindicatorTrayMenuController . class ) ;
28
+ private static final String APP_INDICATOR_ID = "org.cryptomator.Cryptomator" ;
31
29
32
30
private static final SegmentScope SCOPE = SegmentScope .global ();
33
31
private MemorySegment indicator ;
@@ -43,13 +41,12 @@ public void showTrayIcon(Consumer<TrayIconLoader> iconLoader, Runnable runnable,
43
41
TrayIconLoader .FreedesktopIconName callback = this ::showTrayIconWithSVG ;
44
42
iconLoader .accept (callback );
45
43
gtk_widget_show_all (menu );
46
- app_indicator_set_menu (indicator , menu );
47
44
app_indicator_set_status (indicator , APP_INDICATOR_STATUS_ACTIVE ());
48
45
}
49
46
50
47
private void showTrayIconWithSVG (String s ) {
51
48
try (var arena = Arena .openConfined ()) {
52
- indicator = app_indicator_new (arena .allocateUtf8String ("org.cryptomator.Cryptomator" ),
49
+ indicator = app_indicator_new (arena .allocateUtf8String (APP_INDICATOR_ID ),
53
50
arena .allocateUtf8String (s ),
54
51
APP_INDICATOR_CATEGORY_APPLICATION_STATUS ());
55
52
}
@@ -110,7 +107,6 @@ private void addChildren(MemorySegment menu, List<TrayMenuItem> items) {
110
107
gtk_menu_shell_append (menu , gtkMenuItem );
111
108
}
112
109
}
113
- gtk_widget_show_all (menu );
114
110
}
115
111
}
116
112
}
0 commit comments