diff options
author | Alexei Sorokin <[email protected]> | 2017-01-17 00:10:40 +0300 |
---|---|---|
committer | Alexei Sorokin <[email protected]> | 2017-01-17 00:10:40 +0300 |
commit | 5d4416aa5853de486e62ca97207ee1da4b35b199 (patch) | |
tree | 41a3450d67f77f98b4b70392eec923ea54013cc0 /src/gs-visual-gl.c | |
parent | 6672c9811a6c6fe76810d2c66c69c4727910d91d (diff) | |
download | mate-screensaver-5d4416aa5853de486e62ca97207ee1da4b35b199.tar.bz2 mate-screensaver-5d4416aa5853de486e62ca97207ee1da4b35b199.tar.xz |
GTK+3.22: fix some GdkScreen related deprecations
Diffstat (limited to 'src/gs-visual-gl.c')
-rw-r--r-- | src/gs-visual-gl.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gs-visual-gl.c b/src/gs-visual-gl.c index 7dfe165..80bf8bb 100644 --- a/src/gs-visual-gl.c +++ b/src/gs-visual-gl.c @@ -38,13 +38,14 @@ #include "gs-debug.h" GdkVisual * -gs_visual_gl_get_best_for_screen (GdkScreen *screen) +gs_visual_gl_get_best_for_display (GdkDisplay *display) { - GdkVisual *visual; + GdkVisual *visual; #ifdef HAVE_LIBGL - GdkDisplay *display; - int screen_num; - int i; + Display *xdisplay; + GdkScreen *screen; + int screen_num; + int i; # define R GLX_RED_SIZE # define G GLX_GREEN_SIZE @@ -72,10 +73,11 @@ gs_visual_gl_get_best_for_screen (GdkScreen *screen) { GLX_RGBA, R, 1, G, 1, B, 1, D, 1, 0 } /* monochrome */ }; - g_return_val_if_fail (screen != NULL, NULL); + g_return_val_if_fail (display != NULL, NULL); - display = gdk_screen_get_display (screen); - screen_num = gdk_screen_get_number (screen); + xdisplay = GDK_DISPLAY_XDISPLAY (display); + screen = gdk_display_get_default_screen (display); + screen_num = GDK_SCREEN_XNUMBER (screen); gdk_error_trap_push (); @@ -84,7 +86,7 @@ gs_visual_gl_get_best_for_screen (GdkScreen *screen) { XVisualInfo *vi; - vi = glXChooseVisual (GDK_DISPLAY_XDISPLAY (display), screen_num, attrs [i]); + vi = glXChooseVisual (xdisplay, screen_num, attrs [i]); if (vi != NULL) { |