4 Commits

Author SHA1 Message Date
Peter Fajdiga
21eacd7ba4 Makefile: package: rename package dir to karousel 2024-10-27 14:44:35 +01:00
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
4 changed files with 9 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ uninstall:
kpackagetool5 --type=KWin/Script -r ./package
package: build config
tar -czf ./karousel_${subst .,_,${VERSION}}.tar.gz ./package
tar -czf ./karousel_${subst .,_,${VERSION}}.tar.gz ./package --transform s/package/karousel/
logs:
journalctl -t kwin_x11 -g '^qml:|^file://.*karousel' -f

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);