Skip to content
Permalink
Browse files

GWL: Remove hotkeys

  • Loading branch information
clefebvre committed Sep 23, 2019
1 parent ea7f72b commit 94719c2cf1525f17b38bc7356d46d5b6bb5eab59
@@ -669,11 +669,6 @@ class AppGroup {
return this.actor;
}

showOrderLabel(number) {
this.numberLabel.text = (number + 1).toString();
this.badge.show();
}

launchNewInstance() {
this.groupState.app.open_new_window(-1);
this.animate();
@@ -785,33 +780,6 @@ class AppGroup {
return false;
}

onAppKeyPress() {
if (this.groupState.isFavoriteApp && this.groupState.metaWindows.length === 0) {
this.launchNewInstance();
} else {
if (this.appKeyTimeout) {
clearTimeout(this.appKeyTimeout);
this.appKeyTimeout = 0;
}
if (this.groupState.metaWindows.length > 1) {
if (!this.hoverMenu) this.initThumbnailMenu();
this.hoverMenu.open(true);
} else {
this.listState.trigger('closeAllHoverMenus');
}
this.windowHandle();
this.appKeyTimeout = setTimeout(() => {
if (this.groupState.thumbnailMenuEntered) {
clearTimeout(this.appKeyTimeout);
this.appKeyTimeout = 0;
return;
}
this.hoverMenu.close(true);
this.appKeyTimeout = 0;
}, this.state.settings.showAppsOrderTimeout);
}
}

windowHandle() {
if (this.groupState.lastFocused.appears_focused) {
if (this.groupState.metaWindows.length > 1) {
@@ -95,61 +95,6 @@ class AppList {
if (typeof cb === 'function') cb();
}

onAppKeyPress(number) {
if (!this.appList[number - 1]) return;
this.appList[number - 1].onAppKeyPress(number);
}

onNewAppKeyPress(number) {
if (number > this.appList.length) return;
this.appList[number - 1].launchNewInstance();
}

showAppsOrder() {
for (let i = 0, len = this.appList.length; i < len; i++) {
this.appList[i].showOrderLabel(i);
}
setTimeout(() => this.calcAllWindowNumbers(), this.state.settings.showAppsOrderTimeout);
}

cycleMenus(r = 0) {
if (r > this.appList.length) {
this.state.set({lastCycled: -1});
return;
}

let {lastCycled} = this.state;
this.lastCycledTime = Date.now();
this.closeAllHoverMenus();

if (lastCycled < 0) {
lastCycled = findIndex(this.appList, (app) => {
return app.groupState.appId === this.listState.lastFocusedApp;
});
}

if (lastCycled < 0 || lastCycled > this.appList.length - 1) lastCycled = 0;

this.appList[lastCycled].groupState.set({thumbnailMenuEntered: true});
if (!this.appList[lastCycled].hoverMenu) this.appList[lastCycled].initThumbnailMenu();
this.appList[lastCycled].hoverMenu.open(true);

lastCycled++;
this.state.set({lastCycled});

if (this.appList[lastCycled - 1].groupState.metaWindows.length === 0) {
this.cycleMenus(r + 1);
}


let lastCycledTime = this.lastCycledTime;
setTimeout(() => {
if (lastCycledTime === this.lastCycledTime) {
this.state.set({lastCycled: -1});
}
}, 2000)
}

// Gets a list of every app on the current workspace
getSpecialApps() {
this.specialApps = [];
@@ -315,12 +260,6 @@ class AppList {
}
}

calcAllWindowNumbers() {
for (let i = 0, len = this.appList.length; i < len; i++) {
this.appList[i].calcWindowNumber(this.appList[i].groupState.metaWindows);
}
}

updateAppGroupIndexes() {
const newAppList = [];
let children = this.actor.get_children();
@@ -332,9 +332,6 @@ class GroupedWindowListApplet extends Applet.Applet {
{key: 'pinned-apps', value: 'pinnedApps', cb: null},
{key: 'middle-click-action', value: 'middleClickAction', cb: null},
{key: 'left-click-action', value: 'leftClickAction', cb: null},
{key: 'show-apps-order-hotkey', value: 'showAppsOrderHotkey', cb: this.bindAppKeys},
{key: 'show-apps-order-timeout', value: 'showAppsOrderTimeout', cb: null},
{key: 'cycleMenusHotkey', value: 'cycleMenusHotkey', cb: this.bindAppKeys},
{key: 'enable-hover-peek', value: 'enablePeek', cb: null},
{key: 'onclick-thumbnails', value: 'onClickThumbs', cb: null},
{key: 'hover-peek-opacity', value: 'peekOpacity', cb: null},
@@ -377,7 +374,6 @@ class GroupedWindowListApplet extends Applet.Applet {
if (this.state.appletReady && this.state.panelEditMode) {
return;
}
this.bindAppKeys();
this.state.set({appletReady: true});
}

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

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

bindAppKeys() {
this.unbindAppKeys();

for (let i = 1; i < 10; i++) {
this.bindAppKey(i);
}
Main.keybindingManager.addHotKey('launch-show-apps-order', this.state.settings.showAppsOrderHotkey, () =>
this.showAppsOrder()
);
Main.keybindingManager.addHotKey('launch-cycle-menus', this.state.settings.cycleMenusHotkey, () =>
this.cycleMenus()
);
}

unbindAppKeys() {
for (let i = 1; i < 10; i++) {
Main.keybindingManager.removeHotKey('launch-app-key-' + i);
Main.keybindingManager.removeHotKey('launch-new-app-key-' + i);
}
Main.keybindingManager.removeHotKey('launch-show-apps-order');
Main.keybindingManager.removeHotKey('launch-cycle-menus');
}

bindAppKey(i) {
Main.keybindingManager.addHotKey('launch-app-key-' + i, '<Super>' + i, () => this.onAppKeyPress(i));
Main.keybindingManager.addHotKey('launch-new-app-key-' + i, '<Super><Shift>' + i, () =>
this.onNewAppKeyPress(i)
);
}

onAppKeyPress(number) {
this.getCurrentAppList().onAppKeyPress(number);
}

onNewAppKeyPress(number) {
this.getCurrentAppList().onNewAppKeyPress(number);
}

showAppsOrder() {
this.getCurrentAppList().showAppsOrder();
}

cycleMenus() {
this.getCurrentAppList().cycleMenus();
}

handleMonitorWindowsPrefsChange(value) {

}
@@ -5,7 +5,7 @@
"generalPage": {
"type" : "page",
"title" : "General",
"sections": ["generalSection", "hotKeysSection"]
"sections": ["generalSection"]
},
"panelPage": {
"type" : "page",
@@ -44,15 +44,6 @@
"enable-app-button-dragging"
]
},
"hotKeysSection": {
"type" : "section",
"title" : "Hot Keys",
"keys": [
"cycleMenusHotkey",
"show-apps-order-hotkey",
"show-apps-order-timeout"
]
},
"thumbnailsSection": {
"type" : "section",
"title" : "Thumbnails",
@@ -164,25 +155,6 @@
"Scale": 3
}
},
"cycleMenusHotkey": {
"type": "keybinding",
"default": "<Super>space",
"description": "Global hotkey for cycling through thumbnail menus"
},
"show-apps-order-hotkey": {
"type": "keybinding",
"default": "<Super>grave",
"description": "Global hotkey to show the order of apps"
},
"show-apps-order-timeout": {
"type": "spinbutton",
"default": 2500,
"min": 100,
"max": 10000,
"step": 10,
"units": "milliseconds",
"description": "Duration of the apps order display on hotkey press"
},
"thumbnail-timeout": {
"dependency": "!onclick-thumbnails",
"type": "combobox",

7 comments on commit 94719c2

@parabolic

This comment has been minimized.

Copy link

parabolic replied Dec 17, 2019

Hi @clefebvre ,
I was just wondering why this feature was removed since it really helps with improving productivity. Is there any chance it will be re-introduced into mint again ?
Cheers.

@renanwillian

This comment has been minimized.

Copy link

renanwillian replied Dec 19, 2019

I can't believe someone removed this awesome feature, hope this mistake get fixed soon.

@pawitp

This comment has been minimized.

Copy link

pawitp replied Dec 21, 2019

+1

This is a feature I use daily. Is there any replacement for it?

EDIT: For those wanting to temporarily restore this feature locally on their machine, please see https://medium.com/@pawitp/restoring-super-num-window-switching-in-linux-mint-19-3-6652633bf7e2

@Denuro

This comment has been minimized.

Copy link

Denuro replied Dec 21, 2019

Thanks @pawitp for the info.
Hope they add this back, as it's the shortcuts I use the most on cinnamon.
Maybe just add an option to turn it off if someone wants it off.

@parabolic

This comment has been minimized.

Copy link

parabolic replied Dec 21, 2019

@pawitp thanks for the patch it works flawlessly !
One small note though.
There's no need to log out/in you just need to restart cinnamon on the fly and it works without losing work.
Right click on any panel -> Troubleshoot -> Restart Cinnamon
image

@SethosII

This comment has been minimized.

Copy link

SethosII replied Dec 23, 2019

For reference: here is an issue requesting to reintroduce this feature: #9028.

@parabolic

This comment has been minimized.

Copy link

parabolic replied Dec 23, 2019

Just an update, it seems that patching the applet almost broke my cinnamon environment after a reboot.
I have reverted back to the defaults and will be awaiting an official resolution from the mint team.

Please sign in to comment.
You can’t perform that action at this time.