Bug 514840

Summary: pcmanfm-qt doesn't provide activation token on Wayland: existing Kate instance isn't raised when opening a file from pcmanfm-qt
Product: [Applications] kate Reporter: Alberto Salvia Novella <es20490446e>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: CLOSED DOWNSTREAM    
Severity: normal CC: christoph, nate
Priority: NOR    
Version First Reported In: 25.12.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://github.com/lxqt/pcmanfm-qt/issues/2137
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 460318    

Description Alberto Salvia Novella 2026-01-19 19:42:51 UTC
SYSTEM
- Plasma 6.5.5
- Frameworks 6.22.0
- Qt 6.10.1
- Wayland
- Zenned OS

STEPS
1. In System Settings, set "focus stealing prevention" to "low".
2. Open Kate.
3. Using the file manager, open a plain text file on Kate.

RESULT
- The Kate window doesn't rise.

RELATED
- With focus stealing prevention set to "Medium", some newly spawned windows (including Yakuake) don't get focus anymore: https://bugs.kde.org/show_bug.cgi?id=509990
Comment 1 Nate Graham 2026-01-31 14:35:26 UTC
Works for me. Which file manager are you using?

Does it reproduce in a new clean user account on the same computer?
Comment 2 Nate Graham 2026-01-31 14:43:05 UTC
Oh, one more question, since the original steps to reproduce aren't clear about it:

> Using the file manager, open a plain text file on Kate.
Are you simply single-double clicking the file to open it? Or are you dragging it onto Kate or its Task manager icon?
Comment 3 Alberto Salvia Novella 2026-01-31 16:56:50 UTC
It happens by clicking on the file to open it.

It happens with pcmanfm-qt, and it doesn't with dolphin.

It happens on kwin_wayland, it doesn't on kwin_x11.
Comment 4 Nate Graham 2026-01-31 17:52:37 UTC
I suspected you might be using Dolphin. Because it works with Dolphin, we can see that it's an issue with pcmanfm-qt, right?

The way cross-app activation works on Wayland is that both the sending and receiving app need to correctly implement the https://wayland.app/protocols/xdg-activation-v1 protocol. Ad we can see, Dolphin does, but pcmanfm-qt doesn't.

As a workaround until pcmanfm-qt gains that, you can set the focus stealing prevention setting to "none".
Comment 5 Alberto Salvia Novella 2026-02-01 01:35:26 UTC
Reported downstream at:
https://github.com/lxqt/pcmanfm-qt/issues/2137
Comment 6 Christoph Cullmann 2026-02-01 17:41:49 UTC
I chimed in on

https://github.com/lxqt/pcmanfm-qt/issues/2137
Comment 7 Alberto Salvia Novella 2026-02-02 01:33:19 UTC
Yet Kwin can detect this situation on X11, but not on Wayland.

I would first resolve the conversation on:
https://github.com/lxqt/pcmanfm-qt/issues/2137
Comment 8 Nate Graham 2026-02-02 01:37:09 UTC
As I mentioned in a comment over there, it's because cross-window activation works differently on X11 compared to how it does on Wayland.

And based on the rest of the conversation, I'm confident this is a pcmanfm-qt issue, not a KWin issue.
Comment 9 Christoph Cullmann 2026-02-02 06:32:32 UTC
Yeah, no token, no raise. If pcmanfm doesn’t add code to pass one (or uses the right glib api if there is any), no chance.
Comment 10 Christoph Cullmann 2026-02-02 18:29:53 UTC
https://github.com/lxqt/pcmanfm-qt/issues/2137 shows that there is no interest to have that, I would propose to not use pcmanfm-qt if you want to have some security by focus stealing prevention and still a proper experience with Kate & Co.

But that is up to the user. We did what we could.
Comment 11 Alberto Salvia Novella 2026-02-02 19:45:27 UTC
The security benefits of "focus stealing prevention" look pretty small.
Comment 12 Christoph Cullmann 2026-02-02 21:45:15 UTC
(In reply to Alberto Salvia Novella from comment #11)
> The security benefits of "focus stealing prevention" look pretty small.

I don't agree with that, you can do nasty stuff like steal your password with that, if you do it at the right time.

And I fail to see why one should lower the security level just because one developer wants not to implement a protocol most compositors have for that use case. (and starts to frame that as a KDE only thingy)

I will not respond in the linked issue anymore, I don't see any sense in that, one can not force people to do stuff they don't want in open source and it seems that protocol is not wanted there.
Comment 13 Alberto Salvia Novella 2026-02-02 21:52:19 UTC
The downstream developer just don't understand the intent of this token.

Same as I didn't not long ago, on my previous comment here.
Comment 14 Christoph Cullmann 2026-02-02 21:58:36 UTC
(In reply to Alberto Salvia Novella from comment #13)
> The downstream developer just don't understand the intent of this token.
> 
> Same as I didn't not long ago, on my previous comment here.

I praise your effort in both learning about the protocol and trying to communicate it to down stream.

Perhaps I am just too pessimistic about the outcome.
Comment 15 Nate Graham 2026-02-02 22:00:28 UTC
It's worth the effort for sure. But in the end you can't really convince people of what they don't want to be convinced of.