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
1 change: 1 addition & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"settings-schema": "org.gnome.shell.extensions.coverflowalttab",
"shell-version": ["50"],
"uuid": "CoverflowAltTab@palatis.blogspot.com",
"version": 84,
"description": "Replacement of Alt-Tab, iterates through windows in a cover-flow manner.",
"url": "https://github.com/dsheeler/CoverflowAltTab"
}
21 changes: 11 additions & 10 deletions src/keybinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const Keybinder330Api = class Keybinder330Api extends AbstractKeybinder {

this._settings = settings;
this._startAppSwitcherBind = null;
this._defaultSwitcherBind = Main.wm._startSwitcher.bind(Main.wm);
this._keybindingActions = new Map();
}

Expand Down Expand Up @@ -99,12 +100,12 @@ export const Keybinder330Api = class Keybinder330Api extends AbstractKeybinder {

disable() {
let mode = Shell.ActionMode ? Shell.ActionMode : Shell.KeyBindingMode;
Main.wm.setCustomKeybindingHandler('switch-applications', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-windows', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-group', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-applications-backward', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-windows-backward', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-group-backward', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-applications', mode.NORMAL, this._defaultSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-windows', mode.NORMAL, this._defaultSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-group', mode.NORMAL, this._defaultSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-applications-backward', mode.NORMAL, this._defaultSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-windows-backward', mode.NORMAL, this._defaultSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-group-backward', mode.NORMAL, this._defaultSwitcherBind);

this.removeKeybinding("coverflow-switch-windows");
this.removeKeybinding("coverflow-switch-windows-on-all-workspaces");
Expand All @@ -120,17 +121,17 @@ export const Keybinder330Api = class Keybinder330Api extends AbstractKeybinder {
Main.wm.setCustomKeybindingHandler('switch-applications', mode.NORMAL, this._startAppSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-applications-backward', mode.NORMAL, this._startAppSwitcherBind);
} else {
Main.wm.setCustomKeybindingHandler('switch-applications', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-applications-backward', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-applications', mode.NORMAL, this._defaultSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-applications-backward', mode.NORMAL, this._defaultSwitcherBind);
}
}
if (key === null || key === 'bind-to-switch-windows') {
if (settings.get_boolean('bind-to-switch-windows')) {
Main.wm.setCustomKeybindingHandler('switch-windows', mode.NORMAL, this._startAppSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-windows-backward', mode.NORMAL, this._startAppSwitcherBind);
} else {
Main.wm.setCustomKeybindingHandler('switch-windows', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-windows-backward', mode.NORMAL, Main.wm._startSwitcher.bind(Main.wm));
Main.wm.setCustomKeybindingHandler('switch-windows', mode.NORMAL, this._defaultSwitcherBind);
Main.wm.setCustomKeybindingHandler('switch-windows-backward', mode.NORMAL, this._defaultSwitcherBind);
}
}
}
Expand Down
18 changes: 6 additions & 12 deletions src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function matchWmClass(win) {
}

function matchOnAllWorkspaces(win) {
return win.on_all_workspaces && !win.is_skip_taskbar();
return !win.is_skip_taskbar();
}

function matchWorkspace(win) {
Expand All @@ -61,15 +61,8 @@ export const Manager = class Manager {
this.switcher = null;
this.exportedObject = null;

if (global.workspace_manager && global.workspace_manager.get_active_workspace)
this.workspace_manager = global.workspace_manager;
else
this.workspace_manager = global.screen;

if (global.display && global.display.get_n_monitors)
this.display = global.display;
else
this.display = global.screen;
this.workspace_manager = global.workspace_manager;
this.display = global.display;
}

enable() {
Expand Down Expand Up @@ -170,6 +163,9 @@ export const Manager = class Manager {
}
}

if (windows.length === 0)
return;

let currentOnly = this.platform.getSettings().current_workspace_only;
let focused = display.focus_window ? display.focus_window : windows[0];

Expand Down Expand Up @@ -275,5 +271,3 @@ export const Manager = class Manager {
}
}



36 changes: 31 additions & 5 deletions src/swipeTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const TouchpadSwipeGesture = GObject.registerClass({
this._touchpadSettings = new Gio.Settings({
schema_id: 'org.gnome.desktop.peripherals.touchpad',
});
this._actor = actor;

actor.connectObject(
'event::touchpad', this._handleEvent.bind(this), this);
Expand Down Expand Up @@ -205,7 +206,8 @@ const TouchpadSwipeGesture = GObject.registerClass({
}

destroy() {
global.stage.disconnectObject(this);
this._actor.disconnectObject(this);
this._actor = null;
}
});

Expand Down Expand Up @@ -235,8 +237,9 @@ const ScrollGesture = GObject.registerClass({
/* this._allowedModes = allowedModes; */
this._began = false;
this._enabled = true;
this._actor = actor;

actor.connect('scroll-event', this._handleEvent.bind(this));
this._scrollEventId = actor.connect('scroll-event', this._handleEvent.bind(this));
}

get enabled() {
Expand Down Expand Up @@ -304,6 +307,14 @@ const ScrollGesture = GObject.registerClass({

return Clutter.EVENT_STOP;
}

destroy() {
if (this._scrollEventId) {
this._actor.disconnect(this._scrollEventId);
this._scrollEventId = 0;
}
this._actor = null;
}
});

const MouseScroll = GObject.registerClass({
Expand All @@ -328,10 +339,11 @@ const MouseScroll = GObject.registerClass({
schema_id: 'org.gnome.desktop.peripherals.mouse',
});
this._natural_scrolling = this._mouseSettings.get_boolean('natural-scroll');
this._mouseSettings.connect('changed::natural-scroll', (settings, key) => {
this._mouseSettingsChangedId = this._mouseSettings.connect('changed::natural-scroll', (settings, key) => {
this._natural_scrolling = settings.get_boolean(key);
});
actor.connect('scroll-event', this._handleEvent.bind(this));
this._actor = actor;
this._scrollEventId = actor.connect('scroll-event', this._handleEvent.bind(this));
}

get enabled() {
Expand Down Expand Up @@ -407,6 +419,15 @@ const MouseScroll = GObject.registerClass({
GLib.Source.remove(this._gestureTimeoutId);
this._gestureTimeoutId = 0;
}
if (this._scrollEventId) {
this._actor.disconnect(this._scrollEventId);
this._scrollEventId = 0;
}
if (this._mouseSettingsChangedId) {
this._mouseSettings.disconnect(this._mouseSettingsChangedId);
this._mouseSettingsChangedId = 0;
}
this._actor = null;
}
});

Expand Down Expand Up @@ -485,7 +506,7 @@ export const SwipeTracker = GObject.registerClass({
this._settings = settings;
/* this._allowedModes = allowedModes; */
this._enabled = true;
this._distance = global.screen_height;
this._distance = global.stage.height;
this._history = new EventHistory();
this._reset();
this._inverted = params.inverted;
Expand Down Expand Up @@ -873,6 +894,11 @@ export const SwipeTracker = GObject.registerClass({
delete this._panGesture;
}

if (this._scrollGesture) {
this._scrollGesture.destroy();
delete this._scrollGesture;
}

if (this._mouseScroll) {
this._mouseScroll.destroy();
delete this._mouseScroll;
Expand Down
2 changes: 1 addition & 1 deletion src/switcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ export class Switcher {
if (this._parent === null) this._manager.platform.removeBackground();

this._disablePerspectiveCorrection();
Main.uiGroup.remove_child(this.actor);
this.actor.destroy();
this._destroyed = true;
this._logger.decreaseIndent();
this._logger.log("Destroying Switcher DONE");
Expand Down
Loading