[gnome-shell] windowPreview: Allow to disable overlay
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] windowPreview: Allow to disable overlay
- Date: Mon, 6 Jul 2020 22:45:54 +0000 (UTC)
commit c134091268b15624f3378dfebbb398f6a8f8c837
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Jun 26 17:01:31 2020 +0200
windowPreview: Allow to disable overlay
WindowPreviews now contain and manage overlaid elements like close
button or title label themselves. That's generally better, but right now
the only way to disable those overlays (for example during transitions)
is to prevent any hover or focus events from getting to the preview.
Instead, add some explicit API for enabling or disabling overlay support.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1345
js/ui/windowPreview.js | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
---
diff --git a/js/ui/windowPreview.js b/js/ui/windowPreview.js
index caa0732648..c5510e4c1a 100644
--- a/js/ui/windowPreview.js
+++ b/js/ui/windowPreview.js
@@ -189,6 +189,12 @@ var WindowPreviewLayout = GObject.registerClass({
});
var WindowPreview = GObject.registerClass({
+ Properties: {
+ 'overlay-enabled': GObject.ParamSpec.boolean(
+ 'overlay-enabled', 'overlay-enabled', 'overlay-enabled',
+ GObject.ParamFlags.READWRITE,
+ true),
+ },
Signals: {
'drag-begin': {},
'drag-cancelled': {},
@@ -255,6 +261,7 @@ var WindowPreview = GObject.registerClass({
this.inDrag = false;
this._selected = false;
+ this._overlayEnabled = true;
this._closeRequested = false;
this._idleHideOverlayId = 0;
@@ -434,6 +441,9 @@ var WindowPreview = GObject.registerClass({
}
showOverlay(animate) {
+ if (!this._overlayEnabled)
+ return;
+
const ongoingTransition = this._border.get_transition('opacity');
// Don't do anything if we're fully visible already
@@ -569,6 +579,25 @@ var WindowPreview = GObject.registerClass({
});
}
+ // eslint-disable-next-line camelcase
+ get overlay_enabled() {
+ return this._overlayEnabled;
+ }
+
+ // eslint-disable-next-line camelcase
+ set overlay_enabled(enabled) {
+ if (this._overlayEnabled === enabled)
+ return;
+
+ this._overlayEnabled = enabled;
+ this.notify('overlay-enabled');
+
+ if (!enabled)
+ this.hideOverlay(false);
+ else if (this['has-pointer'] || global.stage.key_focus === this)
+ this.showOverlay(true);
+ }
+
// Find the actor just below us, respecting reparenting done by DND code
_getActualStackAbove() {
if (this._stackAbove == null)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]