js: Get monitor manager from backend
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2557>
This commit is contained in:
parent
8d68bdaaa1
commit
c1d66af4b9
@ -54,7 +54,7 @@ var IntrospectService = class {
|
||||
this._syncAnimationsEnabled.bind(this));
|
||||
this._syncAnimationsEnabled();
|
||||
|
||||
const monitorManager = Meta.MonitorManager.get();
|
||||
const monitorManager = global.backend.get_monitor_manager();
|
||||
monitorManager.connect('monitors-changed',
|
||||
this._syncScreenSize.bind(this));
|
||||
this._syncScreenSize();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* exported getDefault */
|
||||
const { AccountsService, Clutter, Gdm, Gio, GLib, GObject, Meta } = imports.gi;
|
||||
const {AccountsService, Clutter, Gdm, Gio, GLib, GObject} = imports.gi;
|
||||
|
||||
const GnomeSession = imports.misc.gnomeSession;
|
||||
const LoginManager = imports.misc.loginManager;
|
||||
@ -149,7 +149,7 @@ const SystemActions = GObject.registerClass({
|
||||
|
||||
this._session = new GnomeSession.SessionManager();
|
||||
this._loginManager = LoginManager.getLoginManager();
|
||||
this._monitorManager = Meta.MonitorManager.get();
|
||||
this._monitorManager = global.backend.get_monitor_manager();
|
||||
|
||||
this._userManager = AccountsService.UserManager.get_default();
|
||||
|
||||
|
@ -555,7 +555,7 @@ var BackgroundSource = class BackgroundSource {
|
||||
this._settings = new Gio.Settings({ schema_id: settingsSchema });
|
||||
this._backgrounds = [];
|
||||
|
||||
let monitorManager = Meta.MonitorManager.get();
|
||||
const monitorManager = global.backend.get_monitor_manager();
|
||||
this._monitorsChangedId =
|
||||
monitorManager.connect('monitors-changed',
|
||||
this._onMonitorsChanged.bind(this));
|
||||
@ -630,7 +630,7 @@ var BackgroundSource = class BackgroundSource {
|
||||
}
|
||||
|
||||
destroy() {
|
||||
let monitorManager = Meta.MonitorManager.get();
|
||||
const monitorManager = global.backend.get_monitor_manager();
|
||||
monitorManager.disconnect(this._monitorsChangedId);
|
||||
|
||||
for (let monitorIndex in this._backgrounds) {
|
||||
|
@ -329,7 +329,7 @@ var LayoutManager = GObject.registerClass({
|
||||
display.connect('in-fullscreen-changed',
|
||||
this._updateFullscreen.bind(this));
|
||||
|
||||
let monitorManager = Meta.MonitorManager.get();
|
||||
const monitorManager = global.backend.get_monitor_manager();
|
||||
monitorManager.connect('monitors-changed',
|
||||
this._monitorsChanged.bind(this));
|
||||
this._monitorsChanged();
|
||||
|
@ -47,7 +47,7 @@ class OsdMonitorLabel extends St.Widget {
|
||||
|
||||
var OsdMonitorLabeler = class {
|
||||
constructor() {
|
||||
this._monitorManager = Meta.MonitorManager.get();
|
||||
this._monitorManager = global.backend.get_monitor_manager();
|
||||
this._client = null;
|
||||
this._clientWatchId = 0;
|
||||
this._osdLabels = [];
|
||||
|
@ -127,7 +127,7 @@ var GnomeShell = class {
|
||||
|
||||
let monitorIndex = -1;
|
||||
if (connector) {
|
||||
let monitorManager = Meta.MonitorManager.get();
|
||||
const monitorManager = global.backend.get_monitor_manager();
|
||||
monitorIndex = monitorManager.get_monitor_for_connector(connector);
|
||||
}
|
||||
|
||||
|
@ -55,14 +55,14 @@ class SwitchMonitorPopup extends SwitcherPopup.SwitcherPopup {
|
||||
}
|
||||
|
||||
show(backward, binding, mask) {
|
||||
if (!Meta.MonitorManager.get().can_switch_config())
|
||||
if (!global.backend.get_monitor_manager().can_switch_config())
|
||||
return false;
|
||||
|
||||
return super.show(backward, binding, mask);
|
||||
}
|
||||
|
||||
_initialSelection() {
|
||||
let currentConfig = Meta.MonitorManager.get().get_switch_config();
|
||||
let currentConfig = global.backend.get_monitor_manager().get_switch_config();
|
||||
let selectConfig = (currentConfig + 1) % this._items.length;
|
||||
this._select(selectConfig);
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
const {
|
||||
AccountsService, Atk, Clutter, Gdm, Gio,
|
||||
GnomeDesktop, GLib, GObject, Meta, Shell, St,
|
||||
GnomeDesktop, GLib, GObject, Shell, St,
|
||||
} = imports.gi;
|
||||
|
||||
const Background = imports.ui.background;
|
||||
@ -337,7 +337,7 @@ class UnlockDialogClock extends St.BoxLayout {
|
||||
this._seat.connectObject('notify::touch-mode',
|
||||
this._updateHint.bind(this), this);
|
||||
|
||||
this._monitorManager = Meta.MonitorManager.get();
|
||||
this._monitorManager = global.backend.get_monitor_manager();
|
||||
this._monitorManager.connectObject('power-save-mode-changed',
|
||||
() => (this._hint.opacity = 0), this);
|
||||
|
||||
|
@ -56,7 +56,8 @@ class DisplayChangeDialog extends ModalDialog.ModalDialog {
|
||||
|
||||
this._wm = wm;
|
||||
|
||||
this._countDown = Meta.MonitorManager.get_display_configuration_timeout();
|
||||
const monitorManager = global.backend.get_monitor_manager();
|
||||
this._countDown = monitorManager.get_display_configuration_timeout();
|
||||
|
||||
// Translators: This string should be shorter than 30 characters
|
||||
let title = _('Keep these display settings?');
|
||||
|
Loading…
Reference in New Issue
Block a user