pidgin/pidgin

59b7f06a3c0f
Parents 6746d9b67b3e
Children 76d2cb74b9f9
Rename the monitor geometry to geo to match other code
--- a/pidgin/gtkutils.c Fri Mar 20 09:57:21 2020 -0500
+++ b/pidgin/gtkutils.c Thu Mar 26 20:28:57 2020 -0500
@@ -803,8 +803,8 @@
{
GtkWidget *widget;
GtkRequisition requisition;
- GdkMonitor *m = NULL;
- GdkRectangle monitor;
+ GdkMonitor *monitor = NULL;
+ GdkRectangle geo;
gint space_left, space_right, space_above, space_below;
gboolean rtl;
@@ -821,7 +821,7 @@
*/
gtk_widget_get_preferred_size(widget, NULL, &requisition);
- m = gdk_display_get_monitor_at_point(gdk_display_get_default(), *x, *y);
+ monitor = gdk_display_get_monitor_at_point(gdk_display_get_default(), *x, *y);
*push_in = FALSE;
@@ -844,12 +844,12 @@
* Positioning in the vertical direction is similar: first try below
* mouse cursor, then above.
*/
- gdk_monitor_get_geometry(m, &monitor);
-
- space_left = *x - monitor.x;
- space_right = monitor.x + monitor.width - *x - 1;
- space_above = *y - monitor.y;
- space_below = monitor.y + monitor.height - *y - 1;
+ gdk_monitor_get_geometry(monitor, &geo);
+
+ space_left = *x - geo.x;
+ space_right = geo.x + geo.width - *x - 1;
+ space_above = *y - geo.y;
+ space_below = geo.y + geo.height - *y - 1;
/* position horizontally */
@@ -865,7 +865,7 @@
/* x is clamped on-screen further down */
}
- else if (requisition.width <= monitor.width)
+ else if (requisition.width <= geo.width)
{
/* the menu is too big to fit on either side of the mouse
* cursor, but smaller than the monitor. Position it on
@@ -874,12 +874,12 @@
if (space_left > space_right)
{
/* left justify */
- *x = monitor.x;
+ *x = geo.x;
}
else
{
/* right justify */
- *x = monitor.x + monitor.width - requisition.width;
+ *x = geo.x + geo.width - requisition.width;
}
}
else /* menu is simply too big for the monitor */
@@ -887,12 +887,12 @@
if (rtl)
{
/* right justify */
- *x = monitor.x + monitor.width - requisition.width;
+ *x = geo.x + geo.width - requisition.width;
}
else
{
/* left justify */
- *x = monitor.x;
+ *x = geo.x;
}
}
@@ -907,13 +907,13 @@
*y = *y - requisition.height + 1;
}
- *y = CLAMP (*y, monitor.y,
- monitor.y + monitor.height - requisition.height);
+ *y = CLAMP (*y, geo.y,
+ geo.y + geo.height - requisition.height);
} else {
if (space_below >= space_above)
- *y = monitor.y + monitor.height - requisition.height;
+ *y = geo.y + geo.height - requisition.height;
else
- *y = monitor.y;
+ *y = geo.y;
}
}