Bug 303162

Summary: Icon task widget mixes the dolphin launcher and dolphin-emulator launcher
Product: [Unmaintained] plasma4 Reporter: Gatoso <gatoso>
Component: widget-icontasksAssignee: Craig Drummond <craig>
Status: RESOLVED FIXED    
Severity: normal CC: CTownThug711, dolphinuser1
Priority: NOR    
Version: 4.8.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Launcher matching rules for dolphin emulator

Description Gatoso 2012-07-07 19:21:34 UTC
Icon task widget mixes the dolphin launcher and dolphin-emulator launcher. To have a launcher for dolphin (file manager) and a launcher for dolphin-emulator  beside, and by clicking over one of them, the another one disappears. For example: by clicking over the dolphin launcher, it is mixed with the dolphin-emulator launcher and only is displayed the current activity for dolphin, the dolphin-emulator launcher disappears.

Reproducible: Always

Steps to Reproduce:
1.Install dolphin emulator
2.Add only task widget to the plasma desktop
3.Add a launcher for dolphin (file manager) and a launcher for dolphin emulator on only task widget
4.Click over any of them, the other one will disappear.
Actual Results:  
By clicking over one of the launchers the other one disappears.

Expected Results:  
By clicking over one of the launchers the other one is available for clicking

Dolphin emulator is an open source emulator for gamecube and wii games, its web site is: http://dolphin-emulator.com
Comment 1 Craig Drummond 2012-07-08 20:43:49 UTC
IconTasks uses KDE libtaskmanager to match a window to a launcher. So the issue really lives there...

taskmanager uses the windows 'WM_CLASS' attribute to match it to a launcher. To find out a windows 'CLASS' attributes, type the following in a konsole window. The cursor will change to a cross ( + ) - move this over the app window, and press the left button.

xprop | grep WM_CLASS

For the dolphin file manager, this will return WM_CLASS(STRING) = "dolphin", "Dolphin"  - taskmanager then uses this to link to a .desktop file.

Looks like you have two dolphins, so how is IconTasks to know which is which? If your other dolphin (the emulator) produces different values for WM_CLASS above, what you can do is go to IconTasks's 'Launcher Matching Rules' section. Click 'Add', then 'Detect Window Properties - and click on an emulator window. Then in the 'Launcher' field, type (or find via the file selector) the location of the emulator's .desktop file.
Comment 2 Eyad 2012-07-11 18:54:24 UTC
I can confirm this behavior. I made launchers for both programs in IconTasks. Here are two pics to show the problem:

When Dophin and Dolphin-emu are both open (Dolphin is open but minimized), everything is OK:
http://tinypic.com/view.php?pic=34s0aip&s=6

When one program is open (Dolphin-emu in this case), the other's launcher is hidden:
http://tinypic.com/view.php?pic=s470pi&s=6

The pics even demonstrate that IconTasks know they have different Window Classes and different Window Names.
Comment 3 Craig Drummond 2012-07-11 19:33:49 UTC
I've just installed Dolphin 3.0-713 from https://launchpad.net/~glennric/+archive/dolphin-emu

I cant reproduce this behaviour!

I notice you have custom launcher matching rules. Perhaps this is where the error is? Could you try removing both of these, restarting plasma, and the just use the 'Show a launcher when not running' context menu to create the launcher. This is whay I did, and it seems to be fine.
Comment 4 Eyad 2012-07-12 00:19:49 UTC
I forgot to say that I'm running Chakra Linux and KDE SC 4.8.3. Would IconTasks from git build with this release of KDE? Could you point me to the git tree?
Here is a screencast (6.6 mb) I made to demonstrate the problem (I deleted the launcher rules and used kquitapp plasma-desktop and kstart plasma-desktop before recording):
https://www.dropbox.com/s/c1c18d85hcc6o6f/out.ogv?m
Comment 5 Craig Drummond 2012-07-12 19:30:27 UTC
Very. Odd. IS dolphin-emu installed system-wide? If you notice in your video, when yu start dolphin (file manager) the spinnig icon is over the dolphon-emu.

Can you paste the [Launchers] section from ~/.kde/share/config/plasma-desktop-appletsrc

its the section that looks something like:

[Containments][4][Applets][109][Configuration][Launchers]
Items=file:///usr/share/applications/thunderbird.desktop?wmClass=Thunderbird,file:///usr/share/applications/firefox.desktop,file:///usr/local/share/applications/kde4/cantata.desktop?wmClass=Cantata,file:///usr/share/applications/kde4/konsole.desktop,file:///usr/share/applications/kde4/digikam.desktop,file:///usr/share/applications/kde4/systemsettings.desktop,file:///usr/share/applications/kde4/dolphin.desktop?wmClass=Dolphin,file:///usr/share/applications/dolphin-emu.desktop?wmClass=Dolphin-emu
Locked=false


----------

