Fixed mouse move problem
authorNathan Heisey <nathanheisey@gmail.com>
Tue, 26 Jul 2011 11:38:20 +0000
changeset 5927 463b84c19645
parent 5926 d9d57de9fb4e
child 5928 a3a52295bc0d
Fixed mouse move problem
src/main/beos/SDL_BApp.h
src/video/bwindow/SDL_BWin.h
src/video/bwindow/SDL_bmodes.cc
--- a/src/main/beos/SDL_BApp.h	Tue Jul 26 10:13:34 2011 +0000
+++ b/src/main/beos/SDL_BApp.h	Tue Jul 26 11:38:20 2011 +0000
@@ -202,16 +202,16 @@
 	void _HandleMouseMove(BMessage *msg) {
 		SDL_Window *win;
 		int32 winID;
-		int32 dx, dy;
+		int32 x = 0, y = 0;
 		if(	
 			!_GetWinID(msg, &winID) ||
-			msg->FindInt32("dx", &dx) != B_OK || /* x movement */
-			msg->FindInt32("dy", &dy) != B_OK    /* y movement */
+			msg->FindInt32("x", &x) != B_OK || /* x movement */
+			msg->FindInt32("y", &y) != B_OK    /* y movement */
 		) {
 			return;
 		}
 		win = _GetSDLWindow(winID);
-		SDL_SendMouseMotion(win, 0, dx, dy);
+		SDL_SendMouseMotion(win, 0, x, y);
 	}
 	
 	void _HandleMouseButton(BMessage *msg) {
--- a/src/video/bwindow/SDL_BWin.h	Tue Jul 26 10:13:34 2011 +0000
+++ b/src/video/bwindow/SDL_BWin.h	Tue Jul 26 11:38:20 2011 +0000
@@ -438,10 +438,9 @@
     			_MouseFocusEvent(true);
     		}
     		BMessage msg(BAPP_MOUSE_MOVED);
-    		msg.AddInt32("dx", where.x - x);
-    		msg.AddInt32("dy", where.y - y);
-    		x = (int) where.x;
-    		y = (int) where.y;    		
+    		msg.AddInt32("x", (int)where.x);
+    		msg.AddInt32("y", (int)where.y);
+ 		
     		_PostWindowEvent(msg);
     	}
     }
--- a/src/video/bwindow/SDL_bmodes.cc	Tue Jul 26 10:13:34 2011 +0000
+++ b/src/video/bwindow/SDL_bmodes.cc	Tue Jul 26 11:38:20 2011 +0000
@@ -151,7 +151,7 @@
 }
 
 int BE_QuitModes(_THIS) {
-	printf(__FILE__": %d; Begin quit\n", __LINE__);
+/*	printf(__FILE__": %d; Begin quit\n", __LINE__);*/
 	/* Restore the previous video mode */
 	BScreen screen;
 	display_mode *savedMode = _GetBeApp()->GetPrevMode();