summaryrefslogtreecommitdiff
path: root/src/gs-visual-gl.c
diff options
context:
space:
mode:
authorMartin Wimpress <[email protected]>2017-01-18 14:39:59 +0000
committerGitHub <[email protected]>2017-01-18 14:39:59 +0000
commit00b0f944837025b61bdffd893d4614ed1d5e7dde (patch)
tree41a3450d67f77f98b4b70392eec923ea54013cc0 /src/gs-visual-gl.c
parent2197434c213600c42b264602c4331eac7761db11 (diff)
parent5d4416aa5853de486e62ca97207ee1da4b35b199 (diff)
downloadmate-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/gs-visual-gl.c')
-rw-r--r--src/gs-visual-gl.c20
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)
{