[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51940] trunk/blender/source/blender/ windowmanager/intern/wm_event_system.c: Bugfix: on Linux (X11) the inactive window was not getting mouse-move events.
Ton Roosendaal
ton at blender.org
Tue Nov 6 14:22:36 CET 2012
Revision: 51940
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51940
Author: ton
Date: 2012-11-06 13:22:33 +0000 (Tue, 06 Nov 2012)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2012-11-06 12:20:10 UTC (rev 51939)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2012-11-06 13:22:33 UTC (rev 51940)
@@ -2731,47 +2731,45 @@
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:
More information about the Bf-blender-cvs
mailing list