Bug 391754 - clicking appstream uri starts discover but doesn't focus the window
Summary: clicking appstream uri starts discover but doesn't focus the window
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: 5.12.7
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
Keywords: usability
Depends on:
Reported: 2018-03-12 14:28 UTC by Harald Sitter
Modified: 2021-04-13 12:05 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.21

video of 5.12.0 in a vm (1.84 MB, video/x-matroska)
2018-03-13 11:43 UTC, Harald Sitter

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2018-03-12 14:28:17 UTC
- discover isn't running
- click appstream uri in browser
- discover starts
- no focus

ALSO: no needs-attention highlight in the taskbar

the no-focus bit might well be focus stealing prevention kicking in, in which case there must be a needs-attention highlight (ideally of course discover would come to front)

when doing the same with discover already open it still won't come to foreground, but have have the needs-attention highlight ¯\_(ツ)_/¯
Comment 1 Aleix Pol 2018-03-12 14:57:43 UTC
I can reproduce, on Wayland. On X11 it does get the attention highlight but it doesn't raise.

QWindow::raise() is being called, I'm not sure what else should happen. Will investigate.
Comment 2 Aleix Pol 2018-03-13 00:20:32 UTC
I just realised you mean when the application starts. Could it be that your KWin is broken? it seems to work for me...
Comment 3 Harald Sitter 2018-03-13 11:43:31 UTC
Created attachment 111365 [details]
video of 5.12.0 in a vm

tried in a new VM. it's actually somewhat more complicated. what I am seeing is only happening iff the previous discover was closed while it was minimized.


- start discover
- minimize
- right click on task bar
- close
- xdg-run appstream uri

this way it is 100% reproducible.

additionally the window never gets raised if the window was already open.

the attached video should show both behaviors
Comment 4 Nate Graham 2018-03-16 04:11:08 UTC
Can reproduce with `xdg-open [appstream URI]`

Cannot reproduce when opening an appstream link from Firefox.
Comment 5 Alexander Mentyu 2018-04-19 18:58:14 UTC
Can reproduce steps in Comment 3 on X in terminal, Chromium and Firefox - but cannot reproduce on Wayland - Discover always comes to front

Plasma: 5.12.4
Apps: 17.12.3
Frameworks: 5.45.0
Qt: 5.10.1
Kernel: 4.14.34-1-MANJARO
OS: Netrunner Rolling
Video: Intel 4400
Driver: xf86-video-intel 1:2.99.917+823+gd9bf46e4-1
Screen: 1600x900
wayland-protocols 1.13-1
wayland 1.14.0-1
Comment 6 Aleix Pol 2018-10-08 14:21:34 UTC
Assigning to kwin, I just checked and raise is definitely being called, I have no idea why it happens.

For easier debugging, just try running discover, put it behind another window and call "plasma-discover appstream://org.kde.kolf.desktop".
Comment 7 Aleix Pol 2018-10-08 14:22:06 UTC
FWIW, this won't work on wayland because wayland doesn't understand ::raise(). I'm not sure why it worked.
Comment 8 David Edmundson 2018-10-08 14:52:53 UTC
On wayland we (currently) focus new toplevels.

If discover isn't running, it'll take focus. If it is, nothing will happen (for now at least)
Comment 9 Martin Flöser 2018-10-08 17:41:14 UTC
This is not a bug in KWin. It's rather expected behavior of focus (and raising) protection. You need to provide a KStartupInfo to discover (by using for example KRun), so that KWin can know that it's legit to pass focus to the window. If you launch from Krunner it works after all. Passing back to discover.
Comment 10 Aleix Pol 2018-10-11 15:48:26 UTC
So firefox should use KRun? :/
That's how we have things never work.
Comment 11 Nate Graham 2021-04-07 19:17:31 UTC
This was fixed recently and is working now!
Comment 12 Patrick Silva 2021-04-09 14:06:48 UTC
I'm not sure if this is the same issue, but Discover starts minimized when I click on "Install/View in desktop store" buttons in the following link


Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Graphics Platform: X11
Comment 13 Nate Graham 2021-04-09 16:58:09 UTC
That's extremely odd. Minimized? I wasn't aware that that was even possible...

Either way, it would be a different issue. Does it only happen for snap links, or any appstream links? What about if you open the link manually with `plasma-discover --application appstream://orgkde.discover.snap`?
Comment 14 Aleix Pol 2021-04-12 15:09:03 UTC
@Patrick. Definitely not the same issue.

Please reopen a new bug if you can reproduce. Please check the value of Visibility within [Window] of your ~/.config/discoverrc.
Comment 15 Patrick Silva 2021-04-13 12:05:03 UTC
Weirdy I no longer can reproduce the bug.
I will open a new bug report if it occurs again.

Thanks Nate and Aleix.