Skip to content

cherrypick: Disable swap interval in GLX wxGLCanvas implementation too#5

Open
dmitrii-galantsev wants to merge 1 commit intoSoftFever:masterfrom
dmitrii-galantsev:dgalants/fix_xwayland
Open

cherrypick: Disable swap interval in GLX wxGLCanvas implementation too#5
dmitrii-galantsev wants to merge 1 commit intoSoftFever:masterfrom
dmitrii-galantsev:dgalants/fix_xwayland

Conversation

@dmitrii-galantsev
Copy link

Cherry-pick of wxWidgets@3dde6bd

Should resolve OrcaSlicer/OrcaSlicer#11849 and replace OrcaSlicer/OrcaSlicer#12119

Original:
We need to do it when using XWayland for the same reasons as we had to do it in the EGL version when using either XWayland or Wayland directly: without this, we can block for up to 1 second in glXSwapBuffers() if the window is hidden, see wxWidgets#23512.

Closes wxWidgets#24163.

Closes wxWidgets#24165.

We need to do it when using XWayland for the same reasons as we had to
do it in the EGL version when using either XWayland or Wayland directly:
without this, we can block for up to 1 second in glXSwapBuffers() if the
window is hidden, see wxWidgets#23512.

Closes wxWidgets#24163.

Closes wxWidgets#24165.
@dmitrii-galantsev
Copy link
Author

@SoftFever @Noisyfox
thanks for pointing me to the right place guys

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR cherry-picks a fix from the upstream wxWidgets project to disable swap interval in the GLX wxGLCanvas implementation. This addresses an issue where glXSwapBuffers() can block for up to 1 second when the window is hidden under XWayland, similar to issues previously resolved in the EGL implementation.

Changes:

  • Added wxGLSetSwapInterval helper function to disable blocking in glXSwapBuffers
  • Modified SwapBuffers() to call the new helper on first invocation
  • Added member variable m_swapIntervalSet to track whether swap interval has been configured

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
include/wx/unix/glx11.h Added m_swapIntervalSet boolean member to track swap interval configuration state
src/unix/glx11.cpp Added TRACE_GLX constant, wxGLSetSwapInterval helper function, and modified SwapBuffers() to disable swap interval on first call

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI becomes unresponsive in Linux Set swap interval to 0 in wxGLCanvasX11::SwapBuffers() too

2 participants