From b0f5e35251f7fae9a6f8e8125b95767e637f767d Mon Sep 17 00:00:00 2001 From: Benny-png Date: Tue, 28 Jul 2026 12:12:03 +0300 Subject: [PATCH] Fix X11 input barrier in the autohide-disabled case too 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 --- dock.js | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/dock.js b/dock.js index d3202ad..45ce113 100644 --- a/dock.js +++ b/dock.js @@ -2,7 +2,6 @@ import * as Main from 'resource:///org/gnome/shell/ui/main.js'; import * as Fav from 'resource:///org/gnome/shell/ui/appFavorites.js'; -import * as Config from 'resource:///org/gnome/shell/misc/config.js'; import Shell from 'gi://Shell'; import GObject from 'gi://GObject'; @@ -170,6 +169,7 @@ export let Dock = GObject.registerClass( this._trashIcon = null; this._recentFilesIcon = null; this._downloadsIcon = null; + this._trackDashInput(); this._beginAnimation(); } @@ -426,33 +426,69 @@ export let Dock = GObject.registerClass( this._updateIconEffect(); + // The struts actor reserves work area. It must not take part in the + // input region: with autohide disabled it spans the full monitor + // width, so on X11 it would swallow every click in that band. Main.layoutManager.addChrome(this.struts, { affectsStruts: !this.extension.autohide_dash, - ...(Config.PACKAGE_VERSION[0] == '4' - ? { affectsInputRegion: true } - : {}), + affectsInputRegion: false, trackFullscreen: false, }); + // The dock container is sized to the whole monitor, so it cannot carry + // the input region either. Track the visible parts instead, so the + // clickable area matches what is actually drawn. Main.layoutManager.addChrome(this, { affectsStruts: false, - // affectsInputRegion: false, + affectsInputRegion: false, trackFullscreen: true, }); + // 2px edge strip -- stays reactive so autohide reveal keeps working Main.layoutManager.addChrome(this.dwell, { affectsStruts: false, - // affectsInputRegion: false, trackFullscreen: false, }); this._onChrome = true; + + if (this._background) { + Main.layoutManager.trackChrome(this._background, { + affectsInputRegion: true, + }); + } + this._trackDashInput(); + } + + // recreateDash() destroys and rebuilds this.dash, so its input tracking + // has to be re-established whenever that happens. + _trackDashInput() { + if (!this._onChrome) { + return; + } + if (this._trackedDash && this._trackedDash != this.dash) { + Main.layoutManager.untrackChrome(this._trackedDash); + this._trackedDash = null; + } + if (this.dash && this._trackedDash != this.dash) { + Main.layoutManager.trackChrome(this.dash, { + affectsInputRegion: true, + }); + this._trackedDash = this.dash; + } } removeFromChrome() { if (!this._onChrome) { return; } + if (this._trackedDash) { + Main.layoutManager.untrackChrome(this._trackedDash); + this._trackedDash = null; + } + if (this._background) { + Main.layoutManager.untrackChrome(this._background); + } Main.layoutManager.removeChrome(this.struts); Main.layoutManager.removeChrome(this); Main.layoutManager.removeChrome(this.dwell);