Plasma 6: issues with pinning LibreOffice in task manager

Hi,

Since I have Plasma 6, the behaviour of my LibreOffice apps in the task manager got disrupted.

I like to use the icons-only version and pin separately Writer, Calc and so on. Open Writer files should be grouped together. All this was working just fine before (Plasma 5).

Now it isn’t.

If I use an open file to pin the app in the task manager, I get the generic soffice.bin pinned and not separate Writer, Calc etc. When I click on it, I get the LibreOffice window asking me which app I want to open. Definitely not what I want (and used to have). I want it to go straightforward to a new file in the desired app (Writer, Calc, etc.).

If I pin Writer right-clicking on the app in the launcher, I get Writer pinned separately (yes!), but then new files are grouped under new icons at the end of the task manager (“soffice.bin”). They are not grouped together in the pinned Writer, disrupting my behaviour (which relies on shortcuts to go directly to Writer files).

Seems to be a similar issue like this: Libreoffice writer: duplicate icon in panel. One month ago it’s said to be solved, but my Manjaro update with Plasma 6 was installed one week ago and the issue is still there.

Any hint?

Do you use Wayland or X11? The behavior in both has changed but the solution is different.

X11.
I didn’t change this during the update.

Class names ( WM_CLASS ) in Plasma 6 and X11 have changed, in almost all cases they now start with capital letters, e.g. konsole → Konsole

Free the icons that don’t work and redock them.

If this does not work you will have to edit the “.desktop” file of the application and change the value of the “StartupWMClass” option to the value you get with the following command:

qdbus org.kde.KWin /KWin queryWindowInfo

You execute it, click on the corresponding window, the value we are looking for is “resourceClass”.

I have freed and redocked them. Didn’t work.

Then I changed libreoffice-writer.desktop and put soffice.bin as value of “StartupWMClass”. This is what I got for “resourceClass” clicking on a Writer file with the qdbus command. Now Writer files are grouped together in the Writer icon, but also all Impress, Calc etc. files (I assume because all of them are also soffice.bin and I indeed get this result clicking on them with the qdbus command). The same happens if I change libreoffice-impress.desktop and libreoffice-calc.desktop.

It’s still not the behaviour it had before when Writer files were grouped together, then Calc files together, then Impress together…

Try the following values for each “.desktop” file as appropriate, option 1:

StartupWMClass=libreoffice-writer
StartupWMClass=libreoffice-calc
...

If it does not work, option 2:

StartupWMClass=libreoffice libreoffice-writer
StartupWMClass=libreoffice libreoffice-calc
...

Option 3: (class names in Wayland)

StartupWMClass=soffice.bin libreoffice-writer
StartupWMClass=soffice.bin libreoffice-calc
...

Let me explain, my guess (as it has been in my case) is that when upgrading to Plasma 6 with X11, the upgrade has automatically changed the names of the “StartupWMClass” classes in the .desktop files.

As the Task Manager is user customizable, the upgrade has not changed anything, so it will have the previous values in the class names.

The idea is to match the values of the classes in the .desktop files back to those in the Task Manager.

In theory it would be enough to delete and re-add the Task Manager icons.

Otherwise, at each change of the “.desktop” files you will need to delete and re-add the icons.

It’s also happening to me. With different apps.

So here it goes.

Option 1: it’s the original one, which led to the wrong behaviour
Option 2: didn’t work, same behaviour
Option 3: I have X11. Even so I tried, same behaviour

I should have stated that I use libreoffice-fresh. Then I uninstalled it and installed libreoffice-still. This makes the task manager work as expected (as Plasma 5 + libreoffice-fresh), namely grouping Writer files together with Writer pinned icon, Calc files together with Calc pinned icon and so on. Next, I uninstalled libreoffice-still and installed libreoffice-fresh back, keeping the pinned icons as I configured them with libreoffice-still. Then the wrong behaviour comes back.

It seems that libreoffice-fresh is being treated as a single thing, soffice.bin, while libreoffice-still manages to treat each application separately. But why was it working with Plasma 5…?

==

I should have also stated that everything is reproducible in my two laptops.

More news:

I have changed to Wayland and now the pinned icon behaviour works fine. When I open a new file, for one second or less there’s an additional icon in the task manager (when I hover the mouse on it, I can see it’s title as “soffice.bin”), but then it gets quickly rearranged and regrouped with the respective pinned icon.

I’ve used the qdbus command to check the “resourceClass”, and now it’s value refers to the specific application, e.g., “libreoffice-calc” instead of “soffice.bin” as in X11. I have no idea why.

I’ve never used Wayland before, don’t really know if I should simply stick to it - or better find out the correct solution for the X11 approach.

Strange - I get the expected behavior - whether I pin writer and calc from the menu or from an open document.

The pinned app opens a blank document and if opening documents from file manager the documents are grouped within the relevant app.

Is there something I don’t understand with your issue?

Your Writer behaviour is simply how it worked for me until one week ago, before the update to Plasma 6.

But with Wayland it’s working… I really don’t get it.

I see - I am using Wayland - have been for a long time - I don’t really think about X11

I do remember though that my Jetbrains applications was correct on X11 - then when activated they became a white background - but on Wayland they displayed correct.