Bug 400753 - Add support for custom StartupWMClass
Summary: Add support for custom StartupWMClass
Status: RESOLVED FIXED
Alias: None
Product: Falkon
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-06 15:25 UTC by Alexandre Pereira
Modified: 2018-12-26 13:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 3.1.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Pereira 2018-11-06 15:25:38 UTC
SUMMARY

Hi. I am using falkon browser with multiple profiles to simulate something similar to chrome --app switch, or akin to PWA's.

So I have for example, an reddit profile for falkon, that opens on reddit. One problem is that the taskmanager icon is the same as normal falkon window.
Would it be possible for falkon to honor a custom StartupWMClass, so to say have something like StartupWMClass=falkon-reddit , and it would use the falkon-reddit.desktop in the taskmanager ?


STEPS TO REPRODUCE
1. create new falkon profile ( optional ) and create a desktop file to launch new falkon 
2. add StartupWMClass to desktop file
3. falkon ignores the StartupWMClass in the desktop file and uses always the same

OBSERVED RESULT


EXPECTED RESULT
falkon to use the WM_CLASS especified in the StartupWMClass on the desktop file that launches falkon

SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 David Rosca 2018-12-24 14:20:06 UTC
Git commit cbb322c1a59a428a0863657c98354576e5cfd079 by David Rosca.
Committed on 24/12/2018 at 13:47.
Pushed by drosca into branch 'master'.

X11: Add --wmclass command line option
FIXED-IN: 3.1.0

M  +12   -0    src/lib/app/commandlineoptions.cpp
M  +8    -0    src/lib/app/mainapplication.cpp
M  +4    -0    src/lib/app/mainapplication.h
M  +2    -1    src/lib/app/qzcommon.h
M  +3    -2    src/lib/tools/qztools.cpp

https://commits.kde.org/falkon/cbb322c1a59a428a0863657c98354576e5cfd079
Comment 2 David Rosca 2018-12-24 14:20:22 UTC
It doesn't work the way you described. StartupWMClass is not there to dictate the application to use this class, instead it is there for launchers to know what WM_CLASS will the started application have.

You can now use "falkon --wmclass falkon-reddit" in your launcher to start falkon with "falkon-reddit" WM_CLASS.
Comment 3 Alexandre Pereira 2018-12-25 12:12:40 UTC
Thank you !! very much !!!!

I will test ASAP on opensuse git packages !

Will this work on wayland too ?
Comment 4 David Rosca 2018-12-25 12:38:25 UTC
(In reply to Alexandre Pereira from comment #3)
> Will this work on wayland too ?

No, on Wayland there is no WM_CLASS, instead the appId (at least width xdg-shell) is used to match windows with launchers. So for Wayland I can either add new flag or repurpose the --wmclass to change app id.
Comment 5 Alexandre Pereira 2018-12-26 13:26:42 UTC
thanks for you comment.

It would be really cool. The way I am using falkon is to have a default profile where I do normal web browsing, and then have falkon with custom profiles ( where I pick a template settings.ini file and make a new profile dir with just that file ).

So I am using these "falkon web apps" ( launching with falkon -rwp "profile" ) alot and are working great, except these taskmanager problems.

Don't want to ask too much or overburden you, but would love it to also work on wayland ( I am currently testing wayland and trying to use it more and more with opensuse git packages ).