[Bf-blender-cvs] [d4dd0184a89] HMD_viewport: Fix virtual cursor not being removed correctly when stopping hmd session

Julian Eisel noreply at git.blender.org
Sat Apr 15 16:26:55 CEST 2017


Commit: d4dd0184a8961ad13d40d0ab7196568782b12e63
Author: Julian Eisel
Date:   Sat Apr 15 16:26:07 2017 +0200
Branches: HMD_viewport
https://developer.blender.org/rBd4dd0184a8961ad13d40d0ab7196568782b12e63

Fix virtual cursor not being removed correctly when stopping hmd session

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

M	source/blender/makesdna/DNA_windowmanager_types.h
M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 4efb2838496..bdea5f0ad3c 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -131,6 +131,7 @@ typedef struct ReportTimerInfo {
 
 struct HMDViewInfo {
 	struct wmWindow *hmd_win;         /* HMD (virtual reality) window. Stored to avoid lookups. */
+	void *cursor;                     /* Handle to deactivate the cursor drawing */
 
 	char view_shade; /* rna_enum_viewport_shade_items */
 	char flag;
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index f0ed46b9f9e..8c23e143aaa 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -4305,6 +4305,7 @@ static int hmd_session_toggle_invoke(bContext *C, wmOperator *UNUSED(op), const
 		WM_device_HMD_state_set(U.hmd_settings.device, false);
 		hmd_session_disable_viewlocks(wm);
 		WM_cursor_modal_restore(hmd_win);
+		WM_paint_cursor_end(wm, wm->hmd_view.cursor);
 	}
 	else {
 		/* start session */
@@ -4316,7 +4317,7 @@ static int hmd_session_toggle_invoke(bContext *C, wmOperator *UNUSED(op), const
 		}
 		hmd_session_prepare_screen(hmd_win);
 
-		WM_paint_cursor_activate(wm, NULL, hmd_session_cursor_draw, NULL);
+		wm->hmd_view.cursor = WM_paint_cursor_activate(wm, NULL, hmd_session_cursor_draw, NULL);
 	}
 
 	return OPERATOR_FINISHED;




More information about the Bf-blender-cvs mailing list