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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-06-28 19:00:42 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-06-28 19:00:42 +0400
commitd18d37d25f320f4dbe2ac1ef664c14ecd173719e (patch)
tree6460f76579536eb5096ab19c2b8f541bfa29591c /source/blender/windowmanager/intern/wm_event_system.c
parent6b2e35c8b7474eeae92551060b05036658cc1837 (diff)
parenta05b66defb14de86fa9845e16c0a8557a7a28723 (diff)
Cycles: svn merge -r37694:37904 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 6c8ed75dc8d..38e07235f89 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2371,18 +2371,11 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
if(win->active) {
GHOST_TEventCursorData *cd= customdata;
wmEvent *lastevent= win->queue.last;
-
-#if defined(__APPLE__) && defined(GHOST_COCOA)
- //Cocoa already uses coordinates with y=0 at bottom, and returns inwindow coordinates on mouse moved event
- evt->x= cd->x;
- evt->y= cd->y;
-#else
int cx, cy;
GHOST_ScreenToClient(win->ghostwin, cd->x, cd->y, &cx, &cy);
evt->x= cx;
evt->y= (win->sizey-1) - cy;
-#endif
event.x= evt->x;
event.y= evt->y;
@@ -2429,21 +2422,17 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.type= MOUSEPAN;
break;
}
-#if defined(__APPLE__) && defined(GHOST_COCOA)
- //Cocoa already uses coordinates with y=0 at bottom, and returns inwindow coordinates on mouse moved event
- event.x= evt->x = pd->x;
- event.y = evt->y = pd->y;
-#else
+
{
- int cx, cy;
- GHOST_ScreenToClient(win->ghostwin, pd->x, pd->y, &cx, &cy);
- event.x= evt->x= cx;
- event.y= evt->y= (win->sizey-1) - cy;
+ int cx, cy;
+ GHOST_ScreenToClient(win->ghostwin, pd->x, pd->y, &cx, &cy);
+ event.x= evt->x= cx;
+ event.y= evt->y= (win->sizey-1) - cy;
}
-#endif
+
// Use prevx/prevy so we can calculate the delta later
event.prevx= event.x - pd->deltaX;
- event.prevy= event.y - pd->deltaY;
+ event.prevy= event.y - (-pd->deltaY);
update_tablet_data(win, &event);
wm_event_add(win, &event);
@@ -2466,6 +2455,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) {