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

KDE Snap Assist suggests windows from other activities #23

Closed rodrigopedra closed 1 year ago

rodrigopedra commented 1 year ago

First, thanks for this wonderful script =)

When one is using more than one activity, KDE Snap Assist suggests windows present in other activities.

In addition, if one chose a window from another activity, its icon is not migrated to the current activity.

Just to be clear, I expected windows from another activity to not be available at all, I just wanted to share the behavior if one is selected.

emvaized commented 1 year ago

Thanks for your report. Sure, it makes total sense to filter out windows from other activities. And I believe there's even no config needed for this, as it's the main purpose of activities itself – prevent you from seeing windows from the other activities.

I'll check what could be done.

emvaized commented 1 year ago

This thing turned out to be more difficult than I expected. KWin Scripting API has a property activities, which should list all the activities the window currently is on. But during my tests, it somehow always returns empty list, even for windows opened on another activity and not visible in the current one.

Maybe you could mention some other KWin scripts which do filtering by activities, so that we could take a look how they do it under the hood?

rodrigopedra commented 1 year ago

Thanks for the response @emvaized

I don't have any other KWin scripts installed. If I find one which filters activities I will link it here

emvaized commented 1 year ago

I have implemented some test support for filtering out windows from other activities in the dev branch — would be glad if you could try it out! (installation guide)

The script is set to display windows which are either visible on all activities, or which belong to the current activity only.

Note: During my testing, restarting KWin or re-login to Plasma somehow resets the status for windows from other activities, and they may need to be reopened to be filtered out by the script correctly. Maybe it's a KWin bug?

emvaized commented 1 year ago

However, I don't think it can get any better. I did more tests, and can confirm that assist now shows only windows visible on all activities, or those visible only on the current one, filtering out all the others.

The fix now is on the main branch and included in the new 1.5 release.

rodrigopedra commented 1 year ago

thanks @emvaized , it works much better now =)