diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_screen.h | 3 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_edit.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/space_outliner.c | 9 |
4 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index 93c9c41e482..167fce4406c 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -84,6 +84,9 @@ typedef struct SpaceType { struct wmNotifier *wmn, struct Scene *scene); + /* called when the mouse moves out of the area */ + void (*deactivate)(struct ScrArea *sa); + /* refresh context, called after filereads, ED_area_tag_refresh() */ void (*refresh)(const struct bContext *C, struct ScrArea *sa); diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 07a87982890..3a90532aa56 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -675,6 +675,12 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) bool do_draw = false; for (ar = area_iter->regionbase.first; ar; ar = ar->next) { + + /* call old area's deactivate if assigned */ + if (ar == old_ar && area_iter->type->deactivate) { + area_iter->type->deactivate(area_iter); + } + if (ar == old_ar || ar == scr->active_region) { do_draw = true; } diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 90180c4ea47..c32b2b051f8 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -88,6 +88,11 @@ static int outliner_highlight_update(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) { + /* stop highlighting if out of area */ + if (!ED_screen_area_active(C)) { + return OPERATOR_PASS_THROUGH; + } + /* Drag and drop does own highlighting. */ wmWindowManager *wm = CTX_wm_manager(C); if (wm->drags.first) { diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 4c591a61f67..313e6014b88 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -384,6 +384,14 @@ static void outliner_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, } } +static void outliner_deactivate(struct ScrArea *sa) +{ + /* Remove hover highlights */ + SpaceOutliner *soops = sa->spacedata.first; + outliner_flag_set(&soops->tree, TSE_HIGHLIGHTED, false); + ED_region_tag_redraw(BKE_area_find_region_type(sa, RGN_TYPE_WINDOW)); +} + /* only called once, from space_api/spacetypes.c */ void ED_spacetype_outliner(void) { @@ -401,6 +409,7 @@ void ED_spacetype_outliner(void) st->keymap = outliner_keymap; st->dropboxes = outliner_dropboxes; st->id_remap = outliner_id_remap; + st->deactivate = outliner_deactivate; /* regions: main window */ art = MEM_callocN(sizeof(ARegionType), "spacetype outliner region"); |