Skip to content

Commit f2b3f97

Browse files
committed
[Win32] Make Edge only process relevant OS messages #1789
When waiting for initialization of the WebView2 component in the Edge implementation, OS messages are processed by peeking the queue and performing a display.readAndDispatch() in case a message is present. The call to OS.PeekMessage() does, however, already perform some processing of the messages. In fact, Edge is not supposed to process all kinds of OS messages at all (like paint or input events) but should rather only process the WebView2 initialization callback message, arriving as a posted OS message. This change thus limits the message peeking inside Edge to only process the message type PM_QS_POSTMESSAGE. Fixes #1789
1 parent f746154 commit f2b3f97

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ private static void processOSMessagesUntil(Supplier<Boolean> condition, Display
464464
// The timer call also wakes up the display to avoid being stuck in display.sleep()
465465
display.timerExec((int) MAXIMUM_OPERATION_TIME.toMillis(), () -> timeoutOccurred.set(true));
466466
while (!display.isDisposed() && !condition.get() && !timeoutOccurred.get()) {
467-
if (OS.PeekMessage(msg, 0, 0, 0, OS.PM_NOREMOVE)) {
467+
if (OS.PeekMessage(msg, 0, 0, 0, OS.PM_NOREMOVE | OS.PM_QS_POSTMESSAGE)) {
468468
display.readAndDispatch();
469469
} else {
470470
display.sleep();

0 commit comments

Comments
 (0)