From d094cf0297f28b826ca742379750567750dfee9f Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Mon, 4 Dec 2017 09:31:43 +0100 Subject: WidthOfScreen and HeightOfScreen implementation This commit reverts: https://github.com/mate-desktop/marco/commit/f0541e3dfda29c26fe14c9c9117f95c49006c75c https://github.com/mate-desktop/marco/commit/d18c2fb4acb58c408c01700682b9922de86e8b2f And it applies an alternative to fix the deprecated functions: gdk_screen_get_width gdk_screen_width gdk_screen_height --- src/wm-tester/main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/wm-tester') diff --git a/src/wm-tester/main.c b/src/wm-tester/main.c index b1cfac6f..1581f666 100644 --- a/src/wm-tester/main.c +++ b/src/wm-tester/main.c @@ -20,6 +20,7 @@ */ #include +#include #include #include @@ -117,16 +118,14 @@ evil_timeout (gpointer data) GtkWidget *c; int t; GtkWidget *parent; - int sc_width, sc_height; - - gdk_window_get_geometry (gdk_screen_get_root_window (gdk_screen_get_default()), - NULL, NULL, &sc_width, &sc_height); w = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_move (GTK_WINDOW (w), - g_random_int_range (0, sc_width), - g_random_int_range (0, sc_height)); + g_random_int_range (0, + WidthOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ()))), + g_random_int_range (0, + HeightOfScreen (gdk_x11_screen_get_xscreen (gdk_screen_get_default ())))); parent = NULL; -- cgit v1.2.1