pass focus when moving a window to another desktop
This commit is contained in:
@@ -21,7 +21,7 @@ class Window {
|
||||
if (targetColumn === this.column) {
|
||||
return;
|
||||
}
|
||||
this.column.onWindowRemoved(this, false);
|
||||
this.column.onWindowRemoved(this, this.isFocused() && targetColumn.grid !== this.column.grid);
|
||||
this.column = targetColumn;
|
||||
targetColumn.onWindowAdded(this, bottom);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests.register("Pass focus", 1, () => {
|
||||
tests.register("Pass focus", 10, () => {
|
||||
const config = getDefaultConfig();
|
||||
const { qtMock, workspaceMock, world } = init(config);
|
||||
|
||||
@@ -10,4 +10,7 @@ tests.register("Pass focus", 1, () => {
|
||||
|
||||
qtMock.fireShortcut("karousel-column-move-to-desktop-2");
|
||||
Assert.equal(workspaceMock.activeWindow, client1);
|
||||
|
||||
client1.desktops = [workspaceMock.desktops[1]];
|
||||
Assert.equal(workspaceMock.activeWindow, client0);
|
||||
});
|
||||
|
||||
@@ -182,14 +182,10 @@ class MockKwinClient {
|
||||
|
||||
public set desktops(desktops: KwinDesktop[]) {
|
||||
this._desktops = desktops;
|
||||
runReorder(
|
||||
() => this.desktopsChanged.fire(),
|
||||
() => {
|
||||
if (Workspace.activeWindow === this && !desktops.includes(Workspace.currentDesktop)) {
|
||||
Workspace.activeWindow = null;
|
||||
}
|
||||
},
|
||||
);
|
||||
this.desktopsChanged.fire();
|
||||
if (Workspace.activeWindow === this && !desktops.includes(Workspace.currentDesktop)) {
|
||||
Workspace.activeWindow = null;
|
||||
};
|
||||
}
|
||||
|
||||
public get tile() {
|
||||
|
||||
Reference in New Issue
Block a user