Bugfix #27768
[blender.git] / source / blender / windowmanager / intern / wm_event_system.c
index 83ef46d109c2c1f767786777edebc16aec27564d..ce3830b059cb3c6e724c0c00988b0f9c803c2275 100644 (file)
@@ -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) {