dhruv8sh / plasma6-window-title-applet

Plasma 6 Window Title applet
GNU General Public License v2.0
56 stars 3 forks source link

"Show only window information from current screen" does not remember state #6

Open 3urobeat opened 4 months ago

3urobeat commented 4 months ago

Hey!
Thank you so much for maintaining this applet for Plasma 6!

The "Show only window information from current screen" setting sadly does not work for me - it always shows the currently focused application, not matter on which screen it is.
The behavior does not change on X11.
Am I missing something?

EndeavourOS on kernel 6.7.8-arch1-1, running Plasma 6.0.1. This applet, version 0.3-1, was installed through the AUR.

dhruv8sh commented 4 months ago

Yes. This was reproducible. Thanks for pointing it out! I unfortunately looked over a bug that does not spit out any error. It has been fixed, and will now be pushed to the KDE Store as well.

3urobeat commented 4 months ago

I've cloned the master branch, installed the package using kpackagetool5 -i ./, relogged and it works now!

Thank you so much for the fast fix \^\^

3urobeat commented 3 months ago

Update: I just noticed that it switches back to the name of my Workspace instead of remembering the last focused application (which is still open) when focusing a window on another screen.
Not sure if this is a bug but I at least wouldn't expect it to work that way.

dhruv8sh commented 3 months ago

Plasma Frameworks currently does not provide a way to keep track of a top window in a desktop.

Simply just remembering the last active name would work but issues will arise when a window is closed/minimised without activating it first.

Example: A Konsole window that exits after 10 seconds would still show Konsole after it has exited, when you have an active window on the other desktop.

Possible workaround: Check if the window has closed after fixed intervals. And the problems with it are obvious already.

I'll open the issue again anyways and you can change the title to reflect this.

D3SOX commented 3 months ago

Maybe we could reach out to KDE developers and ask them to implement a way to track the last active window per screen? I think they're active on Matrix.

3urobeat commented 3 months ago

Plasma Frameworks currently does not provide a way to keep track of a top window in a desktop

Yeah, that was what I feared in the first place when making this suggestion.
Sure, we could try to ask the KDE/Plasma team but I'm not sure exactly how and if they'd even be open to adding this on the fly.

We also can't forget about the restrictions Wayland intentionally puts up to prevent applications from sniffing on one another (although I'm not sure how relevant that is in the context of a Plasma Applet).

I don't exactly know where to go from here. Remembering the last focused application name on a screen could theoretically work. Is there an event fired when an application is closed? If so we could listen for that and update the title accordingly.
But I'm just poking around in the dark here as I have never worked on an applet myself.

ChrTall commented 1 month ago

I also use applet-window-buttons which was ported by moodyhunter to KF6. https://github.com/moodyhunter/applet-window-buttons6

It has a Setting per-screen-active-window which does exactly what is discussed here. The applet does not loose track of the window even if you focus another window on a different screen. applet-window-buttons-settings

Maybe you can get some inspiration from there. Anyways great work, thank you.

dhruv8sh commented 1 month ago

2024-05-11 17-25-51

The method used in this widget that you mention is sticky. I have this implemented locally already. Problem with it is that it would stay active even when I minimize, the app's name is shown.

ChrTall commented 1 month ago

I tested the behaviour in your video with the applet-window-buttons6 applet and I do not get the same behaviour. It disappears, when minimizing the window with the buttons from the applet or the native buttons from the window. Maybe the logic in the other applet is a bit different, but I did not really dig deep. Maybe you can give the other applet-window-buttons6 a try, when you have some time.

dhruv8sh commented 1 month ago

I do use window buttons applet very often. As I mentioned, this behavior is implemented "locally" on my system. Not pushed to the repo. I don't want to create confusion amongst new users and a whole flurry of bug reports until there is a proper way of fixing this.

I can push this update on another branch if you want.

ChrTall commented 1 month ago

No problem, was just a suggestion, but if you already know the other applet then I trust you that is does not work. :D I am just looking forward to this beeing implemented in this applet and the stock global-menu from plasma.

ChrTall commented 3 days ago

@dhruv8sh I would like to accept your offer, that you push your local implementation on a different branch. Then I would not have to start from scratch and might be able to solve this.