|
|
f60408 |
From 3d32ab1848011a3a7af97255307b3541a7553b09 Mon Sep 17 00:00:00 2001
|
|
|
f60408 |
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
|
|
f60408 |
Date: Wed, 14 Dec 2022 16:55:51 +0100
|
|
|
f60408 |
Subject: [PATCH] classification-banner: Handle fullscreen monitors
|
|
|
f60408 |
|
|
|
f60408 |
When a monitor is in fullscreen, we don't want its classification
|
|
|
f60408 |
banner to be offset by an imaginary panel, but at the top of the
|
|
|
f60408 |
screen.
|
|
|
f60408 |
---
|
|
|
f60408 |
extensions/classification-banner/extension.js | 22 +++++++++++++++----
|
|
|
f60408 |
1 file changed, 18 insertions(+), 4 deletions(-)
|
|
|
f60408 |
|
|
|
f60408 |
diff --git a/extensions/classification-banner/extension.js b/extensions/classification-banner/extension.js
|
|
|
f60408 |
index 6c2fe007..1cf03b3f 100644
|
|
|
f60408 |
--- a/extensions/classification-banner/extension.js
|
|
|
f60408 |
+++ b/extensions/classification-banner/extension.js
|
|
|
f60408 |
@@ -27,16 +27,19 @@ const Main = imports.ui.main;
|
|
|
f60408 |
const ClassificationBanner = GObject.registerClass(
|
|
|
f60408 |
class ClassificationBanner extends Clutter.Actor {
|
|
|
f60408 |
_init(index) {
|
|
|
f60408 |
+ const constraint = new Layout.MonitorConstraint({index});
|
|
|
f60408 |
super._init({
|
|
|
f60408 |
layout_manager: new Clutter.BinLayout(),
|
|
|
f60408 |
- constraints: new Layout.MonitorConstraint({
|
|
|
f60408 |
- work_area: true,
|
|
|
f60408 |
- index,
|
|
|
f60408 |
- }),
|
|
|
f60408 |
+ constraints: constraint,
|
|
|
f60408 |
});
|
|
|
f60408 |
+ this._monitorConstraint = constraint;
|
|
|
f60408 |
|
|
|
f60408 |
this._settings = ExtensionUtils.getSettings();
|
|
|
f60408 |
this.connect('destroy', () => {
|
|
|
f60408 |
+ if (this._fullscreenChangedId)
|
|
|
f60408 |
+ global.display.disconnect(this._fullscreenChangedId);
|
|
|
f60408 |
+ delete this._fullscreenChangedId;
|
|
|
f60408 |
+
|
|
|
f60408 |
if (this._settings)
|
|
|
f60408 |
this._settings.run_dispose();
|
|
|
f60408 |
this._settings = null;
|
|
|
f60408 |
@@ -95,6 +98,11 @@ class ClassificationBanner extends Clutter.Actor {
|
|
|
f60408 |
userLabel, 'visible',
|
|
|
f60408 |
Gio.SettingsBindFlags.GET);
|
|
|
f60408 |
|
|
|
f60408 |
+ this._fullscreenChangedId =
|
|
|
f60408 |
+ global.display.connect('in-fullscreen-changed',
|
|
|
f60408 |
+ () => this._updateMonitorConstraint());
|
|
|
f60408 |
+ this._updateMonitorConstraint();
|
|
|
f60408 |
+
|
|
|
f60408 |
this._settings.connect('changed::color',
|
|
|
f60408 |
() => this._updateStyles());
|
|
|
f60408 |
this._settings.connect('changed::background-color',
|
|
|
f60408 |
@@ -111,6 +119,12 @@ class ClassificationBanner extends Clutter.Actor {
|
|
|
f60408 |
return `${key}: rgba(${red},${green},${blue},${alpha / 255});`;
|
|
|
f60408 |
}
|
|
|
f60408 |
|
|
|
f60408 |
+ _updateMonitorConstraint() {
|
|
|
f60408 |
+ const {index} = this._monitorConstraint;
|
|
|
f60408 |
+ this._monitorConstraint.work_area =
|
|
|
f60408 |
+ !global.display.get_monitor_in_fullscreen(index);
|
|
|
f60408 |
+ }
|
|
|
f60408 |
+
|
|
|
f60408 |
_updateStyles() {
|
|
|
f60408 |
const bgStyle = this._getColorSetting('background-color');
|
|
|
f60408 |
const fgStyle = this._getColorSetting('color');
|
|
|
f60408 |
--
|
|
|
f60408 |
2.38.1
|
|
|
f60408 |
|