=== modified file 'src/canvas-x11-glx.cpp'
@@ -28,6 +28,7 @@
static PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT_;
static PFNGLXSWAPINTERVALMESAPROC glXSwapIntervalMESA_;
+static PFNGLXGETSWAPINTERVALMESAPROC glXGetSwapIntervalMESA_;
/*********************
* Protected methods *
@@ -60,11 +61,23 @@
return false;
}
- if ((!glXSwapIntervalEXT_ || glXSwapIntervalEXT_(xdpy_, xwin_, 0)) &&
- (!glXSwapIntervalMESA_ || glXSwapIntervalMESA_(0)))
- {
- Log::info("** Failed to set swap interval. Results may be bounded above by refresh rate.\n");
- }
+ unsigned int desired_swap(0);
+ unsigned int actual_swap(-1);
+ if (glXSwapIntervalEXT_) {
+ glXSwapIntervalEXT_(xdpy_, xwin_, desired_swap);
+ glXQueryDrawable(xdpy_, xwin_, GLX_SWAP_INTERVAL_EXT, &actual_swap);
+ if (actual_swap == desired_swap)
+ return true;
+ }
+
+ if (glXSwapIntervalMESA_) {
+ glXSwapIntervalMESA_(desired_swap);
+ actual_swap = glXGetSwapIntervalMESA_();
+ if (actual_swap == desired_swap)
+ return true;
+ }
+
+ Log::info("** Failed to set swap interval. Results may be bounded above by refresh rate.\n");
return true;
}
@@ -131,6 +144,12 @@
reinterpret_cast<const GLubyte *>("glXSwapIntervalMESA")
)
);
+ glXGetSwapIntervalMESA_ =
+ reinterpret_cast<PFNGLXGETSWAPINTERVALMESAPROC>(
+ glXGetProcAddress(
+ reinterpret_cast<const GLubyte *>("glXGetSwapIntervalMESA")
+ )
+ );
}