diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-03-24 20:19:47 +0000 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2012-01-26 14:40:23 +0000 |
commit | c0f3709501a0afd3bf77e783f11d2c2e5f489d3b (patch) | |
tree | 796f6486eb87a58a917e4c96059e472859e11057 /hw/xwin/winmultiwindowwndproc.c | |
parent | 25caa8565d7d10f4c254bca5bb9efa05a77542ad (diff) |
hw/xwin: In multiwindow mode, don't grab native input focus for new windows which hint they don't want it
In multiwindow mode, avoid grabbing the input focus for newly
created windows which have InputHint FALSE
(this is used by e.g. glean to avoid every test window grabbing
the focus)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'hw/xwin/winmultiwindowwndproc.c')
-rw-r--r-- | hw/xwin/winmultiwindowwndproc.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 3d23e9746..1d57a5182 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -898,7 +898,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; } |