[Bf-blender-cvs] [829561c03cc] master: Fix T66071: Navigation tooltip shows outside of 3D view

Campbell Barton noreply at git.blender.org
Mon Jun 24 09:33:50 CEST 2019


Commit: 829561c03cce4d2bfab18bba4e7e7b5351addcd3
Author: Campbell Barton
Date:   Mon Jun 24 17:05:22 2019 +1000
Branches: master
https://developer.blender.org/rB829561c03cce4d2bfab18bba4e7e7b5351addcd3

Fix T66071: Navigation tooltip shows outside of 3D view

Clear gizmo highlight when the cursor leaves the region.

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

M	source/blender/editors/screen/screen_edit.c
M	source/blender/windowmanager/gizmo/WM_gizmo_api.h
M	source/blender/windowmanager/gizmo/intern/wm_gizmo.c

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

diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index 3a90532aa56..e59477fbe6e 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -681,6 +681,15 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2])
             area_iter->type->deactivate(area_iter);
           }
 
+          if (ar == old_ar && ar != scr->active_region) {
+            wmGizmoMap *gzmap = old_ar->gizmo_map;
+            if (gzmap) {
+              if (WM_gizmo_highlight_set(gzmap, NULL)) {
+                ED_region_tag_redraw_no_rebuild(old_ar);
+              }
+            }
+          }
+
           if (ar == old_ar || ar == scr->active_region) {
             do_draw = true;
           }
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_api.h b/source/blender/windowmanager/gizmo/WM_gizmo_api.h
index 9b0936b47d1..5bf18a01af5 100644
--- a/source/blender/windowmanager/gizmo/WM_gizmo_api.h
+++ b/source/blender/windowmanager/gizmo/WM_gizmo_api.h
@@ -67,7 +67,7 @@ void WM_gizmo_unlink(ListBase *gizmolist,
 
 bool WM_gizmo_select_unlink(struct wmGizmoMap *gzmap, struct wmGizmo *gz);
 bool WM_gizmo_select_set(struct wmGizmoMap *gzmap, struct wmGizmo *gz, bool select);
-void WM_gizmo_highlight_set(struct wmGizmoMap *gzmap, struct wmGizmo *gz);
+bool WM_gizmo_highlight_set(struct wmGizmoMap *gzmap, struct wmGizmo *gz);
 
 void WM_gizmo_modal_set_from_setup(struct wmGizmoMap *gzmap,
                                    struct bContext *C,
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo.c
index b05865aa7bb..8eefea84ff8 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.c
@@ -443,9 +443,9 @@ bool WM_gizmo_select_set(wmGizmoMap *gzmap, wmGizmo *gz, bool select)
   return wm_gizmo_select_set_ex(gzmap, gz, select, true, true);
 }
 
-void WM_gizmo_highlight_set(wmGizmoMap *gzmap, wmGizmo *gz)
+bool WM_gizmo_highlight_set(wmGizmoMap *gzmap, wmGizmo *gz)
 {
-  wm_gizmomap_highlight_set(gzmap, NULL, gz, gz ? gz->highlight_part : 0);
+  return wm_gizmomap_highlight_set(gzmap, NULL, gz, gz ? gz->highlight_part : 0);
 }
 
 bool wm_gizmo_select_and_highlight(bContext *C, wmGizmoMap *gzmap, wmGizmo *gz)



More information about the Bf-blender-cvs mailing list