Repository navigation
popout: refactor hover popup closing behaviour - #4359
Merged
Merged
Conversation
A hover-opened popout could stay open for good after the pointer left the bar sideways, just below the bar next to the popout, and then moved away. The bar decides once, shortly after the leave, and at that moment the pointer was still inside the popout's hover margin. The popout's own grace check only starts on hover changes, and when it ran it read a pointer position still on the bar. Later moves in the popout's dismiss zone updated the position but never ran the check again. Moves outside the popout body now start the grace check, so it runs on a fresh position. The strip between the bar and the popout body, over the body's width, counts as on the way into the popout, so moving from the widget down into the popout keeps it open whatever the popup gap, bottom gap or spacing.
Replace the strip between bar and popout with one safe zone: the popout body plus the trapezoid from the trigger widget's span at the screen edge to the body's bar-facing edge. A hover popout stays open while the pointer moves through it toward the popout or rests on the widget, and closes after the usual grace once the pointer leaves it, also when it slides along the bar past the zone. Resting still on the bar inside the zone, away from the widget and the popout, closes it after about 300 ms. The bar's hover chain and the popout's own dismiss check both use this shape, so they no longer disagree about the bar area. Inside the zone, passing over another bar widget no longer switches to its popout; resting on it for about 300 ms still does, and widgets that share the open popout (dash tabs, the process list) or the same widget (tray icons) switch right away. On an island bar the island neither hover-opens nor closes the bar's popout while the pointer crosses it inside the zone; once the pointer stops on it, it opens after its normal delay, and an island that was already open stays as it was. Leaving the island, or the zone, hands the decision back to the bar. The popout's dismiss check only trusts the zone while its own window saw the pointer, so a stale position can't keep it open on compositors where the popout window doesn't cover the gap.
Contributor
Claude reviewNo issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A popout opened by hovering a bar widget could stay open when the pointer left the bar right next to the popout and moved away without touching it. On the other hand, moving from the widget into the popout often brushed over a neighboring widget or the island on the way and switched to that instead.
Now there is a safe zone, the area that widens from the widget down to the popout (top left of the widget to top left of the popout and top right of the widget to top right of the popout roughly): while the pointer moves through it toward the popout or rests on the widget, the popout stays open, and once the pointer leaves it, the popout closes after the usual short delay.
Passing over another widget or the island inside that safezone doesn't open it, but resting on it for a moment still does, and widgets that open the same popout (like the dash tabs) switch right away.
Type of change
Related issues
Screenshots / video
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings