aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/winblock.c')
-rw-r--r--xorg-server/hw/xwin/winblock.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/xorg-server/hw/xwin/winblock.c b/xorg-server/hw/xwin/winblock.c
index a4ae8669f..c3ef4becd 100644
--- a/xorg-server/hw/xwin/winblock.c
+++ b/xorg-server/hw/xwin/winblock.c
@@ -42,14 +42,26 @@ winBlockHandler(ScreenPtr pScreen,
#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
winScreenPriv(pScreen);
#endif
- MSG msg;
#ifndef HAS_DEVWINDOWS
struct timeval **tvp = pTimeout;
if (*tvp != NULL) {
+ if (GetQueueStatus(QS_ALLINPUT | QS_ALLPOSTMESSAGE) != 0) {
+ /* If there are still messages to process on the Windows message
+ queue, make sure select() just polls rather than blocking.
+ */
+ (*tvp)->tv_sec = 0;
+ (*tvp)->tv_usec = 0;
+ }
+ else {
+ /* Otherwise, lacking /dev/windows, we must wake up again in
+ a reasonable time to check the Windows message queue. without
+ noticeable delay.
+ */
(*tvp)->tv_sec = 0;
(*tvp)->tv_usec = 100;
+ }
}
#endif
@@ -68,24 +80,12 @@ winBlockHandler(ScreenPtr pScreen,
if (iReturn != 0) {
ErrorF("winBlockHandler - pthread_mutex_unlock () failed: %d\n",
iReturn);
- goto winBlockHandler_ProcessMessages;
}
-
- winDebug("winBlockHandler - pthread_mutex_unlock () returned\n");
- }
-
- winBlockHandler_ProcessMessages:
-#endif
-
- /* Process all messages on our queue */
- while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
- if ((g_hDlgDepthChange == 0
- || !IsDialogMessage(g_hDlgDepthChange, &msg))
- && (g_hDlgExit == 0 || !IsDialogMessage(g_hDlgExit, &msg))
- && (g_hDlgAbout == 0 || !IsDialogMessage(g_hDlgAbout, &msg))) {
- DispatchMessage(&msg);
+ else {
+ winDebug("winBlockHandler - pthread_mutex_unlock () returned\n");
}
}
+#endif
/*
At least one X client has asked to suspend the screensaver, so