emvaized / kde-snap-assist

KWin script for KDE Plasma which suggests other window thumbnails on snap
https://store.kde.org/p/1875687
GNU General Public License v3.0
97 stars 6 forks source link

Maximized windows that are tiled don't get set to windowed #19

Closed mdl48 closed 1 year ago

mdl48 commented 1 year ago

I use the kwin option "BorderlessMaximizedWindows" with the window buttons plasmoid. When a maximized window gets tiled the maximized state is not set to windowed for those windows, due to that the window doesn't get the border back. I tried adding client.visibility = Window.Windowed; in the function selectClient but it didn't work, I am not sure if in that function the window gets tiled. The attachment is a video showcasing the problem. https://user-images.githubusercontent.com/111306180/184692971-255d2cf5-49a3-49c4-9177-3f5c191ec0d5.mp4

emvaized commented 1 year ago

Hi! Thanks for your report. I can see why it can happen – the script only modifies window's size and position, so it's quite expectable for tiled window to keep it's borderless state.

Yes, selectClient() is the exact function in which the selected window gets tiled. However, I could not find anything about client.visibility attribute in the KWin scripting's documentation.

Maybe adding client.noBorder = false; line could help?

mdl48 commented 1 year ago

I fixed the problem, in the kwin documentation there's a function setMaximize for clients. Just using that before resizing fixed it. I will submit a pull request, so feel free to merge it. Also thanks for the quick response!