Skip to content

docking: Keep the dock composited over windows covering its monitor - #2761

Open
Dev-Kroz wants to merge 1 commit into
ubuntu:masterfrom
Dev-Kroz:master
Open

Dev-Kroz wants to merge 1 commit into
ubuntu:masterfrom
Dev-Kroz:master

Conversation

@Dev-Kroz

@Dev-Kroz Dev-Kroz commented Oct 18, 2026 •

Copy link
Copy Markdown

Summary

Fixes the dock flickering on Wayland when it is shown over a fullscreen window, or over a window that covers its whole monitor (for example a maximized window when no panel reserves space there, such as with Hide Top Bar or on a secondary monitor). Unredirection stays enabled.

Related: #2749, #2714, #1381 (and #2753, which takes a compositor-wide approach instead).

1. Keep composition while the dock is shown over a window covering its monitor

Mutter can directly scan out any window that covers the whole output, not only fullscreen ones, and it doesn't take shell actors stacked above the window into account. GNOME Shell's ease() wrapper inhibits unredirection only while an animation runs, so the dock is painted while it slides in. Once the animation completed, the dock was only holding its own inhibition when monitor.inFullscreen was true. Otherwise Mutter went back to direct scanout and the dock disappeared, which made it flicker.

  • inhibitsUnredirection now uses a new helper, _monitorMayBeScannedOut(). It returns true when the dock monitor is in fullscreen, or when the topmost visible window of that monitor covers it entirely (based on the window buffer rect).
  • The inhibition is still limited to the dock's own monitor and to the SHOWING, SHOWN and HIDING states. Fullscreen windows on other monitors keep using direct scanout while the dock is hidden.
  • DockManager re-evaluates the inhibition on restacked, window-entered-monitor, size-changed and unminimize, besides in-fullscreen-changed, since a window can start or stop covering a monitor without changing its fullscreen state. The window scan only runs while a dock is visible.

2. Ignore spurious leave events while the dock animates

While the dock slides over a window, the pointer pick can briefly hit the surface below it. The dock then receives a leave event even though the pointer didn't move, and autohide hid it.

  • _hoverChanged() checks the real pointer position against _staticBox (via _isPointerOverDock()) before hiding, and ignores the leave if the pointer is still over the dock.
  • Since no further hover change may follow, _checkPointerLeaveLater() polls the pointer every 100 ms until it really leaves, then re-runs _hoverChanged(). The check is cancelled when hover comes back, and removed on destroy.

Trade-offs

While the dock is shown over a window covering its own monitor, unredirection is inhibited compositor-wide, the same cost as the existing fullscreen case.

Testing

GNOME Shell 51.1 / Mutter 51.0, Wayland.

Mutter can directly scan out any window covering the whole output, not
only fullscreen ones, so once the dock show animation completed it was
not painted anymore, causing it to flicker. Inhibit unredirection while
the dock is shown and the top window of its monitor covers it, and
re-evaluate it when windows are restacked, resized or moved.

Also ignore spurious leave events received while the pointer is still
over the dock during its animations, tracking the pointer until it
actually leaves the dock area.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@martinszeltins

Copy link
Copy Markdown

+1 I am also experiencing flickering with Intelligent autohide

This branch has not been deployed

No deployments
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