summaryrefslogtreecommitdiff
path: root/src/test-window.c
diff options
context:
space:
mode:
authorAlexei Sorokin <[email protected]>2017-01-17 00:10:40 +0300
committerAlexei Sorokin <[email protected]>2017-01-17 00:10:40 +0300
commit5d4416aa5853de486e62ca97207ee1da4b35b199 (patch)
tree41a3450d67f77f98b4b70392eec923ea54013cc0 /src/test-window.c
parent6672c9811a6c6fe76810d2c66c69c4727910d91d (diff)
downloadmate-screensaver-5d4416aa5853de486e62ca97207ee1da4b35b199.tar.bz2
mate-screensaver-5d4416aa5853de486e62ca97207ee1da4b35b199.tar.xz
GTK+3.22: fix some GdkScreen related deprecations
Diffstat (limited to 'src/test-window.c')
-rw-r--r--src/test-window.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/test-window.c b/src/test-window.c
index 05883a7..f07c5c7 100644
--- a/src/test-window.c
+++ b/src/test-window.c
@@ -60,7 +60,7 @@ window_show_cb (GSWindow *window,
/* Grab keyboard so dialog can be used */
gs_grab_move_to_window (grab,
gs_window_get_gdk_window (window),
- gs_window_get_screen (window),
+ gs_window_get_display (window),
FALSE);
}
@@ -120,18 +120,28 @@ connect_window_signals (GSWindow *window)
static void
test_window (void)
{
- GSWindow *window;
- gboolean lock_active;
- gboolean user_switch_enabled;
- GdkScreen *screen;
- int monitor;
+ GSWindow *window;
+ gboolean lock_active;
+ gboolean user_switch_enabled;
+ GdkDisplay *display;
+#if GTK_CHECK_VERSION (3, 22, 0)
+ GdkMonitor *monitor;
+#else
+ GdkScreen *screen;
+ int monitor;
+#endif
lock_active = TRUE;
user_switch_enabled = TRUE;
- screen = gdk_screen_get_default ();
- monitor = 0;
+ display = gdk_display_get_default ();
+#if GTK_CHECK_VERSION (3, 22, 0)
+ monitor = gdk_display_get_primary_monitor (display);
+#else
+ screen = gdk_display_get_default_screen (display);
+ monitor = gdk_screen_get_primary_monitor (screen);
+#endif
- window = gs_window_new (screen, monitor, lock_active);
+ window = gs_window_new (display, monitor, lock_active);
gs_window_set_user_switch_enabled (window, user_switch_enabled);