diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-05 07:44:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-02-05 08:57:36 +0000 |
commit | 4a62513b17d915afcae80b1adfb1b0cdcf86f748 (patch) | |
tree | a21f339a82d742682a1dfbf63d7fe9c43d58a3a2 /extensions/vertical-workspaces/workspaceSwitcherPopup.js | |
parent | Adding upstream version 20230204. (diff) | |
download | gnome-shell-extensions-extra-cd88925d928ede6db28dcd98d1f908ffb58848ba.tar.xz gnome-shell-extensions-extra-cd88925d928ede6db28dcd98d1f908ffb58848ba.zip |
Adding upstream version 20230205.upstream/20230205
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | extensions/vertical-workspaces/workspaceSwitcherPopup.js | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/extensions/vertical-workspaces/workspaceSwitcherPopup.js b/extensions/vertical-workspaces/workspaceSwitcherPopup.js new file mode 100644 index 0000000..5401903 --- /dev/null +++ b/extensions/vertical-workspaces/workspaceSwitcherPopup.js @@ -0,0 +1,55 @@ +/** + * Vertical Workspaces + * workspacesSwitcherPopup.js + * + * @author GdH <G-dH@github.com> + * @copyright 2022 - 2023 + * @license GPL-3.0 + * + */ + +'use strict'; + +const Main = imports.ui.main; +const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup; + +const ExtensionUtils = imports.misc.extensionUtils; +const Me = ExtensionUtils.getCurrentExtension(); + +const _Util = Me.imports.util; +let _overrides; + +let opt; +var _activateSearchProvider; + +function update(reset = false) { + if (_overrides) { + _overrides.removeAll(); + } + + if (reset) { + _overrides = null; + opt = null; + return; + } + + opt = Me.imports.settings.opt; + + _overrides = new _Util.Overrides(); + + if (opt.ORIENTATION) {// 1-VERTICAL, 0-HORIZONTAL + const settings = ExtensionUtils.getSettings('org.gnome.shell'); + const enabled = settings.get_strv('enabled-extensions'); + const allowWsPopupInjection = !(enabled.includes('workspace-switcher-manager@G-dH.github.com') || enabled.includes('WsSwitcherPopupManager@G-dH.github.com-dev')); + if (opt.shellVersion >= 42 && allowWsPopupInjection) + _overrides.addInjection('WorkspaceSwitcherPopup', WorkspaceSwitcherPopup.WorkspaceSwitcherPopup.prototype, WorkspaceSwitcherPopupInjections); + } +} + +const WorkspaceSwitcherPopupInjections = { + _init: function() { + if (this._list) { + this._list.vertical = true; + } + } +} |