diff options
author | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2012-08-08 17:35:58 -0400 |
---|---|---|
committer | Bogdan Gheorghe <gheorghe@ca.ibm.com> | 2012-08-08 17:36:32 -0400 |
commit | b84a972a97895b84f13dc7405df20866130f726b (patch) | |
tree | 5c4cc4b769850bd355eb8bd33db0e2fa8c82aa4e | |
parent | a61caa1cfed4d2ec7b9bccff2e9d74f32593118d (diff) | |
download | eclipse.platform.swt-b84a972a97895b84f13dc7405df20866130f726b.tar.gz eclipse.platform.swt-b84a972a97895b84f13dc7405df20866130f726b.tar.xz eclipse.platform.swt-b84a972a97895b84f13dc7405df20866130f726b.zip |
Bug 379590 - Run event loop while Tracker is up
3 files changed, 10 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java index 0ee334c7b7..6a2d14c908 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Tracker.java @@ -841,6 +841,9 @@ public boolean open () { while (tracking && !cancelled) { display.addPool(); try { + if (parent != null && parent.isDisposed ()) break; + display.runSkin (); + display.runDeferredLayouts (); NSEvent event = application.nextEventMatchingMask(0, NSDate.distantFuture(), OS.NSDefaultRunLoopMode, true); if (event == null) continue; int type = (int)/*64*/event.type(); @@ -885,6 +888,7 @@ public boolean open () { clientCursor.handle.set(); display.lockCursor = true; } + display.runAsyncMessages (false); } finally { display.removePool(); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java index af86c4f365..9d16684e8f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tracker.java @@ -709,14 +709,18 @@ public boolean open () { /* Tracker behaves like a Dialog with its own OS event loop. */ GdkEvent gdkEvent = new GdkEvent(); + Display display = this.display; while (tracking) { if (parent != null && parent.isDisposed ()) break; int /*long*/ eventPtr; while (true) { + display.runSkin (); + display.runDeferredLayouts (); eventPtr = OS.gdk_event_get (); if (eventPtr != 0) { break; } else { + display.runAsyncMessages (false); try { Thread.sleep(50); } catch (Exception ex) {} } } @@ -744,6 +748,7 @@ public boolean open () { OS.gtk_main_do_event (eventPtr); } OS.gdk_event_free (eventPtr); + display.runAsyncMessages (false); } if (!isDisposed ()) { update (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java index b660abb9a9..a181d6eb4f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tracker.java @@ -606,13 +606,13 @@ public boolean open () { drawRectangles (rectangles, stippled); } } + display.runAsyncMessages (false); } if (mouseDown) OS.ReleaseCapture (); if (!isDisposed()) { update (); drawRectangles (rectangles, stippled); } - display.runAsyncMessages (false); } finally { /* * Cleanup: If a transparent window was created in order to capture events then |