diff options
author | Ton Roosendaal <ton@blender.org> | 2011-03-09 21:42:35 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2011-03-09 21:42:35 +0300 |
commit | 108d150032a22f6eeb87253ec6ea5d4a88d1e8d8 (patch) | |
tree | b7ca4730646e283c153a2792fa4b8d2d54af49df /source/blender/editors/screen | |
parent | 2b8fca93aa6a09a61e4792d1ac394409019ee1df (diff) |
From the todo:
Hanging Tooltips solved!
It appeared to be that an active button remained in that state when
another region/editor became active. It then kept the button-activate
state, and therefore also the optional tooltip.
This only happened on fast moves, when a mousemove event was not passed
on anymore to the previously active subwindow.
It has been solved with a new notifier (SWINACTIVE), which gets sent on
new active regions. The screen listener then calls uiFreeActiveButtons()
to find out if buttons were still active somewhere else.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 44a7a7c48b3..41354c83cec 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -960,8 +960,9 @@ static void region_cursor_set(wmWindow *win, int swinid) } } -void ED_screen_do_listen(wmWindow *win, wmNotifier *note) +void ED_screen_do_listen(bContext *C, wmNotifier *note) { + wmWindow *win= CTX_wm_window(C); /* generic notes */ switch(note->category) { @@ -973,8 +974,11 @@ void ED_screen_do_listen(wmWindow *win, wmNotifier *note) win->screen->do_draw= 1; break; case NC_SCREEN: + if(note->data==ND_SUBWINACTIVE) + uiFreeActiveButtons(C, win->screen); if(note->action==NA_EDITED) win->screen->do_draw= win->screen->do_refresh= 1; + break; case NC_SCENE: if(note->data==ND_MODE) region_cursor_set(win, note->swinid); @@ -1217,8 +1221,10 @@ static void screen_cursor_set(wmWindow *win, wmEvent *event) /* called in wm_event_system.c. sets state vars in screen, cursors */ /* event type is mouse move */ -void ED_screen_set_subwinactive(wmWindow *win, wmEvent *event) +void ED_screen_set_subwinactive(bContext *C, wmEvent *event) { + wmWindow *win= CTX_wm_window(C); + if(win->screen) { bScreen *scr= win->screen; ScrArea *sa; @@ -1264,6 +1270,7 @@ void ED_screen_set_subwinactive(wmWindow *win, wmEvent *event) } else if(oldswin!=scr->subwinactive) { region_cursor_set(win, scr->subwinactive); + WM_event_add_notifier(C, NC_SCREEN|ND_SUBWINACTIVE, scr); } } } |