diff --git a/kwin/scripts/convergentwindows/contents/ui/main.qml b/kwin/scripts/convergentwindows/contents/ui/main.qml index e32a659d..f9e0a128 100644 --- a/kwin/scripts/convergentwindows/contents/ui/main.qml +++ b/kwin/scripts/convergentwindows/contents/ui/main.qml @@ -9,6 +9,8 @@ import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings Loader { id: root + property var currentWindow + function run(window) { // HACK: don't maximize xwaylandvideobridge // see: https://invent.kde.org/plasma/plasma-mobile/-/issues/324 @@ -44,6 +46,27 @@ Loader { } } + Connections { + target: currentWindow + + function onFullScreenChanged() { + currentWindow.interactiveMoveResizeFinished.connect((currentWindow) => { + root.run(currentWindow); + }); + root.run(currentWindow); + } + + function onMaximizedChanged() { + if (!currentWindow.maximizable) { + return; + } + currentWindow.interactiveMoveResizeFinished.connect((currentWindow) => { + root.run(currentWindow); + }); + root.run(currentWindow); + } + } + Connections { target: ShellSettings.Settings @@ -70,6 +93,16 @@ Loader { } } + function onWindowActivated(window) { + if (window.normalWindow) { + currentWindow = window; + window.interactiveMoveResizeFinished.connect((window) => { + root.run(window); + }); + root.run(window); + } + } + function onScreensChanged() { // Windows are moved from the external screen // to the internal screen if the external screen