Jacek Caban : conhost: Pump window messages when we have a window.

Alexandre Julliard julliard at winehq.org
Thu Oct 8 15:20:06 CDT 2020


Module: wine
Branch: master
Commit: 3d51714ce4d40506f9935e17e635f6d35be3057e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3d51714ce4d40506f9935e17e635f6d35be3057e

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Oct  8 17:30:00 2020 +0200

conhost: Pump window messages when we have a window.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/conhost/conhost.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index f7db09b7da..70079e841e 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -2596,6 +2596,7 @@ static int main_loop( struct console *console, HANDLE signal )
     unsigned short signal_id;
     IO_STATUS_BLOCK signal_io;
     NTSTATUS status;
+    BOOL pump_msgs;
     DWORD res;
 
     if (signal)
@@ -2611,10 +2612,25 @@ static int main_loop( struct console *console, HANDLE signal )
     wait_handles[wait_cnt++] = console->server;
     if (signal) wait_handles[wait_cnt++] = signal_event;
     if (console->input_thread) wait_handles[wait_cnt++] = console->input_thread;
+    pump_msgs = console->win != NULL;
 
     for (;;)
     {
-        res = WaitForMultipleObjects( wait_cnt, wait_handles, FALSE, INFINITE );
+        if (pump_msgs)
+            res = MsgWaitForMultipleObjects( wait_cnt, wait_handles, FALSE, INFINITE, QS_ALLEVENTS );
+        else
+            res = WaitForMultipleObjects( wait_cnt, wait_handles, FALSE, INFINITE );
+
+        if (res == WAIT_OBJECT_0 + wait_cnt)
+        {
+            MSG msg;
+            while (PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ))
+            {
+                if (msg.message == WM_QUIT) return 0;
+                DispatchMessageW(&msg);
+            }
+            continue;
+        }
 
         switch (res)
         {




More information about the wine-cvs mailing list