Skip to content

input/tablet: Send frame right after proximity_out - #2260

Merged
Drakulix merged 1 commit into
Smithay:masterfrom
faetalize:fix/2259-tablet-tool-proximity-out-frame
Nov 4, 2026
Merged

Drakulix merged 1 commit into
Smithay:masterfrom
faetalize:fix/2259-tablet-tool-proximity-out-frame

Conversation

@faetalize

@faetalize faetalize commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fixes #2259

when the tool moves between two surfaces of the same client, motion() now sends the old focus its frame between proximity_out and proximity_in. before, both frames only went out later from frame(), so the client saw proximity_out and proximity_in in one frame, followed by a duplicate frame. every other proximity_out path still leaves the frame to the compositor's frame() call, like 5c9782d intended (thanks @Ph4ntomas for the suggestion).

it's technically a workaround for a client bug: gtk applies proximity_in right away but proximity_out only on the frame, so it ends up with no focus and pen taps on menus get lost. gtk side: https://gitlab.gnome.org/GNOME/gtk/-/work_items/8525. mutter and wlroots both send a frame between the two too.

before, one crossing:

proximity_out()
proximity_in(…, wl_surface#46)
motion(…)
frame(520625115)
frame(520625115)

after:

proximity_out()
frame(557815767)
proximity_in(…, wl_surface#68)
motion(…)
frame(557815767)

tested on bento (niri fork) with a wacom intuos pt m and gtk 4.24.1: taps on menus and popovers register again, and there were no double frames across 10 crossings. that run was on the first version of this PR, which sent the frame from proximity_out(). this version gives the same order for a crossing and leaves the other paths as they were.

Checklist

Comment thread src/input/tablet/tool/mod.rs Resolved
@faetalize
faetalize force-pushed the fix/2259-tablet-tool-proximity-out-frame branch from 54927b4 to 5fff2ef Compare November 3, 2026 20:06
@faetalize
faetalize requested a review from Ph4ntomas November 3, 2026 20:10

@Ph4ntomas Ph4ntomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One small nitpick regarding the comment, but looks good to me, thanks!

Comment thread src/input/tablet/tool/mod.rs Resolved
When the tool moved between two surfaces of the same client, motion()
sent proximity_out and proximity_in back to back, and both frames only
went out later from frame(). The client saw proximity_out and
proximity_in in one frame, followed by a duplicate frame. GTK applies
proximity_in right away but proximity_out only on the frame, so it
ended up with no focus and pen taps on menus were lost.

Send previous_focus its frame between the two instead. Taking it there
also stops frame() from sending it a second time. Other proximity_out
paths keep deferring the frame to the compositor's frame() call.
mutter and wlroots also send a frame between proximity_out and
proximity_in.
@faetalize
faetalize force-pushed the fix/2259-tablet-tool-proximity-out-frame branch from 5fff2ef to ad4f22f Compare November 3, 2026 20:27

@Drakulix Drakulix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thanks!

@Drakulix
Drakulix merged commit 65aa86f into Smithay:master Nov 4, 2026
14 checks passed
@faetalize
faetalize deleted the fix/2259-tablet-tool-proximity-out-frame branch November 4, 2026 20: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.

Tablet tool: proximity_out and proximity_in to the same client end up in one frame

3 participants