Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2011-06-27 15:21:25 +0400
committerTon Roosendaal <ton@blender.org>2011-06-27 15:21:25 +0400
commitf10f3d3651a498b53e191df3bea7909462ca4ac0 (patch)
treef901bf3a0c6221bf75c747154e7e885475d3e737 /source/blender/windowmanager/intern/wm_event_system.c
parenta1abdf1c1c59f908684001d1d9b0b4bbc392cca7 (diff)
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.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 83ef46d109c..ce3830b059c 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2449,6 +2449,16 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
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) {