Skip to content

QtFRED fix drag selection on Linux - #7662

Draft
MjnMixael wants to merge 1 commit into
scp-fs2open:masterfrom
MjnMixael:qtfred-fix-mouse-drag
Draft

QtFRED fix drag selection on Linux#7662
MjnMixael wants to merge 1 commit into
scp-fs2open:masterfrom
MjnMixael:qtfred-fix-mouse-drag

Conversation

@MjnMixael

Copy link
Copy Markdown
Contributor

In QtFRED's viewport, dragging a selection box and whipping the cursor out of the viewport too fast could leave the box stuck on screen because the mouse-release event never made it back to the editor. This fix hopefully keeps the viewport listening to the mouse for the whole drag, even when the cursor leaves it, so the selection always finishes cleanly.

This only seems to affect Linux and I could not repro on Windows. This is the recommended fix I found after some research. Windows still seems to work as expected with this fix in place. This will need to be tested by someone with Linux.

…ion box

The render surface is a QWindow embedded via createWindowContainer that
forwards mouse events to RenderWidget. A native child window only receives
pointer events while the cursor is over it, so a fast drag that takes the
cursor out of the viewport drops the subsequent move/release events. The
button-release then never reaches mouseReleaseEvent, so the rubber-band
selection box is never finalized and stays stuck on screen (reported on
Linux).

Grab the mouse on the render QWindow for the duration of a left-button
drag so it keeps receiving events regardless of cursor position, and
release the grab at every drag-end path (normal release, Esc-cancel,
right-click-cancel, plus a move-handler safety net) so the grab can never
dangle. Preserves the existing forwarding and cursor handling; degrades
to prior behavior on platforms that refuse the grab.
@MjnMixael MjnMixael added the qtfred A feature or issue related to qtFred. label Jul 28, 2026
@github-project-automation github-project-automation Bot moved this to Work In Progress (PRs) in qtFRED2 Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qtfred A feature or issue related to qtFred.

Projects

Status: Work In Progress (PRs)

Development

Successfully merging this pull request may close these issues.

1 participant