Skip to content

qt: Avoid duplicate mouse capture requests#7156

Merged
OBattler merged 1 commit into
86Box:masterfrom
ChrisDeadman:qt-avoid-duplicate-mouse-capture-requests
May 20, 2026
Merged

qt: Avoid duplicate mouse capture requests#7156
OBattler merged 1 commit into
86Box:masterfrom
ChrisDeadman:qt-avoid-duplicate-mouse-capture-requests

Conversation

@ChrisDeadman

@ChrisDeadman ChrisDeadman commented May 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Repeated fullscreen toggles on Qt6/Wayland can re-enter mouse capture while the pointer is already locked, which ends in the Wayland protocol error about the surface already being constrained.

This crashes 86Box so badly on my machine that 86Box.cfg is overwritten with defaults for some reason.

It started after 7ea6e9c began capturing the mouse on every fullscreen entry.
The Qt handler behind setMouseCapture was not idempotent, so duplicate requests still ran the backend capture path.

Fix it by treating mouse capture as a real state transition and ignoring requests that do not change the stored capture state.

Checklist

  • Closes N/A
  • I have tested my changes locally and validated that the functionality works as intended
  • I have discussed this with core contributors already
  • This pull request doesn't require changes to the ROM set
  • This pull request doesn't require changes to the asset set

@OBattler OBattler merged commit 80be62d into 86Box:master May 20, 2026
45 checks passed
@ChrisDeadman ChrisDeadman deleted the qt-avoid-duplicate-mouse-capture-requests branch June 4, 2026 16:29
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.

2 participants