kludges: disable 4-finger workspace switching

We still aren't able capture the events, but we can override `_checkActivated`
to always return false, making the gesture always ineffectual.
This commit is contained in:
Tor Hedin Brønner
2019-10-10 12:55:03 +02:00
parent 762a6d93c2
commit 80c3792ad8
+9 -5
View File
@@ -16,6 +16,7 @@ var Meta = imports.gi.Meta;
var Main = imports.ui.main;
var Mainloop = imports.mainloop;
var Workspace = imports.ui.workspace;
var WindowManager = imports.ui.windowManager;
var Shell = imports.gi.Shell;
var utils = Extension.imports.utils;
@@ -249,12 +250,13 @@ var signals;
function init() {
savedMethods = new Map();
saveMethod(imports.ui.messageTray.MessageTray.prototype, '_updateState');
saveMethod(imports.ui.windowManager.WindowManager.prototype, '_prepareWorkspaceSwitch');
saveMethod(WindowManager.WindowManager.prototype, '_prepareWorkspaceSwitch');
saveMethod(Workspace.Workspace.prototype, '_isOverviewWindow');
saveMethod(Workspace.WindowClone.prototype, 'getOriginalPosition');
saveMethod(Workspace.Workspace.prototype, '_realRecalculateWindowPositions');
saveMethod(Workspace.UnalignedLayoutStrategy.prototype, '_sortRow');
saveMethod(imports.ui.windowManager.WorkspaceTracker.prototype, '_checkWorkspaces');
saveMethod(WindowManager.WorkspaceTracker.prototype, '_checkWorkspaces');
saveMethod(WindowManager.TouchpadWorkspaceSwitchAction.prototype, '_checkActivated');
signals = new utils.Signals();
}
@@ -265,7 +267,6 @@ function enable() {
disableHotcorners);
disableHotcorners();
function onlyScratchInOverview() {
let obj = Workspace.Workspace.prototype;
let name = '_isOverviewWindow';
@@ -282,10 +283,13 @@ function enable() {
onlyScratchInOverview);
onlyScratchInOverview();
// Disable switching the workspace after 4 finger swipe.
WindowManager.TouchpadWorkspaceSwitchAction.prototype._checkActivated = () => false;
/* The «native» workspace animation can be now (3.30) be disabled as it
calls out of the function bound to the `switch-workspace` signal.
*/
imports.ui.windowManager.WindowManager.prototype._prepareWorkspaceSwitch =
WindowManager.WindowManager.prototype._prepareWorkspaceSwitch =
function (from, to, direction) {
if (this._switchData)
return;
@@ -376,7 +380,7 @@ function enable() {
};
}
imports.ui.windowManager.WorkspaceTracker.prototype._checkWorkspaces = function () {
WindowManager.WorkspaceTracker.prototype._checkWorkspaces = function () {
let workspaceManager = global.workspace_manager;
let i;
let emptyWorkspaces = [];