Skip to content
Draft
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
24 changes: 14 additions & 10 deletions [email protected]/workspacePopup/workspaceManagerOverride.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const WraparoundMode = {
export default class WorkspaceManagerOverride {
constructor(settings, keybindings) {
this.wm = Main.wm;
this.wm._wsPopupList = [];
this._wsPopupList = [];
this._wsPopupDestroyIds = [];
this.settings = settings;
this._mutterSettings = new Gio.Settings({schema_id: 'org.gnome.mutter'});
this.wsManager = global.workspace_manager;
Expand All @@ -39,8 +40,8 @@ export default class WorkspaceManagerOverride {
}

async enable() {
await this._initOverrides()

await this._initOverrides()
this._overrideDynamicWorkspaces();
this._overrideKeybindingHandlers();
this._overrideOriginalProperties();
Expand Down Expand Up @@ -469,15 +470,15 @@ export default class WorkspaceManagerOverride {
this.monitors.forEach((monitor) => {
let monitorIndex = monitor.index;

if (!this.wm._wsPopupList[monitorIndex]) {
if (!this._wsPopupList[monitorIndex]) {
this.wm._workspaceTracker.blockUpdates();
this.wm._wsPopupList[monitorIndex] = this._createNewPopup({
this._wsPopupList[monitorIndex] = this._createNewPopup({
monitorIndex: monitorIndex,
toggle: toggle,
});
this.wm._wsPopupList[monitorIndex].connect('destroy', () => {
this._wsPopupDestroyIds[monitorIndex] = this._wsPopupList[monitorIndex].connect('destroy', () => {
this.wm._workspaceTracker.unblockUpdates();
this.wm._wsPopupList[monitorIndex] = null;
this._wsPopupList[monitorIndex] = null;
if (monitorIndex === Main.layoutManager.primaryIndex) {
this.wm._workspaceSwitcherPopup = null;
this.wm._isWorkspacePrepended = false;
Expand All @@ -489,21 +490,24 @@ export default class WorkspaceManagerOverride {

let event = Clutter.get_current_event();
let modifiers = event ? event.get_state() & Clutter.ModifierType.MODIFIER_MASK : 0;
this.wm._wsPopupList[monitorIndex].showToggle(false, null, modifiers, toggle);
this._wsPopupList[monitorIndex].showToggle(false, null, modifiers, toggle);
if (monitorIndex === Main.layoutManager.primaryIndex) {
this.wm._workspaceSwitcherPopup = this.wm._wsPopupList[monitorIndex];
this.wm._workspaceSwitcherPopup = this._wsPopupList[monitorIndex];
}
} else {
// reset of popup
if (monitorIndex === Main.layoutManager.primaryIndex) {
this.wm._wsPopupList[monitorIndex].resetTimeout();
this._wsPopupList[monitorIndex].resetTimeout();
}
}
});
}

_destroyWorkspaceSwitcherPopup() {
this.wm._wsPopupList.filter(p => p).forEach(p => p.destroy());
this._wsPopupList.filter(p => p).forEach((p, i) => {
p.disconnect(this._wsPopupDestroyIds[i]);
p.destroy();
});
}

_getTargetWorkspace(direction) {
Expand Down