Use correct allocation in intellihide detection when fixed length

#2302
This commit is contained in:
Charles Gagnon
2025-04-13 10:07:18 -04:00
parent eb9a279464
commit 03b34b110b
3 changed files with 25 additions and 19 deletions

View File

@@ -394,11 +394,15 @@ export const Intellihide = class {
let varCoordY1 = this._monitor.y
let varOffset = {}
if (SETTINGS.get_boolean(limitSizeSetting)) {
if (geom.dockMode && SETTINGS.get_boolean(limitSizeSetting)) {
let refActor = geom.dynamic
? this._dtpPanel
: this._dtpPanel.clipContainer
varOffset[this._dtpPanel.varCoord.c1] =
this._dtpPanel.allocation[this._dtpPanel.varCoord.c1]
refActor.allocation[this._dtpPanel.varCoord.c1]
varOffset[this._dtpPanel.varCoord.c2] =
this._dtpPanel.allocation[this._dtpPanel.varCoord.c2]
refActor.allocation[this._dtpPanel.varCoord.c2]
}
// if vertical, ignore the original GS panel if present

View File

@@ -81,7 +81,7 @@ export const GS_PANEL_SIZE = 32
export const Panel = GObject.registerClass(
{},
class Panel extends St.Widget {
_init(panelManager, monitor, panelBox, isStandalone) {
_init(panelManager, monitor, clipContainer, panelBox, isStandalone) {
super._init({
style_class: 'dashtopanelPanel',
layout_manager: new Clutter.BinLayout(),
@@ -95,6 +95,7 @@ export const Panel = GObject.registerClass(
this.panelStyle = new PanelStyle.PanelStyle()
this.monitor = monitor
this.clipContainer = clipContainer
this.panelBox = panelBox
// when the original gnome-shell top panel is kept, all panels are "standalone",
@@ -1124,10 +1125,8 @@ export const Panel = GObject.registerClass(
}
_setPanelPosition() {
let clipContainer = this.panelBox.get_parent()
this.set_size(this.geom.w, this.geom.h)
clipContainer.set_position(this.geom.x, this.geom.y)
this.clipContainer.set_position(this.geom.x, this.geom.y)
this._setVertical(this.panel, this.checkIfVertical())
@@ -1147,14 +1146,13 @@ export const Panel = GObject.registerClass(
](cssName)
})
this._setPanelClip(clipContainer)
this._setPanelClip()
Main.layoutManager._updateHotCorners()
Main.layoutManager._updatePanelBarrier(this)
}
_setPanelClip(clipContainer) {
clipContainer = clipContainer || this.panelBox.get_parent()
_setPanelClip() {
this._timeoutsHandler.add([
T7,
0,
@@ -1164,9 +1162,9 @@ export const Panel = GObject.registerClass(
let h = vertical ? this.geom.h : this.geom.outerSize
Utils.setClip(
clipContainer,
clipContainer.x,
clipContainer.y,
this.clipContainer,
this.clipContainer.x,
this.clipContainer.y,
w,
h,
0,

View File

@@ -336,8 +336,6 @@ export const PanelManager = class {
p.disable()
let clipContainer = p.panelBox.get_parent()
Main.layoutManager._untrackActor(p)
Main.layoutManager._untrackActor(p.panelBox)
@@ -348,18 +346,18 @@ export const PanelManager = class {
p.remove_child(p.panel)
p.panelBox.add_child(p.panel)
p.panelBox.set_position(clipContainer.x, clipContainer.y)
p.panelBox.set_position(p.clipContainer.x, p.clipContainer.y)
delete p.panelBox._dtpIndex
clipContainer.remove_child(p.panelBox)
p.clipContainer.remove_child(p.panelBox)
Main.layoutManager.addChrome(p.panelBox, {
affectsStruts: true,
trackFullscreen: true,
})
}
Main.layoutManager.removeChrome(clipContainer)
Main.layoutManager.removeChrome(p.clipContainer)
})
if (Main.layoutManager.primaryMonitor) {
@@ -684,7 +682,13 @@ export const PanelManager = class {
affectsStruts: true,
})
panel = new Panel.Panel(this, monitor, panelBox, isStandalone)
panel = new Panel.Panel(
this,
monitor,
clipContainer,
panelBox,
isStandalone,
)
panelBox.add_child(panel)
panel.enable()