[gnome-shell] workspace: Clip window previews
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] workspace: Clip window previews
- Date: Sun, 21 Feb 2021 15:58:56 +0000 (UTC)
commit b1970b95b8813c00895f3da9f4fc88ca04627954
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed Feb 17 11:09:31 2021 -0300
workspace: Clip window previews
Window previews can spill out of the container when their position in the
session overflows the monitor boundaries. In the past, Workspace didn't have
a visible background, and was (almost) always fullscreen, which would mask
this particular problem. However, nowadays, it is very much noticeable when
this situation happens.
Clip the window previews container to its allocation when the overview state
is bigger than WINDOW_PICKER. That is, between HIDDEN and WINDOW_PICKER states,
inclusive, no clipping is applied.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1691>
js/ui/workspace.js | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 47f1c69f2b..b849771a62 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -991,6 +991,16 @@ class Workspace extends St.Widget {
});
this._overviewAdjustment = overviewAdjustment;
+ this._overviewStateId = overviewAdjustment.connect('notify::value', () => {
+ const overviewState = overviewAdjustment.value;
+
+ // We want windows not to spill out when the overview is in
+ // APP_GRID state, but HIDDEN and WINDOW_PICKER should allow
+ // them to eventually draw outside the workspace.
+ this._container.clip_to_allocation =
+ overviewState > OverviewControls.ControlsState.WINDOW_PICKER;
+ });
+
this.monitorIndex = monitorIndex;
this._monitor = Main.layoutManager.monitors[this.monitorIndex];
@@ -1241,6 +1251,11 @@ class Workspace extends St.Widget {
this._layoutFrozenId = 0;
}
+ if (this._overviewStateId > 0) {
+ this._overviewAdjustment.disconnect(this._overviewStateId);
+ delete this._overviewStateId;
+ }
+
this._windows = [];
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]