From 03a0aee77c9807ee9ec291838d1e43d8bccf9797 Mon Sep 17 00:00:00 2001 From: Philipp Unger Date: Mon, 14 Aug 2023 01:02:59 +0200 Subject: [PATCH] remove the remaining non ESM imports --- appIcons.js | 3 ++- extension.js | 2 +- overview.js | 3 ++- panel.js | 2 +- panelManager.js | 2 +- taskbar.js | 3 ++- utils.js | 12 ++++-------- 7 files changed, 13 insertions(+), 14 deletions(-) diff --git a/appIcons.js b/appIcons.js index 288b8e2..931da6a 100644 --- a/appIcons.js +++ b/appIcons.js @@ -25,6 +25,7 @@ import Clutter from 'gi://Clutter'; import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; +import Graphene from 'gi://Graphene'; import Gtk from 'gi://Gtk'; import GObject from 'gi://GObject'; import Meta from 'gi://Meta'; @@ -276,7 +277,7 @@ export var TaskbarAppIcon = GObject.registerClass({ source: this.child, x: this.child.x, y: this.child.y, width: this.child.width, height: this.child.height, - pivot_point: new imports.gi.Graphene.Point({ x: 0.5, y: 0.5 }), + pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), opacity: 255, reactive: false, x_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER, diff --git a/extension.js b/extension.js index bba4f70..38f9652 100644 --- a/extension.js +++ b/extension.js @@ -41,7 +41,7 @@ const UBUNTU_DOCK_UUID = 'ubuntu-dock@ubuntu.com'; let panelManager; let extensionChangedHandler; let disabledUbuntuDock; -let extensionSystem = (Main.extensionManager || imports.ui.extensionSystem); +let extensionSystem = Main.extensionManager; export var SETTINGS = null; export var DESKTOPSETTINGS = null; diff --git a/overview.js b/overview.js index 7b17dc5..9a9e647 100644 --- a/overview.js +++ b/overview.js @@ -29,6 +29,7 @@ import Shell from 'gi://Shell'; import St from 'gi://St'; import * as Main from 'resource:///org/gnome/shell/ui/main.js'; import * as Workspace from 'resource:///org/gnome/shell/ui/workspace.js'; +import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js'; import { WindowPreview } from 'resource:///org/gnome/shell/ui/windowPreview.js'; import {SETTINGS} from './extension.js'; @@ -356,7 +357,7 @@ export var Overview = class { }, this); if (Main.wm._switchToApplication) { - let gsSettings = new Gio.Settings({ schema_id: imports.ui.windowManager.SHELL_KEYBINDINGS_SCHEMA }); + let gsSettings = new Gio.Settings({ schema_id: MessageTray.SHELL_KEYBINDINGS_SCHEMA }); for (let i = 1; i < 10; ++i) { Utils.addKeybinding(GS_HOTKEYS_KEY + i, gsSettings, Main.wm._switchToApplication.bind(Main.wm)); diff --git a/panel.js b/panel.js index ff727ad..5652b12 100644 --- a/panel.js +++ b/panel.js @@ -966,7 +966,7 @@ export var Panel = GObject.registerClass({ _setVertical(actor, isVertical) { let _set = (actor, isVertical) => { - if (!actor || actor instanceof Dash.DashItemContainer || actor instanceof TaskbarItemContainer) { + if (!actor || actor instanceof Dash.DashItemContainer || actor instanceof TaskbarItemContainer.TaskbarItemContainer) { return; } diff --git a/panelManager.js b/panelManager.js index 91b1f4e..23601bc 100755 --- a/panelManager.js +++ b/panelManager.js @@ -365,7 +365,7 @@ export var PanelManager = class { } else { // No idea why atm, but we need the import at the top of this file and to use the // full imports ns here, otherwise SecondaryMonitorDisplay can't be used ¯\_(ツ)_/¯ - view = new imports.ui.workspacesView.SecondaryMonitorDisplay(i, + view = new SecondaryMonitorDisplay(i, this._controls, this._scrollAdjustment, this._fitModeAdjustment, diff --git a/taskbar.js b/taskbar.js index 06208ec..41fad05 100644 --- a/taskbar.js +++ b/taskbar.js @@ -26,6 +26,7 @@ import Clutter from 'gi://Clutter'; import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; +import Graphene from 'gi://Graphene'; import Gtk from 'gi://Gtk'; import Meta from 'gi://Meta'; import Shell from 'gi://Shell'; @@ -261,7 +262,7 @@ export var Taskbar = class { let fade1 = new St.Widget({ style_class: 'scrollview-fade', reactive: false }); let fade2 = new St.Widget({ style_class: 'scrollview-fade', reactive: false, - pivot_point: new imports.gi.Graphene.Point({ x: .5, y: .5 }), + pivot_point: new Graphene.Point({ x: .5, y: .5 }), rotation_angle_z: 180 }); fade1.set_style(fadeStyle); diff --git a/utils.js b/utils.js index 5ea50a4..eb5df53 100644 --- a/utils.js +++ b/utils.js @@ -25,6 +25,7 @@ import Clutter from 'gi://Clutter'; import GdkPixbuf from 'gi://GdkPixbuf'; import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; +import Graphene from 'gi://Graphene'; import Gtk from 'gi://Gtk'; import Meta from 'gi://Meta'; import Shell from 'gi://Shell'; @@ -33,6 +34,7 @@ import * as Config from 'resource:///org/gnome/shell/misc/config.js'; import * as Util from 'resource:///org/gnome/shell/misc/util.js'; import * as Main from 'resource:///org/gnome/shell/ui/main.js'; import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js'; +import * as UiPanel from 'resource:///org/gnome/shell/ui/panel.js'; const Gi = imports._gi; const Mainloop = imports.mainloop; @@ -219,15 +221,9 @@ export var setDisplayUnredirect = (enable) => { }; export var getSystemMenuInfo = function() { - if (Config.PACKAGE_VERSION < '43') - return { - name: 'aggregateMenu', - constructor: imports.ui.panel.AggregateMenu - }; - return { name: 'quickSettings', - constructor: imports.ui.panel.QuickSettings + constructor: UiPanel.QuickSettings }; } @@ -488,7 +484,7 @@ export var getIndicators = function(delegate) { } export var getPoint = function(coords) { - return new imports.gi.Graphene.Point(coords); + return new Graphene.Point(coords); } export var notify = function(text, iconName, action, isTransient) {