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/interface | |
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/interface')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 67154a41e32..7c3cb006225 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -144,11 +144,11 @@ typedef struct uiHandleButtonData { float dragf, dragfstart; CBData *dragcbd; - /* menu open */ + /* menu open (watch uiFreeActiveButtons) */ uiPopupBlockHandle *menu; int menuretval; - /* search box */ + /* search box (watch uiFreeActiveButtons) */ ARegion *searchbox; /* post activate */ @@ -4595,6 +4595,27 @@ int ui_button_is_active(ARegion *ar) return (ui_but_find_activated(ar) != NULL); } +/* is called by notifier */ +void uiFreeActiveButtons(const bContext *C, bScreen *screen) +{ + ScrArea *sa= screen->areabase.first; + + for(;sa; sa= sa->next) { + ARegion *ar= sa->regionbase.first; + for(;ar; ar= ar->next) { + uiBut *but= ui_but_find_activated(ar); + if(but) { + uiHandleButtonData *data= but->active; + + if(data->menu==NULL && data->searchbox==NULL) + ui_button_active_free(C, but); + } + } + } +} + + + /* returns TRUE if highlighted button allows drop of names */ /* called in region context */ int UI_but_active_drop_name(bContext *C) |