Make logging less verbose and better check disposed status of widgets
[lgpl/argeo-commons.git] / swt / rap / org.argeo.cms.swt.rap / src / org / argeo / cms / web / CmsWebEntryPoint.java
index 9c94da8f34c2de11bac5ab89c34f8980ca464f14..02e5da3666edd040753a53d34a1331165cac96ad 100644 (file)
@@ -276,7 +276,9 @@ public class CmsWebEntryPoint extends AbstractSwtCmsView implements EntryPoint,
                                        Subject.doAs(loginContext.getSubject(), new PrivilegedAction<Void>() {
                                                @Override
                                                public Void run() {
+                                                       // TODO rather loop here, until there is an auth change
                                                        if (!display.readAndDispatch()) {
+                                                               // TODO update UI last access here
                                                                display.sleep();
                                                        }
                                                        return null;
@@ -285,7 +287,8 @@ public class CmsWebEntryPoint extends AbstractSwtCmsView implements EntryPoint,
                                } catch (SWTError e) {
                                        SWTError swtError = (SWTError) e;
                                        if (swtError.code == SWT.ERROR_FUNCTION_DISPOSED) {
-                                               log.error("Unexpected SWT error in event loop, ignoring it. " + e.getMessage());
+                                               if (log.isTraceEnabled())
+                                                       log.error("Unexpected SWT error in event loop, ignoring it. " + e.getMessage());
                                                continue eventLoop;
                                        } else {
                                                log.error("Unexpected SWT error in event loop, shutting down...", e);