[Bf-blender-cvs] [c5a75b8] HMD_viewport: Fix modal HMD session handler only called while cursor is in main window

Julian Eisel noreply at git.blender.org
Wed Mar 16 16:11:02 CET 2016


Commit: c5a75b864792411f0a404331d7b3805684613ed9
Author: Julian Eisel
Date:   Fri Mar 11 03:30:19 2016 +0100
Branches: HMD_viewport
https://developer.blender.org/rBc5a75b864792411f0a404331d7b3805684613ed9

Fix modal HMD session handler only called while cursor is in main window

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

M	source/blender/editors/space_view3d/view3d_edit.c

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

diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 8c36e24..0fcda48 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -4898,7 +4898,19 @@ static int hmd_session_run_invoke(bContext *C, wmOperator *op, const wmEvent *UN
 
 		op->customdata = win;
 		WM_window_fullscreen_toggle(win, true, false);
-		WM_event_add_modal_handler(C, op);
+
+		{
+			wmWindow *win_store = CTX_wm_window(C);
+			ScrArea *sa_store = CTX_wm_area(C);
+			ARegion *ar_store = CTX_wm_region(C);
+			CTX_wm_window_set(C, win);
+			CTX_wm_area_set(C, sa);
+			CTX_wm_region_set(C, ar);
+			WM_event_add_modal_handler(C, op);
+			CTX_wm_region_set(C, ar_store);
+			CTX_wm_area_set(C, sa_store);
+			CTX_wm_window_set(C, win_store);
+		}
 		return OPERATOR_RUNNING_MODAL;
 	}
 }




More information about the Bf-blender-cvs mailing list