workspace: Set maxChromeWidth to window clone width

So far we allowed the titles of window overlays to expand their width to
be larger than the actual WindowClone, they could expand to the full
size of the Workspace.

Since we're now going to implement those titles as part of the
WindowClone itself, having this feature is no longer possible as easily
as it was before. That's because the clones are stacked according to the
stacking of the actual windows, and since the overlay-elements are
attached to those clones, they will also be shown underneath other
clones.

So stop allowing the titles to expand and limit their size to the width
of the clone, which makes sure titles never get shown above or
underneath other clones.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
This commit is contained in:
Jonas Dreßler 2020-06-04 17:39:44 +02:00
parent 96bfd1f8be
commit 2b4317349f

View File

@ -1627,11 +1627,7 @@ class Workspace extends St.Widget {
const cloneHeight = cellHeight;
clone.slot = [x, y, cloneWidth, cloneHeight];
let cloneCenter = x + cloneWidth / 2;
let maxChromeWidth = 2 * Math.min(
cloneCenter - area.x,
area.x + area.width - cloneCenter);
clone.overlay.setMaxChromeWidth(Math.round(maxChromeWidth));
clone.overlay.setMaxChromeWidth(cloneWidth);
if (clone.overlay && (initialPositioning || !clone.positioned))
clone.overlay.hide();