From 1aee8dafb5391e093f3a111f906ab0d8b6775510 Mon Sep 17 00:00:00 2001 From: marha Date: Sat, 28 Jan 2012 13:55:41 +0100 Subject: mesa xserver git update 28 jan 2012 --- xorg-server/hw/xwin/winmultiwindowwndproc.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'xorg-server/hw/xwin/winmultiwindowwndproc.c') diff --git a/xorg-server/hw/xwin/winmultiwindowwndproc.c b/xorg-server/hw/xwin/winmultiwindowwndproc.c index 3d23e9746..19dad579c 100644 --- a/xorg-server/hw/xwin/winmultiwindowwndproc.c +++ b/xorg-server/hw/xwin/winmultiwindowwndproc.c @@ -713,9 +713,11 @@ winTopLevelWindowProc (HWND hwnd, UINT message, /* Remove our keyboard hook if it is installed */ winRemoveKeyboardHookLL (); - if (!wParam) - /* Revert the X focus as well, but only if the Windows focus is going to another window */ - DeleteWindowFromAnyEvents(pWin, FALSE); + + /* Revert the X focus as well, but only if the Windows focus is going to another window */ + if (!wParam && pWin) + DeleteWindowFromAnyEvents(pWin, FALSE); + return 0; case WM_SYSDEADCHAR: @@ -898,7 +900,22 @@ winTopLevelWindowProc (HWND hwnd, UINT message, & ~WS_CAPTION & ~WS_SIZEBOX); winUpdateWindowPosition (hwnd, FALSE, &zstyle); - SetForegroundWindow (hwnd); + + { + WinXWMHints hints; + if (winMultiWindowGetWMHints(pWin, &hints)) + { + /* + Give the window focus, unless it has an InputHint + which is FALSE (this is used by e.g. glean to + avoid every test window grabbing the focus) + */ + if (!((hints.flags & InputHint) && (!hints.input))) + { + SetForegroundWindow (hwnd); + } + } + } } wmMsg.msg = WM_WM_MAP3; } -- cgit v1.2.3