Commit 807c7a15 authored by Mickaël Guessant's avatar Mickaël Guessant

SWT: wait 10s for tray icon to be created

git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@2485 3d1905a2-6b24-0410-a738-b14d5a86fcbd
parent f51f2d1f
...@@ -227,7 +227,12 @@ public class SwtGatewayTray implements DavGatewayTrayInterface { ...@@ -227,7 +227,12 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
// check if tray is indeed available // check if tray is indeed available
if (systemLookAndFeelClassName.contains("gtk")) { if (systemLookAndFeelClassName.contains("gtk")) {
GdkRectangle area = new GdkRectangle(); GdkRectangle area = new GdkRectangle();
OS.gtk_status_icon_get_geometry(trayItem.handle, 0, area, 0); // 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);
}
if (area.x == 0 && area.y == 0) { if (area.x == 0 && area.y == 0) {
throw new Error("System tray not available"); 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