Skip to content

Commit 226dd09

Browse files
committed
Fixing Alt Esc on v4
1 parent 195de2d commit 226dd09

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

extension.js

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,20 @@ const altTab = imports.ui.altTab;
2121

2222
let CurrentMonitorWindowSwitcherPopup;
2323
let CurrentMonitorAppSwitcherPopup;
24+
let CurrentWindowCyclerPopup;
2425
let extension = null;
2526

2627
class Extension {
2728
constructor() {
2829
this.origMethods = {
29-
"windowSwitcherPopup": altTab.WindowSwitcherPopup,
30-
"appSwitcherPopup": altTab.AppSwitcherPopup
30+
windowSwitcherPopup: altTab.WindowSwitcherPopup,
31+
appSwitcherPopup: altTab.AppSwitcherPopup,
32+
WindowCyclerPopup: altTab.WindowCyclerPopup,
3133
};
3234

33-
altTab.WindowSwitcherPopup = CurrentMonitorWindowSwitcherPopup;
35+
altTab.WindowSwitcherPopup = CurrentMonitorWindowSwitcherPopup;
3436
altTab.AppSwitcherPopup = CurrentMonitorAppSwitcherPopup;
37+
altTab.WindowCyclerPopup = CurrentWindowCyclerPopup;
3538

3639
const seat = Clutter.get_default_backend().get_default_seat();
3740
this.vdevice = seat.create_virtual_device(
@@ -45,20 +48,22 @@ class Extension {
4548
}
4649

4750
destroy() {
48-
altTab.WindowSwitcherPopup = this.origMethods["windowSwitcherPopup"];
51+
altTab.WindowSwitcherPopup = this.origMethods["windowSwitcherPopup"];
4952
altTab.AppSwitcherPopup = this.origMethods["appSwitcherPopup"];
5053
}
5154
}
5255

5356
function init() {
54-
CurrentMonitorWindowSwitcherPopup = GObject.registerClass(
55-
class CurrentMonitorWindowSwitcherPopup extends altTab.WindowSwitcherPopup {
56-
_finish() {
57-
extension.movePointer();
58-
super._finish();
59-
}
60-
}
61-
);
57+
// Fix for Alt+Tab (switch windows)
58+
CurrentMonitorWindowSwitcherPopup = GObject.registerClass(
59+
class CurrentMonitorWindowSwitcherPopup extends altTab.WindowSwitcherPopup {
60+
_finish() {
61+
extension.movePointer();
62+
super._finish();
63+
}
64+
}
65+
);
66+
// Fix for Super+Tab (switch applications)
6267
CurrentMonitorAppSwitcherPopup = GObject.registerClass(
6368
class CurrentMonitorAppSwitcherPopup extends altTab.AppSwitcherPopup {
6469
_finish(timestamp) {
@@ -68,7 +73,16 @@ function init() {
6873
super._finish(timestamp);
6974
}
7075
}
71-
);
76+
);
77+
// Fix for Alt+Escape (switch windows directly)
78+
CurrentWindowCyclerPopup = GObject.registerClass(
79+
class CurrentWindowCyclerPopup extends altTab.WindowCyclerPopup {
80+
_finish() {
81+
extension.movePointer();
82+
super._finish();
83+
}
84+
}
85+
);
7286
}
7387

7488
function enable() {

0 commit comments

Comments
 (0)