Bug 400367 - Cannot launch Kget via apps launcher. It launches via terminal.
Summary: Cannot launch Kget via apps launcher. It launches via terminal.
Status: RESOLVED FIXED
Alias: None
Product: kget
Classification: Applications
Component: general (show other bugs)
Version: 18.12
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KGet authors
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2018-10-27 14:36 UTC by Patrick Silva
Modified: 2018-12-20 21:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 18.12.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2018-10-27 14:36:03 UTC
STEPS TO REPRODUCE
1. search for "kget" in the apps launcher and try to open it
2. 
3. 

OBSERVED RESULT
nothing happens

EXPECTED RESULT
kget opens

SOFTWARE VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.14.2
Qt Version: 5.12.0 beta3
KDE Frameworks Version: 5.51.0


ADDITIONAL INFORMATION
kget opens when I run "kget" in terminal.
Comment 1 Wolfgang Bauer 2018-12-19 21:16:02 UTC
> Qt Version: 5.12.0 beta3

It works fine here with 5.12.0 final (on openSUSE). Maybe a regression in the beta that has been fixed meanwhile?

And I noticed that you filed the very same thing against kmail too, in bug#400368...

I don't think this can be a bug in kget or kmail anyway.
The application doesn't know or care how it is being started.
If there is a bug, it's rather in Qt or the frameworks, I suppose...
Comment 2 Patrick Silva 2018-12-19 21:19:04 UTC
currently I'm running Qt 5.12 on Arch Linux.
Comment 3 Wolfgang Bauer 2018-12-19 21:48:58 UTC
(In reply to Patrick Silva from comment #2)
> currently I'm running Qt 5.12 on Arch Linux.

Ok, but I cannot reproduce it.
And as I wrote, it's rather a problem on a lower level IMHO.

Let's see if there's a response to the kmail bug...
Comment 4 Wolfgang Bauer 2018-12-20 08:40:14 UTC
Maybe related: bug#400633 .

Are you using Wayland?
I only tried on X11...
Comment 5 Wolfgang Bauer 2018-12-20 09:02:42 UTC
(In reply to Wolfgang Bauer from comment #4)
> Are you using Wayland?
> I only tried on X11...

Although, I just tried on Wayland here and kget starts fine from the applauncher as well.
Comment 6 Patrick Silva 2018-12-20 10:48:24 UTC
(In reply to Wolfgang Bauer from comment #4)
> Maybe related: bug#400633 .
> 
> Are you using Wayland?
> I only tried on X11...

yes, the problem with kget only occurs under Wayland.
I can't reproduce with kmail anymore, it launches as expected under X11 and Wayland.
Comment 7 Wolfgang Bauer 2018-12-20 12:21:23 UTC
(In reply to Patrick Silva from comment #6)
> yes, the problem with kget only occurs under Wayland.
> I can't reproduce with kmail anymore, it launches as expected under X11 and
> Wayland.

Ok, I just noticed that the Exec line in kget's desktop file still has the %i parameter. IIRC that may cause problems on Wayland as Qt doesn't support the --icon option there.

Can you try to remove the %i?
Either in the menu editor or by editing the .desktop file (likely /usr/share/applications/org.kde.kget.desktop) with a text editor. (you might have to run kbuilsycoca5 afterwards in the latter case)

A bit strange that it works here, but that may be due to some openSUSE patch (making it being run via XWayland).

It should be removed anyway though, according to https://community.kde.org/Guidelines_and_HOWTOs/Wayland_Porting_Notes:
> Exec key of .desktop files
> 
> The Exec key of your .desktop file should not contain the %i "field code".
> Your application won't start on Wayland otherwise, because the specification
> expands that code in the --icon argument, which is accepted by QGuiApplication 
> only on XCB platforms. This code review contains a discussion about the
> upstream decision. You can use the -qwindowicon argument as replacement. It
> still won't work on Wayland (it will on most other platforms) but now your
> app will start everywhere.
> 
> // Don't
> Exec=someapp %i %U
> // Do
> Exec=someapp -qwindowicon someicon %U
Comment 8 Patrick Silva 2018-12-20 14:14:22 UTC
yes, to remove %i in the desktop file solves the problem.
Thank you Wolfgang.
Comment 9 Wolfgang Bauer 2018-12-20 21:37:38 UTC
Git commit 80adf24c1091115e2fa4839650a5708b2d4672c8 by Wolfgang Bauer.
Committed on 20/12/2018 at 21:29.
Pushed by wbauer into branch 'Applications/18.12'.

Set window icon in code instead of in the desktop file

%i is expanded to "--icon xxx", but Qt only supports that option on
xcb, not Wayland. Therefore kget couldn't be started from the
application launcher/menu on Wayland.
See https://community.kde.org/Guidelines_and_HOWTOs/Wayland_Porting_Notes#Application_Icon .

Instead, use QApplication::setWindowIcon() to set the window icon
(necessary to have a window icon on other desktops than Plasma). This
also has the advantage that the proper window icon is set when running
kget from a shell (and not passing the --icon or -qwindowicon options).
FIXED-IN: 18.12.1

M  +1    -1    desktop/org.kde.kget.desktop.cmake
M  +1    -0    main.cpp

https://commits.kde.org/kget/80adf24c1091115e2fa4839650a5708b2d4672c8
Comment 10 Wolfgang Bauer 2018-12-20 21:42:15 UTC
(In reply to Patrick Silva from comment #8)
> yes, to remove %i in the desktop file solves the problem.

Thanks for the confirmation.
I pushed a fix.

PS: you probably should close your kmail bug report if it is working now... ;-)