Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorLictex Steaven <lictex_>2022-03-24 19:40:18 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-03-24 19:41:29 +0300
commitdb4d5d15833dfcc79f54163c972de1dba6399639 (patch)
tree78f0fec311b46a26fb0626270146c2b69ff0a66c /intern
parentdcb520a7af74fd600e3ed7db19751a2f64c3e981 (diff)
Fix T90110: Dupli Window Not Immediately Active
When creating a new window from a duplicated area - by shift-dragging on corner action zones - on the Windows platform the resulting window is initially unresponsive. This patch fixes this by releasing the parent window's mouse capture. See D14085 for more details. Differential Revision: https://developer.blender.org/D14085 Reviewed by Ray Molenkamp
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp6
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.h9
2 files changed, 10 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 0f4b5147082..11a3c097958 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -151,6 +151,12 @@ GHOST_WindowWin32::GHOST_WindowWin32(GHOST_SystemWin32 *system,
::SetWindowPos(m_hWnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
+ if (parentwindow) {
+ /* Release any parent capture to allow immediate interaction (T90110). */
+ ::ReleaseCapture();
+ parentwindow->lostMouseCapture();
+ }
+
/* Show the window. */
int nCmdShow;
switch (state) {
diff --git a/intern/ghost/intern/GHOST_WindowWin32.h b/intern/ghost/intern/GHOST_WindowWin32.h
index 79b4e9d0cf6..d5f47871aff 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.h
+++ b/intern/ghost/intern/GHOST_WindowWin32.h
@@ -206,9 +206,7 @@ class GHOST_WindowWin32 : public GHOST_Window {
GHOST_TSuccess endProgressBar();
/**
- * Register a mouse capture state (should be called
- * for any real button press, controls mouse
- * capturing).
+ * Set or Release mouse capture (should be called for any real button press).
*
* \param event: Whether mouse was pressed and released,
* or an operator grabbed or ungrabbed the mouse.
@@ -216,8 +214,9 @@ class GHOST_WindowWin32 : public GHOST_Window {
void updateMouseCapture(GHOST_MouseCaptureEventWin32 event);
/**
- * Inform the window that it has lost mouse capture,
- * called in response to native window system messages.
+ * Inform the window that it has lost mouse capture, called in response to native window system
+ * messages (WA_INACTIVE, WM_CAPTURECHANGED) or if ReleaseCapture() is explicitly called (for new
+ * window creation).
*/
void lostMouseCapture();