1
0
Fork 0

Updating 46/vertical-workspaces to version 46.2+20240828 [5b87af5].

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-03-24 19:44:06 +01:00
parent 6c3def31e8
commit f2db668ec8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
27 changed files with 6003 additions and 4248 deletions

View file

@ -11,7 +11,7 @@
'use strict';
import St from 'gi://St';
import Graphene from 'gi://Graphene';
// import Graphene from 'gi://Graphene';
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import * as Workspace from 'resource:///org/gnome/shell/ui/workspace.js';
@ -108,7 +108,6 @@ const WorkspaceLayout = {
}
},
// this fixes wrong size and position calculation of window clones while moving overview to the next (+1) workspace if vertical ws orientation is enabled in GS
_adjustSpacingAndPadding(rowSpacing, colSpacing, containerBox) {
if (this._sortedWindows.length === 0)
return [rowSpacing, colSpacing, containerBox];
@ -120,36 +119,46 @@ const WorkspaceLayout = {
const [topOversize, bottomOversize] = window.chromeHeights();
const [leftOversize, rightOversize] = window.chromeWidths();
const oversize = Math.max(topOversize, bottomOversize, leftOversize, rightOversize);
let oversize = Math.max(topOversize, bottomOversize, leftOversize, rightOversize);
if (rowSpacing !== null)
rowSpacing += oversize;
if (colSpacing !== null)
colSpacing += oversize;
if (containerBox) {
const vertical = global.workspaceManager.layout_rows === -1;
// Chrome highlights and window titles may exceed the workspace preview area
// and also the screen area if there is no overview element below/above/on_the_right of the workspace
// The original code tests whether window titles are out of the screen and applies correction accordingly
// That is a problem when workspaces are vertically stacked, because this method is called even during transitions between workspaces
// In V-Shell, this issue can be solved by reducing the workspace preview scale in the Settings
// Original code - horizontal orientation only
/* if (containerBox) {
const monitor = Main.layoutManager.monitors[this._monitorIndex];
const bottomPoint = new Graphene.Point3D();
if (vertical)
bottomPoint.x = containerBox.x2;
else
bottomPoint.y = containerBox.y2;
const bottomPoint = new Graphene.Point3D({ y: containerBox.y2 });
const transformedBottomPoint =
this._container.apply_transform_to_point(bottomPoint);
const bottomFreeSpace = vertical
? (monitor.x + monitor.height) - transformedBottomPoint.x
: (monitor.y + monitor.height) - transformedBottomPoint.y;
const bottomFreeSpace =
(monitor.y + monitor.height) - transformedBottomPoint.y;
const [, bottomOverlap] = window.overlapHeights();
if ((bottomOverlap + oversize) > bottomFreeSpace && !vertical)
if ((bottomOverlap + oversize) > bottomFreeSpace)
containerBox.y2 -= (bottomOverlap + oversize) - bottomFreeSpace;
}
}*/
// Alternative code reducing the box size unconditionally
/* if (containerBox) {
const [, bottomOverlap] = window.overlapHeights();
// Adjusting x1/x2 here is pointless,
// x1 only moves window previews to the right and down, x2 has no effect
// Prevent window previews from overlapping a workspace preview
oversize *= 1.5;
containerBox.y1 += oversize;
containerBox.y2 -= bottomOverlap + oversize;
}*/
return [rowSpacing, colSpacing, containerBox];
},