diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-07-01 10:01:02 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-07-01 10:01:35 +0400 |
commit | fef946312380683489874923cd44790741157377 (patch) | |
tree | c3e2c71dc828df4bfc801c723b6a9dd88d7fd658 /intern | |
parent | 9f05588b680b71d64fb560ebf6e597216f3e5d14 (diff) |
Fix T40065: Pressing Esc in separate render result window does not focus main window.
The problem is that the render window keeps keybord input focus even after it has been
lowered. Windows maintains the Z-order of windows, so the present solution is to raise
the window that has been just below the render window.
Differential revision: https://developer.blender.org/D594
Reviewed by: campbellbarton
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 8436e3b0242..30001408947 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -646,8 +646,23 @@ GHOST_TSuccess GHOST_WindowWin32::setState(GHOST_TWindowState state) GHOST_TSuccess GHOST_WindowWin32::setOrder(GHOST_TWindowOrder order) { - HWND hWndInsertAfter = order == GHOST_kWindowOrderTop ? HWND_TOP : HWND_BOTTOM; - return ::SetWindowPos(m_hWnd, hWndInsertAfter, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) == TRUE ? GHOST_kSuccess : GHOST_kFailure; + HWND hWndInsertAfter, hWndToRaise; + + if (order == GHOST_kWindowOrderBottom) { + hWndInsertAfter = HWND_BOTTOM; + hWndToRaise = ::GetWindow(m_hWnd, GW_HWNDNEXT); /* the window to raise */ + } + else { + hWndInsertAfter = HWND_TOP; + hWndToRaise = NULL; + } + if (::SetWindowPos(m_hWnd, hWndInsertAfter, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) == FALSE) { + return GHOST_kFailure; + } + if (hWndToRaise && ::SetWindowPos(hWndToRaise, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) == FALSE) { + return GHOST_kFailure; + } + return GHOST_kSuccess; } |