plasma6-window-title-applet icon indicating copy to clipboard operation
plasma6-window-title-applet copied to clipboard

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

Open 3urobeat opened this issue 1 year ago • 12 comments

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.

3urobeat avatar Mar 07 '24 12:03 3urobeat

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.

dhruv8sh avatar Mar 07 '24 12:03 dhruv8sh

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 avatar Mar 07 '24 13:03 3urobeat

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.

3urobeat avatar Mar 13 '24 16:03 3urobeat

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.

dhruv8sh avatar Mar 14 '24 14:03 dhruv8sh

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.

D3SOX avatar Mar 15 '24 11:03 D3SOX

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.

3urobeat avatar Mar 15 '24 17:03 3urobeat

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.

ChrTall avatar May 11 '24 11:05 ChrTall

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.

dhruv8sh avatar May 11 '24 11:05 dhruv8sh

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.

ChrTall avatar May 11 '24 12:05 ChrTall

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.

dhruv8sh avatar May 11 '24 12:05 dhruv8sh

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 avatar May 11 '24 12:05 ChrTall

@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.

ChrTall avatar Jul 03 '24 13:07 ChrTall