Repository navigation
popout: fix hover popouts closing in the gap to the bar - #4258
Conversation
With connected popouts off, a hover popout closed as soon as the pointer crossed the gap between the bar and the popout. The popout window now takes input over the whole area around it, so its hover-dismiss tracker is already hovered in the gap. The body's hover areas sit above that tracker, so entering the body reads as the pointer leaving, and the tracker dismisses unless the cursor is still within reach of the bar. A connected popout touches the bar, which is why only the standalone one closed. Moving onto the body is not leaving the popout, so the tracker no longer dismisses while the body is hovered. Leaving the body still closes the popout through the existing grace timer.
Claude reviewThe one-line fix only works if Qt clears hover in a particular order, so the gap bug can still happen in some sessions.
Checked: the PopoutHoverDismiss change and how it interacts with HoverDismissTracker, PopoutHoverBodyTracker, the DPopoutHost input mask, PopoutManager.cursorOverBar and DBarHoverController cursor updates. Model: claude-opus-5-5. |
| enabled: root.dismissEnabled && !root.dismissSuspended && root.surfaceVisible | ||
| shouldDismiss: function () { | ||
| return !PopoutManager.cursorOverBar(PopoutManager.hoverCursorGlobalX, PopoutManager.hoverCursorGlobalY); | ||
| return !root.bodyHovered && !PopoutManager.cursorOverBar(PopoutManager.hoverCursorGlobalX, PopoutManager.hoverCursorGlobalY); |
There was a problem hiding this comment.
This only works if bodyHovered is still true when this handler gets its leave. With inputMargin 0, the input mask is just contentContainer, so when the pointer leaves the popout surface, the body tracker and this tracker are both cleared by the same window leave. Qt delivers that leave in QHash order over hoverItems, and the hash seed changes per process. When the body tracker goes first, bodyHovered is already false, so we still dismiss immediately and the gap bug comes back in some sessions. When inputMargin > 0, the body leaves first, so this change never helps.
Fix that doesn't depend on order: don't dismiss immediately on the outer leave. Restart graceTimer from this tracker's onHoveredChanged when !hovered && enabled, and drop shouldDismiss/onDismissRequested. The timer already checks bodyHovered and cursorOverBar.
There was a problem hiding this comment.
Dammit the clanker was smarter than me. Will change this
Leaving the popout's outer hover area now restarts the existing grace timer instead of dismissing at once. The timer already skips closing while the body is hovered or the cursor is near the bar, so the result no longer depends on which hover handler hears about the move first.
Claude reviewNo issues found. The earlier ordering problem is fixed: the outer leave now restarts the grace timer instead of dismissing right away, and the timer checks Checked: PopoutHoverDismiss with HoverDismissTracker (an unhandled |
Description
With hover popouts on and connected popouts off, the popout closed as soon as the mouse entered the gap between the bar and the popout, so it couldn't be reached. Connected popouts touch the bar, which is why they weren't affected.
This restores the area in between the bar and the separated popout to be considerd part of the popout so moving into the popout no longer counts as leaving it. Leaving the popout still closes it like before.
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