As you can see from mine above - both dolphin and dolphin-emu are recognised.
Comment 6 Eyad 2012-07-12 19:48:46 UTC
Here it is:
[Containments][3][Applets][54][Configuration][Launchers]
Items=file:///usr/share/applications/firefox.desktop?wmClass=Firefox,file:///usr/share/applications/kde4/rekonq.desktop?wmClass=Rekonq,file:///usr/share/applications/kde4/bangarang.desktop,file:///usr/share/applications/kde4/kate.desktop,file:///usr/share/applications/kde4/words.desktop,file:///usr/share/applications/kde4/sheets.desktop,file:///usr/share/applications/kde4/akregator.desktop?wmClass=Akregator,file:///usr/share/applications/dolphin-emu.desktop?wmClass=Dolphin-emu,file:///usr/share/applications/kde4/dolphin.desktop?wmClass=Dolphin
Comment 7 Craig Drummond 2012-07-12 19:57:47 UTC
This is very interesting. Everything looks ok. Does it also happen in plasmoidviewer? e.g. run

    plasmoidviewer icontasks

This allows you to run just icontasks. Does it happen if dolphin-emu is *before* dolphin in the list of launchers?
Comment 8 Eyad 2012-07-12 20:50:40 UTC
Yes, the same thing happens in plasmoidviewer. 

Also, dolphin-emu is installed systemwide. The binary is /usr/bin/dolphin-emu

Does IconTasks have a problem with the hyphen?
Comment 9 Craig Drummond 2012-07-12 20:54:50 UTC
Can you try using the standard taskbar in plasmoidviewer? You can create launchers in there. If this also has the problem, then it lies in libtaskmanager.
Comment 10 Eyad 2012-07-12 23:19:31 UTC
The problem does exist in the standard taskmanager. Should I file a new bug report against libtaskmanager? Since my distro does not have a 4.8.4 release would you like me try their 4.8.7 packages?
Comment 11 Gatoso 2012-07-14 23:40:06 UTC
Sorry by late answer

By running xprop | grep WM_CLASS, for dolphin the file manager I get:

WM_CLASS(STRING) = "dolphin", "Dolphin"

for dolphin the emulator I get:

WM_CLASS(STRING) = "dolphin-emu", "Dolphin-emu"

By adding an exception rule for dolphin the emulator, the trouble is not solved. I have attached an image related to it.

I don't have the folder /.kde/share/config/, in share folder just I see another one called applnk and inside of it I have these files: regnum-program.desktop  regnum-uninstall.desktop  regnum-url.desktop

I have the same trouble running "plasmoidviewer icontasks" and adding first a dolphin-emu launcher and after a dolphin launcher.
Comment 12 Gatoso 2012-07-14 23:43:01 UTC
Created attachment 72529 [details]
Launcher matching rules for dolphin emulator
Comment 13 Craig Drummond 2012-07-21 09:06:46 UTC
Just to let you know that I have not forgotten about this bug. However, I will be on holiday for the next two weeks - so this probably won't get fixed for 4.9

As I can't reproduce this bug here, would it be OK if I created a standalone icon-tasks install (and libtaskmanager) with LOTS of debug enabled? I can then send this to you, so that I can try and see where the error lies?
Comment 14 Gatoso 2012-07-22 02:15:45 UTC
Sure, no problem. By the way, what does mean LTOS?

Thank you for your concern.
Comment 15 Craig Drummond 2012-07-22 20:14:01 UTC
LTOS??? I said "with LOTS of debug " i.e  "with lots of debug" (emphasizing the lots)
Comment 16 Craig Drummond 2012-08-27 19:34:03 UTC
Git commit 44900b77e18ac59fdd9687b957330765cd748db9 by Craig Drummond.
Committed on 27/08/2012 at 20:59.
Pushed by craig into branch 'KDE/4.8'.

Don't associate an app to a launcher if both have valid but different launcher URLs.

M  +9    -5    libs/taskmanager/launcheritem.cpp

http://commits.kde.org/kde-workspace/44900b77e18ac59fdd9687b957330765cd748db9
Comment 17 Craig Drummond 2012-08-27 19:34:03 UTC
Git commit c493055a052d72ab7f8a90940346712b559a5049 by Craig Drummond.
Committed on 27/08/2012 at 21:30.
Pushed by craig into branch 'KDE/4.9'.

Don't associate an app to a launcher if both have valid but different launcher URLs.

M  +9    -5    libs/taskmanager/launcheritem.cpp

http://commits.kde.org/kde-workspace/c493055a052d72ab7f8a90940346712b559a5049
Comment 18 Craig Drummond 2012-08-27 19:34:04 UTC
Git commit 50fded0b644c21b0dea8746e23643dbac23d3143 by Craig Drummond.
Committed on 27/08/2012 at 21:33.
Pushed by craig into branch 'master'.

Don't associate an app to a launcher if both have valid but different launcher URLs.

M  +9    -5    libs/taskmanager/launcheritem.cpp

http://commits.kde.org/kde-workspace/50fded0b644c21b0dea8746e23643dbac23d3143
Comment 19 dolphinuser1 2016-01-25 01:29:55 UTC
(In reply to Gatoso from comment #0)
> Dolphin emulator is an open source emulator for gamecube and wii games, its
> web site is: http://dolphin-emulator.com

That is not the official Dolphin website. The official site is: https://dolphin-emu.org/