diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-08 16:02:03 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-08 16:02:03 +0300 |
commit | 0151be0210bf58a108d90f2c36b2ab3be2294d5a (patch) | |
tree | 2f3c969e2f1184c7c78228082edebe9b818ccc1b /source/blender/windowmanager | |
parent | 0304b623f559a515e844cdb12bec6a27e01251c2 (diff) |
UI: fix trailing tooltips when deactivating window, and when opening
right click menu. Added window deactivate event for this.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 10 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_event_types.h | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index bba38705e15..8e187eea93c 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -837,7 +837,7 @@ static int wm_eventmatch(wmEvent *winevent, wmKeyMapItem *kmi) static int wm_event_always_pass(wmEvent *event) { /* some events we always pass on, to ensure proper communication */ - return ELEM4(event->type, TIMER, TIMER0, TIMER1, TIMER2); + return ELEM5(event->type, TIMER, TIMER0, TIMER1, TIMER2, WINDEACTIVATE); } /* operator exists */ @@ -1812,5 +1812,13 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata) case GHOST_kEventUnknown: case GHOST_kNumEventTypes: break; + + case GHOST_kEventWindowDeactivate: { + event.type= WINDEACTIVATE; + wm_event_add(win, &event); + + break; + } + } } diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 542520ce1b0..31ad8cdcc63 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -574,6 +574,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr private) switch(type) { case GHOST_kEventWindowDeactivate: + wm_event_add_ghostevent(win, type, data); win->active= 0; /* XXX */ break; case GHOST_kEventWindowActivate: diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h index 8412e7f0b16..043ad8b1dcc 100644 --- a/source/blender/windowmanager/wm_event_types.h +++ b/source/blender/windowmanager/wm_event_types.h @@ -69,6 +69,7 @@ /* SYSTEM : 0x01x */ #define INPUTCHANGE 0x0103 /* input connected or disconnected */ +#define WINDEACTIVATE 0x0104 /* window is deactivated, focus lost */ #define TIMER 0x0110 /* timer event, passed on to all queues */ #define TIMER0 0x0111 /* timer event, slot for internal use */ |