diff --git a/internal/glfwwin/wglcontext_windows.go b/internal/glfwwin/wglcontext_windows.go index 78fff324e..f5a6bc33e 100644 --- a/internal/glfwwin/wglcontext_windows.go +++ b/internal/glfwwin/wglcontext_windows.go @@ -242,9 +242,8 @@ func swapBuffersWGL(window *Window) error { // HACK: Use DwmFlush when desktop composition is enabled if enabled { for i := 0; i < window.context.wgl.interval; i++ { - if err := _DwmFlush(); err != nil { - return err - } + // Ignore an error from DWM functions as they might not be implemented e.g. on Proton (#2113). + _ = _DwmFlush() } } } @@ -269,10 +268,10 @@ func swapIntervalWGL(interval int) error { enabled := _IsWindows8OrGreater() if !enabled { - var err error - enabled, err = _DwmIsCompositionEnabled() - if err != nil { - return err + e, err := _DwmIsCompositionEnabled() + // Ignore an error from DWM functions as they might not be implemented e.g. on Proton (#2113). + if err == nil { + enabled = e } } diff --git a/internal/glfwwin/win32window_windows.go b/internal/glfwwin/win32window_windows.go index e91e05671..3d00d5711 100644 --- a/internal/glfwwin/win32window_windows.go +++ b/internal/glfwwin/win32window_windows.go @@ -368,7 +368,8 @@ func (w *Window) updateFramebufferTransparency() error { composition, err := _DwmIsCompositionEnabled() if err != nil { - return err + // Ignore an error from DWM functions as they might not be implemented e.g. on Proton (#2113). + return nil } if !composition { return nil @@ -378,7 +379,8 @@ func (w *Window) updateFramebufferTransparency() error { if !_IsWindows8OrGreater() { _, opaque, err = _DwmGetColorizationColor() if err != nil { - return err + // Ignore an error from DWM functions as they might not be implemented e.g. on Proton (#2113). + return nil } } @@ -394,9 +396,9 @@ func (w *Window) updateFramebufferTransparency() error { hRgnBlur: region, fEnable: 1, // true } - if err := _DwmEnableBlurBehindWindow(w.win32.handle, &bb); err != nil { - return err - } + + // Ignore an error from DWM functions as they might not be implemented e.g. on Proton (#2113). + _ = _DwmEnableBlurBehindWindow(w.win32.handle, &bb) } else { // HACK: Disable framebuffer transparency on Windows 7 when the // colorization color is opaque, because otherwise the window @@ -405,9 +407,9 @@ func (w *Window) updateFramebufferTransparency() error { bb := _DWM_BLURBEHIND{ dwFlags: _DWM_BB_ENABLE, } - if err := _DwmEnableBlurBehindWindow(w.win32.handle, &bb); err != nil { - return err - } + + // Ignore an error from DWM functions as they might not be implemented e.g. on Proton (#2113). + _ = _DwmEnableBlurBehindWindow(w.win32.handle, &bb) } return nil }