Consider original g-s top panel in intellihide

This commit is contained in:
Charles Gagnon
2025-04-12 22:27:46 -04:00
parent 4c55cea472
commit eb9a279464
4 changed files with 20 additions and 8 deletions

View File

@@ -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)
)
}

View File

@@ -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
}

View File

@@ -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()

View File

@@ -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 =