Bug 408953 - Can't pin GIMP launcher (flatpak)
Summary: Can't pin GIMP launcher (flatpak)
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.15.5
Platform: Other Linux
: NOR minor
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-20 14:02 UTC by Diego Marino
Modified: 2019-06-21 16:56 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Launcher icon screenshot (8.30 KB, image/png)
2019-06-20 14:02 UTC, Diego Marino
Details
GIMP double entry (22.46 KB, image/png)
2019-06-21 09:32 UTC, Diego Marino
Details
GIMP .desktop file (14.41 KB, application/x-desktop)
2019-06-21 09:45 UTC, Diego Marino
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Marino 2019-06-20 14:02:15 UTC
Created attachment 121033 [details]
Launcher icon screenshot

SUMMARY
I'm unable to pin the GIMP (flatpak) launcher to a dock. If I click "pin", it does not happen anything.
The launcher icon is low-res too and it does not follow the icon theme used in the system.

STEPS TO REPRODUCE
1. Install and launch GIMP from flatpak.
2. Try to pin it to a dock

OBSERVED RESULT
The launcher is not pinned.

EXPECTED RESULT
The launcher is pinned.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Fedora 30
(available in About System)
KDE Plasma Version: 5.15.5https://www.gimp.org/downloads/
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.1

ADDITIONAL INFORMATION
Attached a screenshot of the low-res launcher icon.
I don't know if it is a flatpak issue or a KDE/latte one.
Comment 1 Michail Vourlakos 2019-06-20 14:03:50 UTC
Plasma related...
Can you do this in a plasma panel/taskmanager?
Comment 2 Diego Marino 2019-06-20 14:12:08 UTC
(In reply to Michail Vourlakos from comment #1)
> Plasma related...
> Can you do this in a plasma panel/taskmanager?

Mmh, no. Should I report it in the plasma section?
Comment 3 Michail Vourlakos 2019-06-20 14:16:03 UTC
yep
Comment 4 Diego Marino 2019-06-20 14:31:46 UTC
EDIT: screenshot is from Latte Dock, same behavior is observed on Plasma panels. The launcher is not pinnable, the icon changes to a low-res one instead of following the system icon theme.
Comment 5 Nate Graham 2019-06-21 08:52:47 UTC
How are you pinning it?
1. Find it in Kicker/Kickoff/etc > right-click on its entry > click "Pin to Task Manager"
2. Open GIMP > right-click on its icon on Task Manager/Latte Dock > click "Pin"

If one of those methods doesn't work, does the other one work?
Comment 6 Diego Marino 2019-06-21 09:31:56 UTC
(In reply to Nate Graham from comment #5)
> How are you pinning it?
> 1. Find it in Kicker/Kickoff/etc > right-click on its entry > click "Pin to
> Task Manager"
> 2. Open GIMP > right-click on its icon on Task Manager/Latte Dock > click
> "Pin"
> 
> If one of those methods doesn't work, does the other one work?

1. It works but it creates a new entry when you launch it (see attached screenshot)
2. It does not work. And it is the only way to pin it to Latte Dock, as far as I can tell.
Comment 7 Diego Marino 2019-06-21 09:32:27 UTC
Created attachment 121048 [details]
GIMP double entry
Comment 8 Eike Hein 2019-06-21 09:38:13 UTC
Please

- Attach the .desktop file for GIMP
- run `xprop` from a terminal, click the gimp window and post the output
Comment 9 Diego Marino 2019-06-21 09:45:52 UTC
Created attachment 121049 [details]
GIMP .desktop file

(In reply to Eike Hein from comment #8)
> Please
> 
> - Attach the .desktop file for GIMP
> - run `xprop` from a terminal, click the gimp window and post the output

NET_WM_ICON_GEOMETRY(CARDINAL) = 1291, 1079, 64, 1
_NET_WM_ALLOWED_ACTIONS(ATOM) = _NET_WM_ACTION_MOVE, _NET_WM_ACTION_RESIZE, _NET_WM_ACTION_MINIMIZE, _NET_WM_ACTION_SHADE, _NET_WM_ACTION_MAXIMIZE_VERT, _NET_WM_ACTION_MAXIMIZE_HORZ, _NET_WM_ACTION_FULLSCREEN, _NET_WM_ACTION_CHANGE_DESKTOP, _NET_WM_ACTION_CLOSE
_KDE_NET_WM_FRAME_STRUT(CARDINAL) = 0, 0, 37, 0
_NET_FRAME_EXTENTS(CARDINAL) = 0, 0, 37, 0
_NET_WM_DESKTOP(CARDINAL) = 3
_KDE_NET_WM_ACTIVITIES(STRING) = "d1709edb-3118-4947-8a46-fc0827a49aaa"
WM_STATE(WM_STATE):
                window state: Normal
                icon window: 0x0
_NET_WM_STATE(ATOM) = _NET_WM_STATE_BELOW
WM_HINTS(WM_HINTS):
                Client accepts input or input focus: True
                Initial state is Normal State.
                bitmap id # to use for icon: 0x82000f1
                bitmap id # of mask for icon: 0x82000f2
                window id # of group leader: 0x8200001
XdndAware(ATOM) = BITMAP
_MOTIF_DRAG_RECEIVER_INFO(_MOTIF_DRAG_RECEIVER_INFO) = 0x6c, 0x0, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x0, 0x0
_KDE_NET_WM_USER_CREATION_TIME(CARDINAL) = 6419256
_NET_WM_ICON(CARDINAL) =        Icon (48 x 48):

WM_WINDOW_ROLE(STRING) = "gimp-image-window-1"
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 136315101
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_USER_TIME(CARDINAL) = 6424626
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x82000dc
WM_CLIENT_LEADER(WINDOW): window id # 0x8200001
_NET_WM_PID(CARDINAL) = 2
WM_LOCALE_NAME(STRING) = "C"
WM_CLIENT_MACHINE(STRING) = "T460-Fedora"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                user specified location: 0, 0
                program specified minimum size: 575 by 607
                window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "gimp-2.10", "Gimp-2.10"
WM_ICON_NAME(STRING) = "GNU Image Manipulation Program"
_NET_WM_ICON_NAME(UTF8_STRING) = "GNU Image Manipulation Program"
WM_NAME(STRING) = "GNU Image Manipulation Program"
_NET_WM_NAME(UTF8_STRING) = "GNU Image Manipulation Program"
Comment 10 Eike Hein 2019-06-21 09:48:15 UTC
Thanks, I can see what's going on. We'll put a fix into the next release.
Comment 11 Eike Hein 2019-06-21 09:49:43 UTC
Patch https://phabricator.kde.org/D21954
Comment 12 Eike Hein 2019-06-21 10:04:29 UTC
Fixed by 96655354961d
Comment 13 Diego Marino 2019-06-21 10:09:31 UTC
Editing /etc/xdg/taskmanagerrulesrc is not sufficient, isn'it? Still learning, guess the entire library has to be rebuilt?
Comment 14 Eike Hein 2019-06-21 10:53:35 UTC
It's sufficient to edit the file, but you might have to unpin and re-pin the app after (because without this rule, the "what app owns this window" code will have taken a fallback path that pinned the executable, sort of, which means the launcher still won't match the reidentified window).
Comment 15 Diego Marino 2019-06-21 11:00:24 UTC
(In reply to Eike Hein from comment #14)
> It's sufficient to edit the file, but you might have to unpin and re-pin the
> app after (because without this rule, the "what app owns this window" code
> will have taken a fallback path that pinned the executable, sort of, which
> means the launcher still won't match the reidentified window).

Mh, I edited the file, and I tried logging out, rebooting, removing and adding a new panel, and I still observe the same behavior. The launcher is not pinnable if it is already running, and if I pin it from the application launcher the entry is duplicated.
Comment 16 Diego Marino 2019-06-21 11:02:08 UTC
Plus, is this patch going to fix all of these quirks, or just the duplicated icon when launched?
Comment 17 Eike Hein 2019-06-21 12:21:04 UTC
It should address all of them.

Of course a better fix would be Gimp not being a shit. :)
Comment 18 Diego Marino 2019-06-21 15:54:45 UTC
I'm sorry, are you sure the patch works with the flatpak? The repo version works fine now, the flatpak is still broken.
Comment 19 Diego Marino 2019-06-21 16:09:27 UTC
As a workaround, I tried using the repo gimp.desktop file editing the Exec line with

Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=gimp-2.10 --file-forwarding org.gimp.GIMP @@u %U @@

taken from its flatpak org.gimp.GIMP.desktop file, and it works fine now.
Comment 20 Eike Hein 2019-06-21 16:50:22 UTC
The Flatpak maybe has a different .desktop file name than the one you attached earlier?
Comment 21 Diego Marino 2019-06-21 16:56:56 UTC
Flatpak desktop filename is org.gimp.GIMP, but it contains these lines at the end of it:

X-Flatpak-RenamedFrom=gimp.desktop;
X-Flatpak-Tags=stable;
X-Flatpak=org.gimp.GIMP