diff options
author | Ton Roosendaal <ton@blender.org> | 2012-11-06 17:22:33 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-11-06 17:22:33 +0400 |
commit | 48f968edc264f914c071784571e6d8b6dc9aeab4 (patch) | |
tree | ae08b730ad2c6151d80720cdbc36f317e6daa343 /source/blender/windowmanager | |
parent | 804f642ebdea29a4bb7ee0b7d2e8efce9e94df98 (diff) |
Bugfix: on Linux (X11) the inactive window was not getting mouse-move events.
This feature has been working in OSX for long - to see mouse-overs on buttons
from inactive windows (and tooltips) and allow a button to be active for
input right away.
Will need check by linuxers if this works satisfying. Also Windows now might
support this feature.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 64 |
1 files changed, 31 insertions, 33 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index fee94b95a6a..7cfa3ce9396 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -2731,47 +2731,45 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U event = *evt; switch (type) { - /* mouse move */ + /* mouse move, also to inactive window (X11 does this) */ case GHOST_kEventCursorMove: { - if (win->active) { - GHOST_TEventCursorData *cd = customdata; - wmEvent *lastevent = win->queue.last; - int cx, cy; - - GHOST_ScreenToClient(win->ghostwin, cd->x, cd->y, &cx, &cy); - evt->x = cx; - evt->y = (win->sizey - 1) - cy; - - event.x = evt->x; - event.y = evt->y; + GHOST_TEventCursorData *cd = customdata; + wmEvent *lastevent = win->queue.last; + int cx, cy; + + GHOST_ScreenToClient(win->ghostwin, cd->x, cd->y, &cx, &cy); + evt->x = cx; + evt->y = (win->sizey - 1) - cy; + + event.x = evt->x; + event.y = evt->y; - event.type = MOUSEMOVE; + event.type = MOUSEMOVE; - /* some painting operators want accurate mouse events, they can - * handle in between mouse move moves, others can happily ignore - * them for better performance */ - if (lastevent && lastevent->type == MOUSEMOVE) - lastevent->type = INBETWEEN_MOUSEMOVE; + /* some painting operators want accurate mouse events, they can + * handle in between mouse move moves, others can happily ignore + * them for better performance */ + if (lastevent && lastevent->type == MOUSEMOVE) + lastevent->type = INBETWEEN_MOUSEMOVE; - update_tablet_data(win, &event); - wm_event_add(win, &event); + update_tablet_data(win, &event); + wm_event_add(win, &event); + + /* also add to other window if event is there, this makes overdraws disappear nicely */ + /* it remaps mousecoord to other window in event */ + owin = wm_event_cursor_other_windows(wm, win, &event); + if (owin) { + wmEvent oevent = *(owin->eventstate); - /* also add to other window if event is there, this makes overdraws disappear nicely */ - /* it remaps mousecoord to other window in event */ - owin = wm_event_cursor_other_windows(wm, win, &event); - if (owin) { - wmEvent oevent = *(owin->eventstate); - - oevent.x = owin->eventstate->x = event.x; - oevent.y = owin->eventstate->y = event.y; - oevent.type = MOUSEMOVE; - - update_tablet_data(owin, &oevent); - wm_event_add(owin, &oevent); - } + oevent.x = owin->eventstate->x = event.x; + oevent.y = owin->eventstate->y = event.y; + oevent.type = MOUSEMOVE; + update_tablet_data(owin, &oevent); + wm_event_add(owin, &oevent); } + break; } case GHOST_kEventTrackpad: |