Fix get_nearest_monitor
svn path=/trunk/; revision=22582
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
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"
|
||||
|
@ -221,7 +221,7 @@ get_nearest_monitor (GdkScreen *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);
|
||||
|
||||
@ -239,9 +239,10 @@ get_nearest_monitor (GdkScreen *screen,
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user