[Bf-blender-cvs] [0e6d70fec9a] blender-v3.2-release: Fix "Open Clip" operator in Clip Editor broken

Julian Eisel noreply at git.blender.org
Mon May 23 18:02:10 CEST 2022


Commit: 0e6d70fec9af379eabcf2600bd574dd1488f8751
Author: Julian Eisel
Date:   Wed May 11 13:16:54 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rB0e6d70fec9af379eabcf2600bd574dd1488f8751

Fix "Open Clip" operator in Clip Editor broken

Steps to reproduce were:
- Open Clip Editor
- Call "Open Clip" (e.g. Alt+O)
- Select video file

The file wouldn't be loaded into the Clip Editor.

Caused by 7849b56c3c41.

===================================================================

M	source/blender/windowmanager/intern/wm_event_system.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 54598355c41..1648bdfb9d4 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -4087,7 +4087,11 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op)
   /* Close any popups, like when opening a file browser from the splash. */
   UI_popup_handlers_remove_all(C, &root_win->modalhandlers);
 
-  CTX_wm_window_set(C, root_win);
+  /* Setting the context window unsets the context area & screen. Avoid doing that, so operators
+   * calling the file browser can operate in the context the browser was opened in. */
+  if (ctx_win != root_win) {
+    CTX_wm_window_set(C, root_win);
+  }
 
   /* The root window may already have a File Browser open. Cancel it if so, only 1 should be open
    * per window. The root context of this operation is also used for the new operation. */
@@ -4142,7 +4146,9 @@ void WM_event_add_fileselect(bContext *C, wmOperator *op)
 
   WM_event_fileselect_event(wm, op, EVT_FILESELECT_FULL_OPEN);
 
-  CTX_wm_window_set(C, ctx_win);
+  if (ctx_win != root_win) {
+    CTX_wm_window_set(C, ctx_win);
+  }
 }
 
 /** \} */



More information about the Bf-blender-cvs mailing list