diff --git a/gdk/gdkscreen.c b/gdk/gdkscreen.c index 25b633ec78..415ff27229 100644 --- a/gdk/gdkscreen.c +++ b/gdk/gdkscreen.c @@ -294,9 +294,26 @@ gdk_screen_get_monitor_at_point (GdkScreen *screen, gint x, gint y) { - g_return_val_if_fail (GDK_IS_SCREEN (screen), -1); + gint num_monitors, i; - return GDK_SCREEN_GET_CLASS (screen)->get_monitor_at_point (screen, x,y); + g_return_val_if_fail (GDK_IS_SCREEN (screen), -1); + + num_monitors = gdk_screen_get_n_monitors (screen); + + for (i=0;i= monitor.x && + x < monitor.x + monitor.width && + y >= monitor.y && + y < (monitor.y + monitor.height)) + return i; + } + + return -1; } /** diff --git a/gdk/gdkscreen.h b/gdk/gdkscreen.h index cd636297b9..1fd5ffcab3 100644 --- a/gdk/gdkscreen.h +++ b/gdk/gdkscreen.h @@ -65,9 +65,6 @@ struct _GdkScreenClass void (*get_monitor_geometry) (GdkScreen *screen, gint monitor_num, GdkRectangle *dest); - gint (*get_monitor_at_point) (GdkScreen *screen, - gint x, - gint y); }; GType gdk_screen_get_type (void); diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c index 6126dc350c..5113986a43 100644 --- a/gdk/x11/gdkscreen-x11.c +++ b/gdk/x11/gdkscreen-x11.c @@ -49,9 +49,6 @@ static gint gdk_screen_x11_get_n_monitors (GdkScreen *scre static void gdk_screen_x11_get_monitor_geometry (GdkScreen *screen, gint num_monitor, GdkRectangle *dest); -static gint gdk_screen_x11_get_monitor_at_point (GdkScreen *screen, - gint x, - gint y); GType gdk_screen_x11_get_type (); static gpointer parent_class = NULL; @@ -100,7 +97,6 @@ gdk_screen_x11_class_init (GdkScreenX11Class * klass) screen_class->get_window_at_pointer = gdk_screen_x11_get_window_at_pointer; screen_class->get_n_monitors = gdk_screen_x11_get_n_monitors; screen_class->get_monitor_geometry = gdk_screen_x11_get_monitor_geometry; - screen_class->get_monitor_at_point = gdk_screen_x11_get_monitor_at_point; G_OBJECT_CLASS (klass)->finalize = gdk_screen_x11_finalize; parent_class = g_type_class_peek_parent (klass); @@ -259,31 +255,6 @@ gdk_screen_x11_get_monitor_geometry (GdkScreen *screen, *dest = screen_x11->monitors[num_monitor]; } -static gint -gdk_screen_x11_get_monitor_at_point (GdkScreen *screen, - gint x, - gint y) -{ - GdkScreenX11 *screen_x11 = GDK_SCREEN_X11 (screen); - int i; - GdkRectangle *monitor; - - g_return_val_if_fail (GDK_IS_SCREEN (screen), 0); - - for (i = 0, monitor = screen_x11->monitors; - i < screen_x11->num_monitors; - i++, monitor++) - { - if (x >= monitor->x && - x < monitor->x + monitor->width && - y >= monitor->y && - y < (monitor->y + monitor->height)) - return i; - } - - return -1; -} - Screen * gdk_x11_screen_get_xscreen (GdkScreen *screen) { diff --git a/tests/testxinerama.c b/tests/testxinerama.c index 2f6e05ea23..e202d5bc6d 100644 --- a/tests/testxinerama.c +++ b/tests/testxinerama.c @@ -42,7 +42,7 @@ main (int argc, char *argv[]) num_monitors = gdk_screen_get_n_monitors (screen); if (num_monitors == 1) - g_warning ("The current display does not support xinerama."); + g_warning ("The default screen of the current display only has one monitor."); for (i=0; i