From fff97d1c192fbcf5e330fe5cf3ac7e17e97b4316 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Tue, 1 Apr 2025 08:46:36 -0400 Subject: [PATCH] Fix Gnome super+v and super+s when panel hidden gh-1560 --- src/intellihide.js | 27 +++++++++++++++------------ src/panel.js | 13 +++++++++++++ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/src/intellihide.js b/src/intellihide.js index b4a468a..4a660c7 100644 --- a/src/intellihide.js +++ b/src/intellihide.js @@ -139,13 +139,12 @@ export const Intellihide = class { } this._setTrackPanel(false) - - this._signalsHandler.destroy() - this._timeoutsHandler.destroy() - this._removeRevealMechanism() this._revealPanel(!reset) + + this._signalsHandler.destroy() + this._timeoutsHandler.destroy() } destroy() { @@ -163,7 +162,7 @@ export const Intellihide = class { ) } - revealAndHold(holdStatus) { + revealAndHold(holdStatus, immediate) { if ( !this.enabled || (holdStatus == Hold.NOTIFY && @@ -172,7 +171,7 @@ export const Intellihide = class { ) return - if (!this._holdStatus) this._revealPanel() + if (!this._holdStatus) this._revealPanel(immediate) this._holdStatus |= holdStatus @@ -399,7 +398,7 @@ export const Intellihide = class { Main.overview.visibleTarget || this._dtpPanel.taskbar.previewMenu.opened || this._dtpPanel.taskbar._dragMonitor || - this._panelBox.get_hover() || + this._hover || (this._dtpPanel.geom.position == St.Side.TOP && Main.layoutManager.panelBox.get_hover()) || this._checkIfGrab() @@ -488,9 +487,17 @@ export const Intellihide = class { Utils.stopAnimations(this._panelBox) this._animationDestination = destination + let update = () => + this._timeoutsHandler.add([ + T3, + POST_ANIMATE_MS, + () => this._queueUpdatePanelPosition(), + ]) + if (immediate) { this._panelBox[this._translationProp] = destination this._panelBox.visible = !destination + update() } else if (destination !== this._panelBox[this._translationProp]) { let tweenOpts = { //when entering/leaving the overview, use its animation time instead of the one from the settings @@ -506,11 +513,7 @@ export const Intellihide = class { onComplete: () => { this._panelBox.visible = !destination Main.layoutManager._queueUpdateRegions() - this._timeoutsHandler.add([ - T3, - POST_ANIMATE_MS, - () => this._queueUpdatePanelPosition(), - ]) + update() }, } diff --git a/src/panel.js b/src/panel.js index 206f034..09d3864 100644 --- a/src/panel.js +++ b/src/panel.js @@ -166,6 +166,18 @@ export const Panel = GObject.registerClass( this.statusArea = Main.panel.statusArea this.menuManager = Main.panel.menuManager + this.panel._toggleMenu = (indicator) => { + if ( + !indicator || + (!this.intellihide.enabled && !indicator.mapped) || + !indicator.reactive + ) + return + + this.intellihide.revealAndHold(0, true) + Object.getPrototypeOf(this.panel)._toggleMenu(indicator) + } + panelBoxes.forEach((p) => (this[p] = Main.panel[p])) ;['activities', systemMenuInfo.name, 'dateMenu'].forEach((b) => { let container = this.statusArea[b].container @@ -458,6 +470,7 @@ export const Panel = GObject.registerClass( this._setShowDesktopButton(false) + delete this.panel._toggleMenu delete Utils.getIndicators( this.statusArea[systemMenuName]._volumeOutput, )._dtpIgnoreScroll