Updating 46/vertical-workspaces to version 46.2+20240828 [5b87af5].
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
6c3def31e8
commit
f2db668ec8
27 changed files with 6003 additions and 4248 deletions
|
@ -10,24 +10,30 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import GLib from 'gi://GLib';
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Shell from 'gi://Shell';
|
||||
import Gio from 'gi://Gio';
|
||||
import St from 'gi://St';
|
||||
|
||||
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
|
||||
import * as ModalDialog from 'resource:///org/gnome/shell/ui/modalDialog.js';
|
||||
import { InjectionManager } from 'resource:///org/gnome/shell/extensions/extension.js';
|
||||
|
||||
let Me;
|
||||
let _;
|
||||
let _installedExtensions;
|
||||
|
||||
export function init(me) {
|
||||
Me = me;
|
||||
_ = Me.gettext;
|
||||
}
|
||||
|
||||
export function cleanGlobals() {
|
||||
Me = null;
|
||||
_ = null;
|
||||
_installedExtensions = null;
|
||||
}
|
||||
|
||||
|
@ -373,3 +379,67 @@ export function getWindows(workspace) {
|
|||
// ... and filter out skip-taskbar windows and duplicates
|
||||
}).filter((w, i, a) => !w.skip_taskbar && a.indexOf(w) === i);
|
||||
}
|
||||
|
||||
export function monitorHasLowResolution(monitorIndex, resolutionLimit) {
|
||||
resolutionLimit = resolutionLimit ?? 1200000;
|
||||
monitorIndex = monitorIndex ?? global.display.get_primary_monitor();
|
||||
const monitorGeometry = global.display.get_monitor_geometry(monitorIndex);
|
||||
const { scaleFactor } = St.ThemeContext.get_for_stage(global.stage);
|
||||
const monitorResolution = monitorGeometry.width * monitorGeometry.height;
|
||||
return (monitorResolution / scaleFactor) < resolutionLimit;
|
||||
}
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Status dialog that appears during updating V-Shell configuration and blocks inputs
|
||||
|
||||
export const RestartMessage = GObject.registerClass({
|
||||
// Registered name should be unique
|
||||
GTypeName: `RestartMessage${Math.floor(Math.random() * 1000)}`,
|
||||
}, class RestartMessage extends ModalDialog.ModalDialog {
|
||||
_init() {
|
||||
super._init({
|
||||
shellReactive: false,
|
||||
styleClass: 'restart-message headline update-message',
|
||||
shouldFadeIn: false,
|
||||
destroyOnClose: false,
|
||||
});
|
||||
|
||||
const label = new St.Label({
|
||||
text: _('Updating V-Shell'),
|
||||
x_align: Clutter.ActorAlign.CENTER,
|
||||
y_align: Clutter.ActorAlign.CENTER,
|
||||
});
|
||||
|
||||
this.contentLayout.add_child(label);
|
||||
this.buttonLayout.hide();
|
||||
this.connect('destroy', () => this.removeMessage());
|
||||
}
|
||||
|
||||
showMessage(timeout = 500) {
|
||||
if (this._timeoutId || Me._resetInProgress || Main.layoutManager._startingUp)
|
||||
return;
|
||||
this._removeTimeout();
|
||||
this.open();
|
||||
this._timeoutId = GLib.timeout_add(
|
||||
GLib.PRIORITY_LOW,
|
||||
timeout,
|
||||
() => {
|
||||
this._timeoutId = 0;
|
||||
this.removeMessage();
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
_removeTimeout() {
|
||||
if (this._timeoutId) {
|
||||
GLib.source_remove(this._timeoutId);
|
||||
this._timeoutId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
removeMessage() {
|
||||
this._removeTimeout();
|
||||
this.close();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue