Fix chrome actors all reported on primary monitor on session start

#1753

get_transformed_position and get_transformed_size return 0,0 for a few frames on gnome-shell start, so all initial chrome actor visibilities are evaluated based on the fullscreen status of the primary monitor, even if those actors are on a secondary monitor. Vanilla gnome-shell chrome actors are all on the primary monitor anyway, so this works "perfectly", of course
This commit is contained in:
Charles Gagnon
2025-02-01 13:07:29 -05:00
parent 3d3802bbfe
commit 4226fd8d43

View File

@@ -153,6 +153,14 @@ export const PanelManager = class {
)
Main.layoutManager._updateHotCorners()
Main.layoutManager.findIndexForActor = (actor) =>
'_dtpIndex' in actor
? actor._dtpIndex
: Layout.LayoutManager.prototype.findIndexForActor.call(
Main.layoutManager,
actor,
)
this._forceHotCornerId = SETTINGS.connect(
'changed::stockgs-force-hotcorner',
() => Main.layoutManager._updateHotCorners(),
@@ -329,6 +337,8 @@ export const PanelManager = class {
Main.layoutManager._updateHotCorners = this._oldUpdateHotCorners
Main.layoutManager._updateHotCorners()
delete Main.layoutManager.findIndexForActor
SETTINGS.disconnect(this._forceHotCornerId)
if (this._enableHotCornersId) {
@@ -540,10 +550,7 @@ export const PanelManager = class {
panelBox.add_child(panel)
panel.enable()
panelBox.visible = true
if (monitor.inFullscreen) {
panelBox.hide()
}
panelBox._dtpIndex = monitor.index
panelBox.set_position(0, 0)
return panel