From b210e404823cb5b1fa5b74d700fa3f89c2ea71a2 Mon Sep 17 00:00:00 2001 From: ZenWalker Date: Fri, 11 Aug 2017 01:41:13 +0200 Subject: avoid deprecated gdk_screen_width/height --- mate-dictionary/src/gdict-aligned-window.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mate-dictionary') diff --git a/mate-dictionary/src/gdict-aligned-window.c b/mate-dictionary/src/gdict-aligned-window.c index 37c03ca5..9d8330ab 100644 --- a/mate-dictionary/src/gdict-aligned-window.c +++ b/mate-dictionary/src/gdict-aligned-window.c @@ -157,6 +157,7 @@ gdict_aligned_window_position (GdictAlignedWindow *window) GdictAlignedWindowPrivate *priv; GtkWidget *align_widget; gint our_width, our_height; + gint sc_width, sc_height; gint entry_x, entry_y, entry_width, entry_height; gint x, y; GdkGravity gravity = GDK_GRAVITY_NORTH_WEST; @@ -189,7 +190,10 @@ gdict_aligned_window_position (GdictAlignedWindow *window) &entry_y); gdk_window_get_geometry (gdk_window, NULL, NULL, &entry_width, &entry_height); - if (entry_x + our_width < gdk_screen_width ()) + gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()), + NULL, NULL, &sc_width, &sc_height); + + if (entry_x + our_width < sc_width) x = entry_x + 1; else { @@ -198,7 +202,7 @@ gdict_aligned_window_position (GdictAlignedWindow *window) gravity = GDK_GRAVITY_NORTH_EAST; } - if (entry_y + entry_height + our_height < gdk_screen_height ()) + if (entry_y + entry_height + our_height < sc_height) y = entry_y + entry_height - 1; else { -- cgit v1.2.1