]> git.saurik.com Git - wxWidgets.git/commitdiff
put both versions of wxGetMousePosition in one place so they can use one implementation
authorPaul Cornett <paulcor@bullseye.com>
Mon, 19 Nov 2012 04:17:42 +0000 (04:17 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Mon, 19 Nov 2012 04:17:42 +0000 (04:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/utilsgtk.cpp
src/gtk/window.cpp

index 28556077303c4f726eeae29565d4c6aabfdf88ce..13b7dbd4c2ea2bf7a48575fc867bfb0337b072fb 100644 (file)
@@ -97,11 +97,6 @@ void wxDisplaySizeMM( int *width, int *height )
     if (height) *height = gdk_screen_height_mm();
 }
 
-void wxGetMousePosition( int* x, int* y )
-{
-    gdk_window_get_pointer(gtk_widget_get_root_window(wxGetRootWindow()), x, y, NULL);
-}
-
 bool wxColourDisplay()
 {
     return true;
index ea80fb319d8f4846bb3bdb9b5d6f5718af9de9ac..bd423501af5c7c797b517b5cc1d08f3ff7951e99 100644 (file)
@@ -4686,18 +4686,23 @@ wxWindow* wxFindWindowAtPointer(wxPoint& pt)
 }
 
 // Get the current mouse position.
-wxPoint wxGetMousePosition()
+void wxGetMousePosition(int* x, int* y)
 {
-    int x, y;
     GdkDisplay* display = GetDisplay();
 #ifdef __WXGTK3__
     GdkDeviceManager* manager = gdk_display_get_device_manager(display);
     GdkDevice* device = gdk_device_manager_get_client_pointer(manager);
-    gdk_device_get_position(device, NULL, &x, &y);
+    gdk_device_get_position(device, NULL, x, y);
 #else
-    gdk_display_get_pointer(display, NULL, &x, &y, NULL);
+    gdk_display_get_pointer(display, NULL, x, y, NULL);
 #endif
-    return wxPoint(x, y);
+}
+
+wxPoint wxGetMousePosition()
+{
+    wxPoint pt;
+    wxGetMousePosition(&pt.x, &pt.y);
+    return pt;
 }
 
 GdkWindow* wxWindowGTK::GTKGetDrawingWindow() const