3 Commits

Author SHA1 Message Date
Peter Fajdiga
5004417285 bump package to 0.7.2 2024-10-27 13:51:52 +01:00
Peter Fajdiga
a110aee7ce ClientWrapper: implement workaround for Qt5 JS bug 2024-09-10 23:33:56 +02:00
Peter Fajdiga
817ea64171 DesktopManager: fix getDesktopForClient 2024-08-30 12:14:40 +02:00
3 changed files with 8 additions and 7 deletions

View File

@@ -9,7 +9,7 @@
}],
"Id": "karousel",
"ServiceTypes": ["KWin/Script"],
"Version": "0.7.1",
"Version": "0.7.2",
"License": "GPLv3",
"Website": "https://github.com/peterfajdiga/karousel",
"BugReportUrl": "https://github.com/peterfajdiga/karousel/issues"

View File

@@ -33,13 +33,14 @@ class ClientWrapper {
// window is being manually resized, prevent fighting with the user
return;
}
this.lastPlacement = Qt.rect(x, y, width, height);
this.kwinClient.frameGeometry = this.lastPlacement;
if (this.kwinClient.frameGeometry !== this.lastPlacement) {
const clientWrapper = this; // workaround for bug in Qt5's JS engine
clientWrapper.lastPlacement = Qt.rect(x, y, width, height);
clientWrapper.kwinClient.frameGeometry = clientWrapper.lastPlacement;
if (clientWrapper.kwinClient.frameGeometry !== clientWrapper.lastPlacement) {
// frameGeometry assignment failed. This sometimes happens on Wayland
// when a window is off-screen, effectively making it stuck there.
this.kwinClient.frameGeometry.x = x; // This makes it unstuck.
this.kwinClient.frameGeometry = this.lastPlacement;
clientWrapper.kwinClient.frameGeometry.x = x; // This makes it unstuck.
clientWrapper.kwinClient.frameGeometry = clientWrapper.lastPlacement;
}
});
}

View File

@@ -39,7 +39,7 @@ class DesktopManager {
}
public getDesktopForClient(kwinClient: KwinClient) {
if (kwinClient.activities.length !== 1 && kwinClient.desktop === 0) {
if (kwinClient.activities.length !== 1 || kwinClient.desktop <= 0) {
return undefined;
}
return this.getDesktop(kwinClient.activities[0], kwinClient.desktop);