mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
WGL: Limit DWM swap interval hack to Vista and 7
This hack breaks when switching a window to fullscreen, if the OpenGL ICD detects this and switches its swapchain to exclusive mode. This limits the hack to Windows Vista and 7. This hack was added because of vsync jitter under DWM on Windows 7 and I have been unable to reproduce it on any later version. Is this change causing any problems on any version of Windows? Please open an issue! Fixes #1072
This commit is contained in:
parent
53d7622a3a
commit
4005f70eef
@ -271,6 +271,7 @@ information on what to include when reporting a bug.
|
|||||||
- [Wayland] Bugfix: Non-arrow cursors are offset from the hotspot (#1706,#1899)
|
- [Wayland] Bugfix: Non-arrow cursors are offset from the hotspot (#1706,#1899)
|
||||||
- [POSIX] Removed use of deprecated function `gettimeofday`
|
- [POSIX] Removed use of deprecated function `gettimeofday`
|
||||||
- [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
|
- [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
|
||||||
|
- [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072)
|
||||||
- [NSGL] Removed enforcement of forward-compatible flag for core contexts
|
- [NSGL] Removed enforcement of forward-compatible flag for core contexts
|
||||||
- [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer
|
- [NSGL] Bugfix: `GLFW_COCOA_RETINA_FRAMEBUFFER` had no effect on newer
|
||||||
macOS versions (#1442)
|
macOS versions (#1442)
|
||||||
|
@ -322,14 +322,12 @@ static void swapBuffersWGL(_GLFWwindow* window)
|
|||||||
{
|
{
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
{
|
{
|
||||||
if (IsWindowsVistaOrGreater())
|
// HACK: Use DwmFlush when desktop composition is enabled on Windows Vista and 7
|
||||||
|
if (!IsWindows8OrGreater() && IsWindowsVistaOrGreater())
|
||||||
{
|
{
|
||||||
// DWM Composition is always enabled on Win8+
|
BOOL enabled = FALSE;
|
||||||
BOOL enabled = IsWindows8OrGreater();
|
|
||||||
|
|
||||||
// HACK: Use DwmFlush when desktop composition is enabled
|
if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
|
||||||
if (enabled ||
|
|
||||||
(SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled))
|
|
||||||
{
|
{
|
||||||
int count = abs(window->context.wgl.interval);
|
int count = abs(window->context.wgl.interval);
|
||||||
while (count--)
|
while (count--)
|
||||||
@ -349,15 +347,13 @@ static void swapIntervalWGL(int interval)
|
|||||||
|
|
||||||
if (!window->monitor)
|
if (!window->monitor)
|
||||||
{
|
{
|
||||||
if (IsWindowsVistaOrGreater())
|
// HACK: Disable WGL swap interval when desktop composition is enabled on Windows
|
||||||
|
// Vista and 7 to avoid interfering with DWM vsync
|
||||||
|
if (!IsWindows8OrGreater() && IsWindowsVistaOrGreater())
|
||||||
{
|
{
|
||||||
// DWM Composition is always enabled on Win8+
|
BOOL enabled = FALSE;
|
||||||
BOOL enabled = IsWindows8OrGreater();
|
|
||||||
|
|
||||||
// HACK: Disable WGL swap interval when desktop composition is enabled to
|
if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
|
||||||
// avoid interfering with DWM vsync
|
|
||||||
if (enabled ||
|
|
||||||
(SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled))
|
|
||||||
interval = 0;
|
interval = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user