Skip to content

Commit 94719c2

Browse files
committed
GWL: Remove hotkeys
1 parent ea7f72b commit 94719c2

File tree

4 files changed

+1
-173
lines changed

4 files changed

+1
-173
lines changed

files/usr/share/cinnamon/applets/grouped-window-list@cinnamon.org/appGroup.js

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,6 @@ class AppGroup {
669669
return this.actor;
670670
}
671671

672-
showOrderLabel(number) {
673-
this.numberLabel.text = (number + 1).toString();
674-
this.badge.show();
675-
}
676-
677672
launchNewInstance() {
678673
this.groupState.app.open_new_window(-1);
679674
this.animate();
@@ -785,33 +780,6 @@ class AppGroup {
785780
return false;
786781
}
787782

788-
onAppKeyPress() {
789-
if (this.groupState.isFavoriteApp && this.groupState.metaWindows.length === 0) {
790-
this.launchNewInstance();
791-
} else {
792-
if (this.appKeyTimeout) {
793-
clearTimeout(this.appKeyTimeout);
794-
this.appKeyTimeout = 0;
795-
}
796-
if (this.groupState.metaWindows.length > 1) {
797-
if (!this.hoverMenu) this.initThumbnailMenu();
798-
this.hoverMenu.open(true);
799-
} else {
800-
this.listState.trigger('closeAllHoverMenus');
801-
}
802-
this.windowHandle();
803-
this.appKeyTimeout = setTimeout(() => {
804-
if (this.groupState.thumbnailMenuEntered) {
805-
clearTimeout(this.appKeyTimeout);
806-
this.appKeyTimeout = 0;
807-
return;
808-
}
809-
this.hoverMenu.close(true);
810-
this.appKeyTimeout = 0;
811-
}, this.state.settings.showAppsOrderTimeout);
812-
}
813-
}
814-
815783
windowHandle() {
816784
if (this.groupState.lastFocused.appears_focused) {
817785
if (this.groupState.metaWindows.length > 1) {

files/usr/share/cinnamon/applets/grouped-window-list@cinnamon.org/appList.js

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -95,61 +95,6 @@ class AppList {
9595
if (typeof cb === 'function') cb();
9696
}
9797

98-
onAppKeyPress(number) {
99-
if (!this.appList[number - 1]) return;
100-
this.appList[number - 1].onAppKeyPress(number);
101-
}
102-
103-
onNewAppKeyPress(number) {
104-
if (number > this.appList.length) return;
105-
this.appList[number - 1].launchNewInstance();
106-
}
107-
108-
showAppsOrder() {
109-
for (let i = 0, len = this.appList.length; i < len; i++) {
110-
this.appList[i].showOrderLabel(i);
111-
}
112-
setTimeout(() => this.calcAllWindowNumbers(), this.state.settings.showAppsOrderTimeout);
113-
}
114-
115-
cycleMenus(r = 0) {
116-
if (r > this.appList.length) {
117-
this.state.set({lastCycled: -1});
118-
return;
119-
}
120-
121-
let {lastCycled} = this.state;
122-
this.lastCycledTime = Date.now();
123-
this.closeAllHoverMenus();
124-
125-
if (lastCycled < 0) {
126-
lastCycled = findIndex(this.appList, (app) => {
127-
return app.groupState.appId === this.listState.lastFocusedApp;
128-
});
129-
}
130-
131-
if (lastCycled < 0 || lastCycled > this.appList.length - 1) lastCycled = 0;
132-
133-
this.appList[lastCycled].groupState.set({thumbnailMenuEntered: true});
134-
if (!this.appList[lastCycled].hoverMenu) this.appList[lastCycled].initThumbnailMenu();
135-
this.appList[lastCycled].hoverMenu.open(true);
136-
137-
lastCycled++;
138-
this.state.set({lastCycled});
139-
140-
if (this.appList[lastCycled - 1].groupState.metaWindows.length === 0) {
141-
this.cycleMenus(r + 1);
142-
}
143-
144-
145-
let lastCycledTime = this.lastCycledTime;
146-
setTimeout(() => {
147-
if (lastCycledTime === this.lastCycledTime) {
148-
this.state.set({lastCycled: -1});
149-
}
150-
}, 2000)
151-
}
152-
15398
// Gets a list of every app on the current workspace
15499
getSpecialApps() {
155100
this.specialApps = [];
@@ -315,12 +260,6 @@ class AppList {
315260
}
316261
}
317262

318-
calcAllWindowNumbers() {
319-
for (let i = 0, len = this.appList.length; i < len; i++) {
320-
this.appList[i].calcWindowNumber(this.appList[i].groupState.metaWindows);
321-
}
322-
}
323-
324263
updateAppGroupIndexes() {
325264
const newAppList = [];
326265
let children = this.actor.get_children();

files/usr/share/cinnamon/applets/grouped-window-list@cinnamon.org/applet.js

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,6 @@ class GroupedWindowListApplet extends Applet.Applet {
332332
{key: 'pinned-apps', value: 'pinnedApps', cb: null},
333333
{key: 'middle-click-action', value: 'middleClickAction', cb: null},
334334
{key: 'left-click-action', value: 'leftClickAction', cb: null},
335-
{key: 'show-apps-order-hotkey', value: 'showAppsOrderHotkey', cb: this.bindAppKeys},
336-
{key: 'show-apps-order-timeout', value: 'showAppsOrderTimeout', cb: null},
337-
{key: 'cycleMenusHotkey', value: 'cycleMenusHotkey', cb: this.bindAppKeys},
338335
{key: 'enable-hover-peek', value: 'enablePeek', cb: null},
339336
{key: 'onclick-thumbnails', value: 'onClickThumbs', cb: null},
340337
{key: 'hover-peek-opacity', value: 'peekOpacity', cb: null},
@@ -377,7 +374,6 @@ class GroupedWindowListApplet extends Applet.Applet {
377374
if (this.state.appletReady && this.state.panelEditMode) {
378375
return;
379376
}
380-
this.bindAppKeys();
381377
this.state.set({appletReady: true});
382378
}
383379

@@ -426,7 +422,6 @@ class GroupedWindowListApplet extends Applet.Applet {
426422

427423
on_applet_removed_from_panel() {
428424
this.state.set({willUnmount: true});
429-
this.unbindAppKeys();
430425
this.signals.disconnectAllSignals();
431426
for (let i = 0, len = this.appLists.length; i < len; i++) {
432427
if (this.appLists[i]) {
@@ -457,52 +452,6 @@ class GroupedWindowListApplet extends Applet.Applet {
457452
}
458453
}
459454

460-
bindAppKeys() {
461-
this.unbindAppKeys();
462-
463-
for (let i = 1; i < 10; i++) {
464-
this.bindAppKey(i);
465-
}
466-
Main.keybindingManager.addHotKey('launch-show-apps-order', this.state.settings.showAppsOrderHotkey, () =>
467-
this.showAppsOrder()
468-
);
469-
Main.keybindingManager.addHotKey('launch-cycle-menus', this.state.settings.cycleMenusHotkey, () =>
470-
this.cycleMenus()
471-
);
472-
}
473-
474-
unbindAppKeys() {
475-
for (let i = 1; i < 10; i++) {
476-
Main.keybindingManager.removeHotKey('launch-app-key-' + i);
477-
Main.keybindingManager.removeHotKey('launch-new-app-key-' + i);
478-
}
479-
Main.keybindingManager.removeHotKey('launch-show-apps-order');
480-
Main.keybindingManager.removeHotKey('launch-cycle-menus');
481-
}
482-
483-
bindAppKey(i) {
484-
Main.keybindingManager.addHotKey('launch-app-key-' + i, '<Super>' + i, () => this.onAppKeyPress(i));
485-
Main.keybindingManager.addHotKey('launch-new-app-key-' + i, '<Super><Shift>' + i, () =>
486-
this.onNewAppKeyPress(i)
487-
);
488-
}
489-
490-
onAppKeyPress(number) {
491-
this.getCurrentAppList().onAppKeyPress(number);
492-
}
493-
494-
onNewAppKeyPress(number) {
495-
this.getCurrentAppList().onNewAppKeyPress(number);
496-
}
497-
498-
showAppsOrder() {
499-
this.getCurrentAppList().showAppsOrder();
500-
}
501-
502-
cycleMenus() {
503-
this.getCurrentAppList().cycleMenus();
504-
}
505-
506455
handleMonitorWindowsPrefsChange(value) {
507456

508457
}

files/usr/share/cinnamon/applets/grouped-window-list@cinnamon.org/settings-schema.json

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"generalPage": {
66
"type" : "page",
77
"title" : "General",
8-
"sections": ["generalSection", "hotKeysSection"]
8+
"sections": ["generalSection"]
99
},
1010
"panelPage": {
1111
"type" : "page",
@@ -44,15 +44,6 @@
4444
"enable-app-button-dragging"
4545
]
4646
},
47-
"hotKeysSection": {
48-
"type" : "section",
49-
"title" : "Hot Keys",
50-
"keys": [
51-
"cycleMenusHotkey",
52-
"show-apps-order-hotkey",
53-
"show-apps-order-timeout"
54-
]
55-
},
5647
"thumbnailsSection": {
5748
"type" : "section",
5849
"title" : "Thumbnails",
@@ -164,25 +155,6 @@
164155
"Scale": 3
165156
}
166157
},
167-
"cycleMenusHotkey": {
168-
"type": "keybinding",
169-
"default": "<Super>space",
170-
"description": "Global hotkey for cycling through thumbnail menus"
171-
},
172-
"show-apps-order-hotkey": {
173-
"type": "keybinding",
174-
"default": "<Super>grave",
175-
"description": "Global hotkey to show the order of apps"
176-
},
177-
"show-apps-order-timeout": {
178-
"type": "spinbutton",
179-
"default": 2500,
180-
"min": 100,
181-
"max": 10000,
182-
"step": 10,
183-
"units": "milliseconds",
184-
"description": "Duration of the apps order display on hotkey press"
185-
},
186158
"thumbnail-timeout": {
187159
"dependency": "!onclick-thumbnails",
188160
"type": "combobox",

0 commit comments

Comments
 (0)