Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ It fixes at least this known issue: https://gitlab.gnome.org/GNOME/mutter/issues
41
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`
Expand Down
42 changes: 33 additions & 9 deletions extension.js
Original file line number Diff line number Diff line change
@@ -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;
}
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);
}
}
}
4 changes: 3 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"40",
"41",
"42",
"43"
"43",
"44",
"45"
],
"url": "https://github.com/BjoernDaase/remove-alt-tab-delay",
"uuid": "remove-alt-tab-delay@daase.net",
Expand Down