summaryrefslogtreecommitdiff
path: root/gdk/gdkmonitor.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-05-17 05:23:16 +0200
committerBenjamin Otte <otte@redhat.com>2020-05-17 07:10:34 +0200
commite81a1db48c4cba5a96ea7f122b7d45e7d8c54eeb (patch)
tree6a6d4b42754a67791bb058f2d594fc85797592ed /gdk/gdkmonitor.c
parent33a4442988eb94efa02fc5529c92e4a868ee8768 (diff)
downloadgtk+-e81a1db48c4cba5a96ea7f122b7d45e7d8c54eeb.tar.gz
monitor: Add gdk_monitor_set_geometry()
Make it replace gdk_monitor_set_size() and gdk_monitor_set_position() which used to be called in pairs anyway.
Diffstat (limited to 'gdk/gdkmonitor.c')
-rw-r--r--gdk/gdkmonitor.c45
1 files changed, 6 insertions, 39 deletions
diff --git a/gdk/gdkmonitor.c b/gdk/gdkmonitor.c
index 97a1700cea..3e4b3180a0 100644
--- a/gdk/gdkmonitor.c
+++ b/gdk/gdkmonitor.c
@@ -531,47 +531,14 @@ gdk_monitor_set_connector (GdkMonitor *monitor,
}
void
-gdk_monitor_set_position (GdkMonitor *monitor,
- int x,
- int y)
+gdk_monitor_set_geometry (GdkMonitor *monitor,
+ const GdkRectangle *geometry)
{
- g_object_freeze_notify (G_OBJECT (monitor));
-
- if (monitor->geometry.x != x)
- {
- monitor->geometry.x = x;
- g_object_notify (G_OBJECT (monitor), "geometry");
- }
-
- if (monitor->geometry.y != y)
- {
- monitor->geometry.y = y;
- g_object_notify (G_OBJECT (monitor), "geometry");
- }
-
- g_object_thaw_notify (G_OBJECT (monitor));
-}
-
-void
-gdk_monitor_set_size (GdkMonitor *monitor,
- int width,
- int height)
-{
- g_object_freeze_notify (G_OBJECT (monitor));
-
- if (monitor->geometry.width != width)
- {
- monitor->geometry.width = width;
- g_object_notify (G_OBJECT (monitor), "geometry");
- }
-
- if (monitor->geometry.height != height)
- {
- monitor->geometry.height = height;
- g_object_notify (G_OBJECT (monitor), "geometry");
- }
+ if (gdk_rectangle_equal (&monitor->geometry, geometry))
+ return;
- g_object_thaw_notify (G_OBJECT (monitor));
+ monitor->geometry = *geometry;
+ g_object_notify (G_OBJECT (monitor), "geometry");
}
void