From eb9a279464344cfa44d4eaff74fcd5c610c78477 Mon Sep 17 00:00:00 2001 From: Charles Gagnon Date: Sat, 12 Apr 2025 22:27:46 -0400 Subject: [PATCH] Consider original g-s top panel in intellihide --- src/intellihide.js | 12 +++++++++--- src/panel.js | 4 +++- src/panelManager.js | 6 +++--- src/windowPreview.js | 6 +++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/intellihide.js b/src/intellihide.js index 7549b40..cd8a4d6 100644 --- a/src/intellihide.js +++ b/src/intellihide.js @@ -389,7 +389,9 @@ export const Intellihide = class { } _pointerIn(x, y, fixedOffset, limitSizeSetting) { - let position = this._dtpPanel.geom.position + let geom = this._dtpPanel.geom + let position = geom.position + let varCoordY1 = this._monitor.y let varOffset = {} if (SETTINGS.get_boolean(limitSizeSetting)) { @@ -399,6 +401,10 @@ export const Intellihide = class { this._dtpPanel.allocation[this._dtpPanel.varCoord.c2] } + // if vertical, ignore the original GS panel if present + if (position == St.Side.LEFT || position == St.Side.RIGHT) + varCoordY1 = geom.y + return ( ((position == St.Side.TOP && y <= this._monitor.y + fixedOffset) || (position == St.Side.BOTTOM && @@ -408,8 +414,8 @@ export const Intellihide = class { x >= this._monitor.x + this._monitor.width - fixedOffset)) && x >= this._monitor.x + (varOffset.x1 || 0) && x < this._monitor.x + (varOffset.x2 || this._monitor.width) && - y >= this._monitor.y + (varOffset.y1 || 0) && - y < this._monitor.y + (varOffset.y2 || this._monitor.height) + y >= varCoordY1 + (varOffset.y1 || 0) && + y < varCoordY1 + (varOffset.y2 || this._monitor.height) ) } diff --git a/src/panel.js b/src/panel.js index 06ecf59..8198deb 100644 --- a/src/panel.js +++ b/src/panel.js @@ -76,6 +76,8 @@ const T7 = 'waitPanelBoxAllocation' const MIN_PANEL_SIZE = 22 +export const GS_PANEL_SIZE = 32 + export const Panel = GObject.registerClass( {}, class Panel extends St.Widget { @@ -782,7 +784,7 @@ export const Panel = GObject.registerClass( SETTINGS.get_boolean('stockgs-keep-top-panel') && Main.layoutManager.primaryMonitor == this.monitor ) { - gsTopPanelHeight = Main.layoutManager.panelBox.height + gsTopPanelHeight = GS_PANEL_SIZE topOffset = position == St.Side.TOP ? gsTopPanelHeight : 0 } diff --git a/src/panelManager.js b/src/panelManager.js index 036c491..9704764 100755 --- a/src/panelManager.js +++ b/src/panelManager.js @@ -997,9 +997,9 @@ function newUpdateHotCorners() { corner.setBarrierSize = (size) => Object.getPrototypeOf(corner).setBarrierSize.call( corner, - Math.min(size, 32), + Math.min(size, Panel.GS_PANEL_SIZE), ) - corner.setBarrierSize(panel ? panel.geom.innerSize : 32) + corner.setBarrierSize(panel ? panel.geom.innerSize : Panel.GS_PANEL_SIZE) this.hotCorners.push(corner) } else { this.hotCorners.push(null) @@ -1109,7 +1109,7 @@ function _newLookingGlassResize() { ? Main.layoutManager.panelBox.height : 0) + 8 - : 32 + : Panel.GS_PANEL_SIZE this._oldResize() diff --git a/src/windowPreview.js b/src/windowPreview.js index 471c819..ed1b1ee 100644 --- a/src/windowPreview.js +++ b/src/windowPreview.js @@ -518,7 +518,11 @@ export const PreviewMenu = GObject.registerClass( (panelSize + previewSize) + panelBoxTheme.get_padding(St.Side.LEFT) } else if (geom.position == St.Side.TOP) { - y = geom.y + panelSize - panelBoxTheme.get_padding(St.Side.BOTTOM) + y = + geom.y + + geom.topOffset + + panelSize - + panelBoxTheme.get_padding(St.Side.BOTTOM) } else { //St.Side.BOTTOM y =