summaryrefslogtreecommitdiff
path: root/mate-dictionary/src
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-08-21 17:47:54 +0200
committerZenWalker <[email protected]>2017-08-21 17:47:54 +0200
commit0f6161518c8666bc931b2ae18ddb57b8aa0ac067 (patch)
treed58003c3d49013128ddcf70a30eb9c908abd23e5 /mate-dictionary/src
parentb210e404823cb5b1fa5b74d700fa3f89c2ea71a2 (diff)
downloadmate-utils-0f6161518c8666bc931b2ae18ddb57b8aa0ac067.tar.bz2
mate-utils-0f6161518c8666bc931b2ae18ddb57b8aa0ac067.tar.xz
gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions:
avoid deprecated: gdk_screen_get_monitor_geometry gdk_screen_get_monitor_at_window
Diffstat (limited to 'mate-dictionary/src')
-rw-r--r--mate-dictionary/src/gdict-applet.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mate-dictionary/src/gdict-applet.c b/mate-dictionary/src/gdict-applet.c
index 3d4100c2..6269c5b1 100644
--- a/mate-dictionary/src/gdict-applet.c
+++ b/mate-dictionary/src/gdict-applet.c
@@ -130,8 +130,13 @@ set_window_default_size (GdictApplet *applet)
GtkWidget *widget, *defbox;
gint width, height;
gint font_size;
+#if GTK_CHECK_VERSION (3, 22, 0)
+ GdkDisplay *display;
+ GdkMonitor *monitor_num;
+#else
GdkScreen *screen;
gint monitor_num;
+#endif
GtkRequisition req;
GdkRectangle monitor;
@@ -154,11 +159,18 @@ set_window_default_size (GdictApplet *applet)
height = MAX (height, req.height);
/* ... but make it no larger than half the monitor size */
+#if GTK_CHECK_VERSION (3, 22, 0)
+ display = gtk_widget_get_display (widget);
+ monitor_num = gdk_display_get_monitor_at_window (display,
+ gtk_widget_get_window (widget));
+ gdk_monitor_get_geometry (monitor_num, &monitor);
+#else
screen = gtk_widget_get_screen (widget);
monitor_num = gdk_screen_get_monitor_at_window (screen,
gtk_widget_get_window (widget));
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
+#endif
width = MIN (width, monitor.width / 2);
height = MIN (height, monitor.height / 2);