Commit 175db367 authored by Mickaël Guessant's avatar Mickaël Guessant

Linux: check system tray with gtk_status_icon_get_geometry only with Unity to...

Linux: check system tray with gtk_status_icon_get_geometry only with Unity to avoid regression with other window managers

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2486 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent 807c7a15
......@@ -224,14 +224,11 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
trayItem = new TrayItem(tray, SWT.NONE);
trayItem.setToolTipText(BundleMessage.format("UI_DAVMAIL_GATEWAY"));
// check if tray is indeed available
if (systemLookAndFeelClassName.contains("gtk")) {
// Under Unity, check if tray is indeed available
if (systemLookAndFeelClassName.contains("gtk") &&
"Unity".equals(System.getenv("XDG_CURRENT_DESKTOP"))) {
GdkRectangle area = new GdkRectangle();
// wait and try again
if (area.x == 0 && area.y == 0) {
Thread.sleep(10000);
OS.gtk_status_icon_get_geometry(trayItem.handle, 0, area, 0);
}
OS.gtk_status_icon_get_geometry(trayItem.handle, 0, area, 0);
if (area.x == 0 && area.y == 0) {
throw new Error("System tray not available");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment