[devhelp] util: get GdkMonitor workarea, not geometry, to know GtkWindow max size
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] util: get GdkMonitor workarea, not geometry, to know GtkWindow max size
- Date: Wed, 20 Dec 2017 17:52:08 +0000 (UTC)
commit 7df1bc792d59540606627c4a5911ab3c31db30ad
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Dec 20 18:46:35 2017 +0100
util: get GdkMonitor workarea, not geometry, to know GtkWindow max size
src/dh-util.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/dh-util.c b/src/dh-util.c
index 7be3835..bcb7f92 100644
--- a/src/dh-util.c
+++ b/src/dh-util.c
@@ -219,7 +219,7 @@ dh_util_window_settings_restore (GtkWindow *gtk_window,
GdkDisplay *display;
GdkWindow *gdk_window;
GdkMonitor *monitor;
- GdkRectangle monitor_geometry;
+ GdkRectangle monitor_workarea;
gint max_width;
gint max_height;
@@ -227,10 +227,10 @@ dh_util_window_settings_restore (GtkWindow *gtk_window,
/* To get the GdkWindow the widget must be realized. */
gdk_window = gtk_widget_get_window (GTK_WIDGET (gtk_window));
monitor = gdk_display_get_monitor_at_window (display, gdk_window);
- gdk_monitor_get_geometry (monitor, &monitor_geometry);
+ gdk_monitor_get_workarea (monitor, &monitor_workarea);
- max_width = monitor_geometry.width;
- max_height = monitor_geometry.height;
+ max_width = monitor_workarea.width;
+ max_height = monitor_workarea.height;
width = CLAMP (width, 0, max_width);
height = CLAMP (height, 0, max_height);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]