+2009-03-24 Matthias Clasen <mclasen@redhat.com>
+
+ Bug 576306 – gdkscreen.c: get_nearest_monitor too simple, gives wrong
+ result, mispositioning tooltips
+
+ * gdk/gdkscreen.c (get_nearest_monitor): Make this function work.
+ Problem reported by Dave Gilbert.
+
2009-03-23 Hiroyuki Ikezoe <poincare@ikezoe.net>
Bug 576254 - <object> requires attribute "id"
gint num_monitors, i;
gint nearest_dist = G_MAXINT;
gint nearest_monitor = 0;
-
+
g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
num_monitors = gdk_screen_get_n_monitors (screen);
for (i = 0; i < num_monitors; i++)
{
GdkRectangle monitor;
- gint dist_x, dist_y;
+ gint dist_x, dist_y, dist;
gdk_screen_get_monitor_geometry (screen, i, &monitor);
else
dist_y = 0;
- if (MIN (dist_x, dist_y) < nearest_dist)
+ dist = dist_x + dist_y;
+ if (dist < nearest_dist)
{
- nearest_dist = MIN (dist_x, dist_y);
+ nearest_dist = dist;
nearest_monitor = i;
}
}