From 6432ff7e842bfc4b02321baf39007f616cf28355 Mon Sep 17 00:00:00 2001 From: alk3pInjection Date: Sun, 5 Nov 2023 00:54:50 +0800 Subject: [PATCH 1/2] Advertise GNOME 44 compatibility --- README.md | 1 + metadata.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1432307..e1acb1e 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ It fixes at least this known issue: https://gitlab.gnome.org/GNOME/mutter/issues 41 42 43 +44 ## Installation 1. `git clone https://github.com/bdaase/remove-alt-tab-delay ~/.local/share/gnome-shell/extensions/remove-alt-tab-delay@daase.net` diff --git a/metadata.json b/metadata.json index 795a3c3..1833d8e 100644 --- a/metadata.json +++ b/metadata.json @@ -12,7 +12,8 @@ "40", "41", "42", - "43" + "43", + "44" ], "url": "https://github.com/BjoernDaase/remove-alt-tab-delay", "uuid": "remove-alt-tab-delay@daase.net", From 25bf03d62e0542ab75976a1f719783b3501ea3fd Mon Sep 17 00:00:00 2001 From: alk3pInjection Date: Sun, 5 Nov 2023 00:54:50 +0800 Subject: [PATCH 2/2] Support GNOME 45 based on https://gitlab.gnome.org/jrahmatzadeh/just-perfection --- README.md | 1 + extension.js | 42 +++++++++++++++++++++++++++++++++--------- metadata.json | 3 ++- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e1acb1e..47a267c 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ It fixes at least this known issue: https://gitlab.gnome.org/GNOME/mutter/issues 42 43 44 +45 ## Installation 1. `git clone https://github.com/bdaase/remove-alt-tab-delay ~/.local/share/gnome-shell/extensions/remove-alt-tab-delay@daase.net` diff --git a/extension.js b/extension.js index e33aca5..97a5b7e 100644 --- a/extension.js +++ b/extension.js @@ -1,12 +1,36 @@ -const SwitcherPopup = imports.ui.switcherPopup; +import * as SwitcherPopup from 'resource:///org/gnome/shell/ui/switcherPopup.js'; -function init() { -} +import { Extension } from 'resource:///org/gnome/shell/extensions/extension.js'; -function enable() { - SwitcherPopup.POPUP_DELAY_TIMEOUT = 0; -} +export default class RemoveAltTabDelay extends Extension { + + constructor(metadata) { + super(metadata); + + this._metadata = metadata; + this._switcherPopup = SwitcherPopup || null; + } + + enable() { + let SwitcherPopupProto = this._switcherPopup.SwitcherPopup.prototype; -function disable() { - SwitcherPopup.POPUP_DELAY_TIMEOUT = 150; -} \ No newline at end of file + SwitcherPopupProto.showOld = SwitcherPopupProto.show; + + SwitcherPopupProto.show = function (...args) { + let res = this.showOld(...args); + if (res) { + this._showImmediately(); + } + return res; + }; + } + + disable() { + let SwitcherPopupProto = this._switcherPopup.SwitcherPopup.prototype; + + if (SwitcherPopupProto.showOld) { + SwitcherPopupProto.show = SwitcherPopupProto.showOld; + delete(SwitcherPopupProto.showOld); + } + } +} diff --git a/metadata.json b/metadata.json index 1833d8e..7077551 100644 --- a/metadata.json +++ b/metadata.json @@ -13,7 +13,8 @@ "41", "42", "43", - "44" + "44", + "45" ], "url": "https://github.com/BjoernDaase/remove-alt-tab-delay", "uuid": "remove-alt-tab-delay@daase.net",