This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Quick fix for missing WM_KEYUP messages on window exits in multiwindow mode


Hi Earle,

It is beter if my patch is moved to the WM_KILLFOCUS message:-

diff -ubB save_winmultiwindowwindow.c winmultiwindowwindow.c
--- save_winmultiwindowwindow.c 2003-05-18 19:19:59.000000000 +0100
+++ winmultiwindowwindow.c      2003-05-22 14:20:11.000000000 +0100
@@ -984,6 +984,10 @@
       SendMessage(hwndScreen, message, wParam, lParam);
       return 0;

+    case WM_KILLFOCUS:
+      winKeybdReleaseKeys ();
+      return 0;
+
     case WM_SYSKEYDOWN:
     case WM_SYSKEYUP:
     case WM_SYSDEADCHAR:

This then fixes all the WM_KEYUP problems in multiwindow, including
'bulletproof way'
http://cygwin.com/ml/cygwin-xfree/2003-05/msg00296.html


Notice the lack of a trap on handles. Here's some trace of an xterm being
opened, receiving ctrl-d and then a new xterm being opened, to show why.

...
winInitMultiWindowWM - XOpenDisplay () returned and successfully opened the
display.
winMultiWindowXMsgProc - XOpenDisplay () returned and successfully opened
the display.
winClipboardProc - XOpenDisplay () returned and successfully opened the
display.
hWnd 00100234 pWin 10132ED0 hwndScreen 0015019C s_pScreenPriv 10108618
	winTopLevelWindowProc - WM_ACTIVATEAPP
hWnd 00100234 pWin 10132ED0 hwndScreen 0015019C s_pScreenPriv 10108618
	winTopLevelWindowProc - WM_SETFOCUS
GetWindowName
GetWindowName - XA_STRING xterm
GetWindowName
GetWindowName - XA_STRING root@linuxmachine:/scratch
hWnd 00100234 pWin 10132ED0 hwndScreen 0015019C s_pScreenPriv 10108618
	winTopLevelWindowProc - WM_KEYDOWN
hWnd 00100234 pWin 10132ED0 hwndScreen 0015019C s_pScreenPriv 10108618
	winTopLevelWindowProc - WM_KEYDOWN
hWnd 00100234 pWin 00000000 hwndScreen 00000000 s_pScreenPriv 00000000
	winTopLevelWindowProc - WM_ACTIVATEAPP
hWnd 00100234 pWin 00000000 hwndScreen 00000000 s_pScreenPriv 00000000
	winTopLevelWindowProc - WM_KILLFOCUS Release Keys
hWnd 00110234 pWin 101386D0 hwndScreen 0015019C s_pScreenPriv 10108618
	winTopLevelWindowProc - WM_ACTIVATEAPP
hWnd 00110234 pWin 101386D0 hwndScreen 0015019C s_pScreenPriv 10108618
	winTopLevelWindowProc - WM_SETFOCUS
GetWindowName
GetWindowName - XA_STRING xterm
GetWindowName
GetWindowName - XA_STRING root@linuxmachine:/scratch
...


Where I have captured the window handles before each message type case.

Still working on the mouse WM_(LMR)BUTTONUP problem...but don't hold your
breath!

Colin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]