From b1ed030f7d7271147fec4c4ab6429d7fd16e0711 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Thu, 21 Dec 2017 00:27:39 +0100 Subject: WidthOfScreen and HeightOfScreen implementation This commit reverts: https://github.com/mate-desktop/mate-utils/commit/b210e404823cb5b1fa5b74d700fa3f89c2ea71a2 https://github.com/mate-desktop/mate-utils/commit/c0b5081bf32ee22094e15c5d76a8ac8e5806e4a5 And it applies an alternative to fix the deprecated functions: gkd_screen_width gdk_screen_height gdk_screen_get_width gdk_screen_get_height --- mate-dictionary/src/gdict-aligned-window.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'mate-dictionary') diff --git a/mate-dictionary/src/gdict-aligned-window.c b/mate-dictionary/src/gdict-aligned-window.c index 9d8330ab..a87de3d5 100644 --- a/mate-dictionary/src/gdict-aligned-window.c +++ b/mate-dictionary/src/gdict-aligned-window.c @@ -29,6 +29,7 @@ #include #include +#include #include "gdict-aligned-window.h" @@ -157,7 +158,6 @@ 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; @@ -190,10 +190,7 @@ gdict_aligned_window_position (GdictAlignedWindow *window) &entry_y); gdk_window_get_geometry (gdk_window, NULL, NULL, &entry_width, &entry_height); - 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) + if (entry_x + our_width < WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()))) x = entry_x + 1; else { @@ -202,7 +199,7 @@ gdict_aligned_window_position (GdictAlignedWindow *window) gravity = GDK_GRAVITY_NORTH_EAST; } - if (entry_y + entry_height + our_height < sc_height) + if (entry_y + entry_height + our_height < HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()))) y = entry_y + entry_height - 1; else { -- cgit v1.2.1