Skip to content

Fix X11 input barrier in the autohide-disabled case too - #356

Open
benny-png wants to merge 1 commit into
icedman:mainfrom
benny-png:fix-x11-input-barrier-autohide-off
Open

Fix X11 input barrier in the autohide-disabled case too#356
benny-png wants to merge 1 commit into
icedman:mainfrom
benny-png:fix-x11-input-barrier-autohide-off

Conversation

@benny-png

Copy link
Copy Markdown

Builds on #342 and #349 (both by other authors, both open) — same root cause, extended to cover the case they don't. Relates to #317 and #305.

What the existing PRs cover, and what they miss

#342 and #349 correctly identify that the dock container is registered via addChrome() with affectsInputRegion left at its default true, and that this leaves a full-width band in the X11 stage input region. Their fix — affectsInputRegion: false on the container — is right as far as it goes.

Both then rely on this reasoning:

Input for the visible dock is already carried by the struts actor (which is explicitly input-region-tracked and hidden together with the dock)

That holds only when autohide is enabled. struts is narrowed to the dock's width in animator.js:

if (dock.extension.autohide_dash) {
  dock.struts.x = dock._background.x + dock._monitor.x;
  dock.struts.width = dock._background.width;   // narrow, matches the dock
}

With autohide disabled that branch never runs, so struts.width stays at dock.width — the full monitor width — while addToChrome() still registers it with affectsInputRegion: true:

Main.layoutManager.addChrome(this.struts, {
  affectsStruts: !this.extension.autohide_dash,
  ...(Config.PACKAGE_VERSION[0] == '4' ? { affectsInputRegion: true } : {}),
  trackFullscreen: false,
});

(Config.PACKAGE_VERSION[0] == '4' is true for all of GNOME 40–49, so this applies on every currently supported shell.)

So for anyone running with autohide off, applying #342 or #349 leaves the dead band exactly as it was — the container stops covering it, and struts continues to.

Symptom

Dock at the bottom, autohide disabled: a full-monitor-width band along the bottom of the screen swallows clicks. Anything beneath it is unreachable — VLC's transport controls, a status bar, the last lines of a terminal. The band is noticeably taller than the visible dock, since the container is iconSize * 2 + iconSize * (0.6 * (1 + magnify)) tall.

Fix

Take both actors out of the input region, and track the parts that are actually drawn:

  • strutsaffectsInputRegion: false. It keeps affectsStruts, so work-area reservation is unchanged; it simply stops eating clicks. This also removes the Config.PACKAGE_VERSION conditional, which no longer has anything to gate.
  • container → affectsInputRegion: false, as in Fix invisible click barrier when dock is hidden on X11 #342/Fix X11 input barrier when dock is hidden; increase dwell strip height #349.
  • trackChrome() on _background and dash with affectsInputRegion: true, so the clickable region follows the visible dock in both autohide states rather than depending on struts geometry.
  • recreateDash() destroys and rebuilds this.dash, which would silently drop the tracking and leave the dock unclickable after any settings change, so re-tracking goes through a _trackDashInput() helper called from both places. removeFromChrome() untracks.
  • The 2px dwell strip is left reactive — it is what reveals the dock on autohide, and it is far too small to cause the problem.

untrackChrome() is safe to call on an already-destroyed actor: LayoutManager._untrackActor() returns early when the actor isn't found, and _trackActor() connects destroy to it, so a rebuilt dash cleans up after itself.

Config has no remaining references in dock.js, so the import is dropped.

Verification

Ubuntu, GNOME Shell 46.0, X11, dock at bottom, two 1920x1080 monitors with the dock's monitor at offset +1920+413. Tested in both autohide states:

autohide disabled (the case this PR adds)

  • Before: clicks in the bottom band never reached the window under it — VLC's seek bar and transport controls were dead across the full screen width, well above the visible icons.
  • After: those clicks land normally. Dock icons still click and scroll, magnification still works, and changing a dock setting (which triggers recreateDash()) leaves icons still clickable.

autohide enabled (the case #342/#349 target)

  • Dock hides and reveals from the edge strip as before, icons click, magnification works, and the band is clear while the dock is hidden.

Not tested: Wayland, and vertical (left/right) dock positions.

Happy to rebase onto #342 or #349 if you'd rather land one of those first and take only the struts half from here — this is written against main so it stands alone, but I don't want to step on either author's work.

Both the dock container and the struts actor were registered into the
shell's input region. The container is sized to the whole monitor, and
struts spans the full monitor width whenever autohide is disabled, so on
X11 a full-width band along the dock edge swallowed clicks that should
have reached the window underneath.

Setting affectsInputRegion:false on the container alone is not enough
when autohide is disabled, because struts is not narrowed to the dock
width in that configuration and keeps covering the whole edge.

Register neither actor in the input region, and track the visible parts
(_background and dash) instead, so the clickable area matches what is
drawn. The dash is destroyed and rebuilt by recreateDash(), so its
tracking is re-established through a small helper. The 2px dwell strip
stays reactive so autohide reveal is unaffected.

Config is no longer referenced in this file, so its import is dropped.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant