Index: ChangeLog =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/ChangeLog,v retrieving revision 1.6.2.1 diff -u -r1.6.2.1 ChangeLog --- ChangeLog 15 Dec 2004 19:22:53 -0000 1.6.2.1 +++ ChangeLog 10 Jan 2005 16:34:15 -0000 @@ -1,3 +1,22 @@ +2005-01-10 Alexander Gottwald + + * winkeybd.h + * winkeyhook.c + * winwndproc.c: + Make keyhook feature work in multiwindowmode too + Hook windows keys + +2005-01-06 Alexander Gottwald + + * winmultiwindowclass.c: + * winmultiwindowwm.c: + Fix crash with non-nullterminated strings (reported by Øyvind Harboe) + +2004-12-27 Alexander Gottwald + + * winmultiwindowwindow.c: + Bug #1945: Stop unnecessary reordering. (Kensuke Matsuzaki) + 2004-12-14 Alexander Gottwald * InitOutput.c: Index: winkeybd.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winkeybd.h,v retrieving revision 1.3 diff -u -r1.3 winkeybd.h --- winkeybd.h 21 Jun 2004 13:19:32 -0000 1.3 +++ winkeybd.h 10 Jan 2005 16:34:15 -0000 @@ -140,9 +140,9 @@ /* 88 */ 0, 0, 0, /* 89 */ 0, 0, 0, /* 90 */ 0, 0, 0, - /* 91 */ 0, 0, 0, - /* 92 */ 0, 0, 0, - /* 93 */ 0, 0, 0, + /* 91 */ VK_LWIN, KEY_LMeta, 0, + /* 92 */ VK_RWIN, KEY_RMeta, 0, + /* 93 */ VK_APPS, KEY_Menu, 0, /* 94 */ 0, 0, 0, /* 95 */ 0, 0, 0, /* 96 */ 0, 0, 0, Index: winkeyhook.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winkeyhook.c,v retrieving revision 1.2 diff -u -r1.2 winkeyhook.c --- winkeyhook.c 21 Jun 2004 13:19:32 -0000 1.2 +++ winkeyhook.c 10 Jan 2005 16:34:15 -0000 @@ -65,6 +65,7 @@ { BOOL fPassKeystroke = FALSE; PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT) lParam; + HWND hwnd = GetActiveWindow(); /* Pass keystrokes on to our main message loop */ if (iCode == HC_ACTION) @@ -79,9 +80,7 @@ case WM_KEYUP: case WM_SYSKEYUP: fPassKeystroke = ((p->vkCode == VK_TAB) && ((p->flags & LLKHF_ALTDOWN) != 0)) -#if 0 || (p->vkCode == VK_LWIN) || (p->vkCode == VK_RWIN) -#endif ; break; } @@ -107,7 +106,7 @@ lParamKey = lParamKey | (0x80000000 & ((p->flags & LLKHF_UP) << 24)); /* Send message to our main window that has the keyboard focus */ - PostMessage (g_hwndKeyboardFocus, + PostMessage (hwnd, (UINT) wParam, (WPARAM) p->vkCode, lParamKey); Index: winmultiwindowclass.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winmultiwindowclass.c,v retrieving revision 1.3 diff -u -r1.3 winmultiwindowclass.c --- winmultiwindowclass.c 21 Jun 2004 13:19:32 -0000 1.3 +++ winmultiwindowclass.c 10 Jan 2005 16:34:15 -0000 @@ -175,7 +175,7 @@ && prop->format == 8 && prop->data) { - len_role= strlen ((char *) prop->data); + len_role= prop->size; (*res_role) = malloc (len_role + 1); @@ -185,7 +185,8 @@ return 0; } - strcpy ((*res_role), prop->data); + strncpy ((*res_role), prop->data, len_role); + (*res_role)[len_role] = 0; return 1; } @@ -299,7 +300,7 @@ && prop->type == XA_STRING && prop->data) { - len_name = strlen ((char *) prop->data); + len_name = prop->size; (*wmName) = malloc (len_name + 1); @@ -309,8 +310,8 @@ return 0; } - /* Add one to len_name to allow copying of trailing 0 */ - strncpy ((*wmName), prop->data, len_name+1); + strncpy ((*wmName), prop->data, len_name); + (*wmName)[len_name] = 0; return 1; } Index: winmultiwindowwindow.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winmultiwindowwindow.c,v retrieving revision 1.3 diff -u -r1.3 winmultiwindowwindow.c --- winmultiwindowwindow.c 21 Jun 2004 13:19:32 -0000 1.3 +++ winmultiwindowwindow.c 10 Jan 2005 16:34:15 -0000 @@ -394,7 +394,8 @@ * Calling winReorderWindowsMultiWindow here means our window manager * (i.e. Windows Explorer) has initiative to determine Z order. */ - winReorderWindowsMultiWindow (); + if (pWin->nextSib != pOldNextSib) + winReorderWindowsMultiWindow (); #else /* Bail out if no window privates or window handle is invalid */ if (!pWinPriv || !pWinPriv->hWnd) Index: winmultiwindowwm.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winmultiwindowwm.c,v retrieving revision 1.3.4.1 diff -u -r1.3.4.1 winmultiwindowwm.c --- winmultiwindowwm.c 15 Dec 2004 19:22:53 -0000 1.3.4.1 +++ winmultiwindowwm.c 10 Jan 2005 16:34:15 -0000 @@ -405,7 +405,10 @@ /* */ if (xtpName.value) { - *ppName = strdup ((char*)xtpName.value); + int size = xtpName.nitems * (xtpName.format >> 3); + *ppName = malloc(size + 1); + strncpy(*ppName, xtpName.value, size); + (*ppName)[size] = 0; XFree (xtpName.value); } Index: winwndproc.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/hw/xwin/winwndproc.c,v retrieving revision 1.3.4.1 diff -u -r1.3.4.1 winwndproc.c --- winwndproc.c 15 Dec 2004 19:22:53 -0000 1.3.4.1 +++ winwndproc.c 10 Jan 2005 16:34:15 -0000 @@ -1012,7 +1012,7 @@ * be returned to Windows. We may be able to trap the Windows keys, * but we should determine if that is desirable before doing so. */ - if (wParam == VK_LWIN || wParam == VK_RWIN) + if ((wParam == VK_LWIN || wParam == VK_RWIN) && !g_fKeyboardHookLL) break; #ifdef XKB @@ -1053,7 +1053,7 @@ * be returned to Windows. We may be able to trap the Windows keys, * but we should determine if that is desirable before doing so. */ - if (wParam == VK_LWIN || wParam == VK_RWIN) + if ((wParam == VK_LWIN || wParam == VK_RWIN) && !g_fKeyboardHookLL) break; /* Ignore the fake Ctrl_L that follows an AltGr release */