summaryrefslogtreecommitdiff
path: root/gdk/x11
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2014-11-05 12:02:18 +0100
committerAlexander Larsson <alexl@redhat.com>2014-11-05 12:02:18 +0100
commitdd721acb84ee0965abd37f816fe502f12be05e89 (patch)
treeba636e57db3ca6a16deb3aa9b666f57f3e212216 /gdk/x11
parente4bf60224b190638f6a88af897ef7ecdf817dc0e (diff)
downloadgtk+-dd721acb84ee0965abd37f816fe502f12be05e89.tar.gz
GdkGLContextX11: Only set swap interval when it changed
Diffstat (limited to 'gdk/x11')
-rw-r--r--gdk/x11/gdkglcontext-x11.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 2542b01cc2..bc48d4d7e8 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -533,6 +533,7 @@ gdk_x11_gl_context_class_init (GdkX11GLContextClass *klass)
static void
gdk_x11_gl_context_init (GdkX11GLContext *self)
{
+ self->do_frame_sync = TRUE;
}
gboolean
@@ -1175,12 +1176,15 @@ gdk_x11_display_make_gl_context_current (GdkDisplay *display,
screen = gdk_window_get_screen (window);
do_frame_sync = ! gdk_screen_is_composited (screen);
- context_x11->do_frame_sync = do_frame_sync;
+ if (do_frame_sync != context_x11->do_frame_sync)
+ {
+ context_x11->do_frame_sync = do_frame_sync;
- if (context_x11->do_frame_sync)
- glXSwapIntervalSGI (1);
- else
- glXSwapIntervalSGI (0);
+ if (do_frame_sync)
+ glXSwapIntervalSGI (1);
+ else
+ glXSwapIntervalSGI (0);
+ }
}
return TRUE;