1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-13 19:22:22 -05:00

SWT: register error handler early

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1688 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2011-05-17 21:41:20 +00:00
parent 91c5e51ec4
commit 6c95dd0184

View File

@ -171,6 +171,12 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
* Create tray icon and register frame listeners.
*/
public void init() {
// register error handler to avoid application crash on concurrent X access from SWT and AWT
try {
OS.gdk_error_trap_push();
} catch (NoClassDefFoundError e) {
// ignore
}
final String systemLookAndFeelClassName = UIManager.getSystemLookAndFeelClassName();
try {
// workaround for bug when SWT and AWT both try to access Gtk
@ -308,11 +314,6 @@ public class SwtGatewayTray implements DavGatewayTrayInterface {
}
});
// register error handler to avoid application crash on concurrent X access from SWT and AWT
if (systemLookAndFeelClassName.indexOf("gtk") >=0) {
OS.gdk_error_trap_push();
}
// display settings frame on first start
if (Settings.isFirstStart()) {
// create frame on first call