diff options
author | Martin Wimpress <[email protected]> | 2017-01-18 14:39:59 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2017-01-18 14:39:59 +0000 |
commit | 00b0f944837025b61bdffd893d4614ed1d5e7dde (patch) | |
tree | 41a3450d67f77f98b4b70392eec923ea54013cc0 /src/test-window.c | |
parent | 2197434c213600c42b264602c4331eac7761db11 (diff) | |
parent | 5d4416aa5853de486e62ca97207ee1da4b35b199 (diff) | |
download | mate-screensaver-00b0f944837025b61bdffd893d4614ed1d5e7dde.tar.bz2 mate-screensaver-00b0f944837025b61bdffd893d4614ed1d5e7dde.tar.xz |
Merge pull request #110 from XRevan86/master
Avoid deprecated gdk_window_set_background functions
Diffstat (limited to 'src/test-window.c')
-rw-r--r-- | src/test-window.c | 28 |
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); |