Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

feat: swap window0 and window1 when focus on window0 #458

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions src/kwinscript/engine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,17 @@ export class EngineImpl implements Engine {
}

public setMaster(window: EngineWindow): void {
// const window = this.controller.currentWindow;
// let windows;

const windows = this.windows.allWindowsOn(this.controller.currentSurface);
if (windows && windows.length > 1) {
if (window === windows[0]) {
this.windows.putWindowToMaster(windows[1]);
this.controller.currentWindow = windows[1];
return;
}
}
this.windows.putWindowToMaster(window);
}

Expand Down