[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37854] trunk/blender/source/blender/ windowmanager/intern/wm_event_system.c: Bugfix #27768
Ton Roosendaal
ton at blender.org
Mon Jun 27 13:21:26 CEST 2011
Revision: 37854
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37854
Author: ton
Date: 2011-06-27 11:21:25 +0000 (Mon, 27 Jun 2011)
Log Message:
-----------
Bugfix #27768
On clicking in a non-active Blender window (when you activated others),
the mouse position of the first click was still the old position.
Problem is in GHOST; it sends out the 'activate window' event after the
mouseclick event itself. Code now checks for this case and reads the
correct mouse position.
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 2011-06-27 08:11:05 UTC (rev 37853)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 2011-06-27 11:21:25 UTC (rev 37854)
@@ -2449,6 +2449,16 @@
else
event.type= MIDDLEMOUSE;
+ if(win->active==0) {
+ int cx, cy;
+
+ /* entering window, update mouse pos. (ghost sends win-activate *after* the mouseclick in window!) */
+ wm_get_cursor_position(win, &cx, &cy);
+
+ event.x= evt->x= cx;
+ event.y= evt->y= cy;
+ }
+
/* add to other window if event is there (not to both!) */
owin= wm_event_cursor_other_windows(wm, win, &event);
if(owin) {
More information about the Bf-blender-cvs
mailing list