diff --git a/README.md b/README.md index f9872dde..2d86acdf 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,6 @@ Bugs should be reported to the GNOME [bug tracking system][bug-tracker]. ## Extensions - * alternate-tab - - Lets you use classic Alt+Tab (window-based instead of app-based) in GNOME Shell. - * apps-menu Lets you reach an application using gnome 2.x style menu on the panel. diff --git a/extensions/alternate-tab/extension.js b/extensions/alternate-tab/extension.js deleted file mode 100644 index 3e912d82..00000000 --- a/extensions/alternate-tab/extension.js +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- mode: js; js-basic-offset: 4; indent-tabs-mode: nil -*- */ - -const Clutter = imports.gi.Clutter; -const Meta = imports.gi.Meta; -const Shell = imports.gi.Shell; - -const AltTab = imports.ui.altTab; -const Main = imports.ui.main; -const WindowManager = imports.ui.windowManager; - -let injections = {}; - -function init(metadata) { -} - -function setKeybinding(name, func) { - Main.wm.setCustomKeybindingHandler(name, Shell.ActionMode.NORMAL, func); -} - -function enable() { - injections['_keyPressHandler'] = AltTab.WindowSwitcherPopup.prototype._keyPressHandler; - AltTab.WindowSwitcherPopup.prototype._keyPressHandler = function(keysym, action) { - switch(action) { - case Meta.KeyBindingAction.SWITCH_APPLICATIONS: - action = Meta.KeyBindingAction.SWITCH_WINDOWS; - break; - case Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD: - action = Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD; - break; - } - return injections['_keyPressHandler'].call(this, keysym, action); - }; - - Main.wm._forcedWindowSwitcher = function(display, window, binding) { - /* prevent a corner case where both popups show up at once */ - if (this._workspaceSwitcherPopup != null) - this._workspaceSwitcherPopup.destroy(); - - let tabPopup = new AltTab.WindowSwitcherPopup(); - - if (!tabPopup.show(binding.is_reversed(), binding.get_name(), binding.get_mask())) - tabPopup.destroy(); - }; - - setKeybinding('switch-applications', - Main.wm._forcedWindowSwitcher.bind(Main.wm)); - setKeybinding('switch-applications-backward', - Main.wm._forcedWindowSwitcher.bind(Main.wm)); -} - -function disable() { - var prop; - - setKeybinding('switch-applications', - Main.wm._startSwitcher.bind(Main.wm)); - setKeybinding('switch-applications-backward', - Main.wm._startSwitcher.bind(Main.wm)); - - for (prop in injections) - AltTab.WindowSwitcherPopup.prototype[prop] = injections[prop]; - delete Main.wm._forcedWindowSwitcher; -} diff --git a/extensions/alternate-tab/metadata.json.in b/extensions/alternate-tab/metadata.json.in deleted file mode 100644 index 15663f59..00000000 --- a/extensions/alternate-tab/metadata.json.in +++ /dev/null @@ -1,11 +0,0 @@ -{ -"extension-id": "@extension_id@", -"uuid": "@uuid@", -"settings-schema": "@gschemaname@", -"gettext-domain": "@gettext_domain@", -"name": "AlternateTab", -"description": "Substitute Alt-Tab with a window based switcher that does not group by application.\nThis extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME's GitLab instance instead.", -"original-authors": [ "jw@bargsten.org", "thomas.bouffon@gmail.com" ], -"shell-version": [ "@shell_current@" ], -"url": "@url@" -} diff --git a/extensions/alternate-tab/prefs.js b/extensions/alternate-tab/prefs.js deleted file mode 100644 index 3b9149ef..00000000 --- a/extensions/alternate-tab/prefs.js +++ /dev/null @@ -1,81 +0,0 @@ -/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ - -const Gio = imports.gi.Gio; -const Gtk = imports.gi.Gtk; -const GObject = imports.gi.GObject; - -const Gettext = imports.gettext.domain('gnome-shell-extensions'); -const _ = Gettext.gettext; -const N_ = e => e; - -const ExtensionUtils = imports.misc.extensionUtils; -const Me = ExtensionUtils.getCurrentExtension(); -const Convenience = Me.imports.convenience; - -const SETTINGS_APP_ICON_MODE = 'app-icon-mode'; -const SETTINGS_CURRENT_WORKSPACE_ONLY = 'current-workspace-only'; - -const MODES = { - 'thumbnail-only': N_("Thumbnail only"), - 'app-icon-only': N_("Application icon only"), - 'both': N_("Thumbnail and application icon"), -}; - -const AltTabSettingsWidget = GObject.registerClass( -class AltTabSettingsWidget extends Gtk.Grid { - _init(params) { - super._init(params); - this.margin = 24; - this.row_spacing = 6; - this.orientation = Gtk.Orientation.VERTICAL; - - this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell.window-switcher' }); - - let presentLabel = '' + _("Present windows as") + ''; - this.add(new Gtk.Label({ label: presentLabel, use_markup: true, - halign: Gtk.Align.START })); - - let align = new Gtk.Alignment({ left_padding: 12 }); - this.add(align); - - let grid = new Gtk.Grid({ orientation: Gtk.Orientation.VERTICAL, - row_spacing: 6, - column_spacing: 6 }); - align.add(grid); - - let radio = null; - let currentMode = this._settings.get_string(SETTINGS_APP_ICON_MODE); - for (let mode in MODES) { - // copy the mode variable because it has function scope, not block scope - // so cannot be used in a closure - let modeCapture = mode; - let name = Gettext.gettext(MODES[mode]); - - radio = new Gtk.RadioButton({ group: radio, label: name, valign: Gtk.Align.START }); - radio.connect('toggled', widget => { - if (widget.active) - this._settings.set_string(SETTINGS_APP_ICON_MODE, modeCapture); - }); - grid.add(radio); - - if (mode == currentMode) - radio.active = true; - } - - let check = new Gtk.CheckButton({ label: _("Show only windows in the current workspace"), - margin_top: 6 }); - this._settings.bind(SETTINGS_CURRENT_WORKSPACE_ONLY, check, 'active', Gio.SettingsBindFlags.DEFAULT); - this.add(check); - } -}); - -function init() { - Convenience.initTranslations(); -} - -function buildPrefsWidget() { - let widget = new AltTabSettingsWidget(); - widget.show_all(); - - return widget; -} diff --git a/extensions/alternate-tab/stylesheet.css b/extensions/alternate-tab/stylesheet.css deleted file mode 100644 index 25134b65..00000000 --- a/extensions/alternate-tab/stylesheet.css +++ /dev/null @@ -1 +0,0 @@ -/* This extensions requires no special styling */ diff --git a/meson.build b/meson.build index 6b7654bb..67e71ff8 100644 --- a/meson.build +++ b/meson.build @@ -42,7 +42,6 @@ classic_extensions = [ default_extensions = classic_extensions default_extensions += [ - 'alternate-tab', 'drive-menu', 'screenshot-window-sizer', 'windowsNavigator', diff --git a/po/POTFILES.in b/po/POTFILES.in index c2b88992..bc153b48 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -1,6 +1,5 @@ data/gnome-classic.desktop.in data/gnome-classic.session.desktop.in -extensions/alternate-tab/prefs.js extensions/apps-menu/extension.js extensions/auto-move-windows/extension.js extensions/auto-move-windows/org.gnome.shell.extensions.auto-move-windows.gschema.xml