elementary / dock

A quick app launcher and window switcher for Pantheon and elementary OS
https://elementary.io
GNU General Public License v3.0
88 stars 23 forks source link

MPV flatpak icon is low res #119

Closed DanyGee closed 3 years ago

DanyGee commented 3 years ago

What Happened

MPV video player installed as flatpak launches as two icons, one hi-res and one low-res. Low-res one is the active one. Screenshot from 2021-08-11 08 42 50@2x

After couple of seconds, the hi-res one disappears and the low-res one stays. Screenshot from 2021-08-10 20 43 41@2x

Expected Behavior

MPV should launch as one hi-res icon. (this actually works for MPV installed with apt) Screenshot from 2021-08-11 11 28 27@2x

Steps to Reproduce

  1. Install mpv from flathub.
  2. Launch any video with it.

Platform Information

System:    Kernel: 5.11.0-25-generic x86_64 bits: 64 compiler: N/A Desktop: Pantheon Distro: elementary OS 6 Odin 
Machine:   Type: Desktop Mobo: ASUSTeK model: Z170-DELUXE v: Rev 1.xx serial: <filter> UEFI: American Megatrends v: 3801 
           date: 03/14/2018 
Battery:   Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master 3 charge: 100% (should be ignored) 
           status: Discharging 
CPU:       Topology: Quad Core model: Intel Core i7-6700K bits: 64 type: MT MCP arch: Skylake-S rev: 3 L2 cache: 8192 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 63999 
           Speed: 1200 MHz min/max: 800/4300 MHz Core speeds (MHz): 1: 1022 2: 3108 3: 800 4: 800 5: 3235 6: 1489 7: 800 
           8: 800 
Graphics:  Device-1: NVIDIA GP104 [GeForce GTX 1080] vendor: ASUSTeK driver: nvidia v: 470.57.02 bus ID: 01:00.0 
           Display: x11 server: X.Org 1.20.11 driver: nvidia unloaded: fbdev,modesetting,nouveau,vesa 
           resolution: 3840x2160~60Hz 
           OpenGL: renderer: NVIDIA GeForce GTX 1080/PCIe/SSE2 v: 4.6.0 NVIDIA 470.57.02 direct render: Yes 
Audio:     Device-1: Intel 100 Series/C230 Series Family HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel 
           bus ID: 00:1f.3 
           Device-2: NVIDIA GP104 High Definition Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel bus ID: 01:00.1 
           Device-3: Logitech G733 Gaming Headset type: USB driver: hid-generic,snd-usb-audio,usbhid bus ID: 3-2:2 
           Sound Server: ALSA v: k5.11.0-25-generic 
Network:   Device-1: Intel Ethernet I219-V vendor: ASUSTeK driver: e1000e v: kernel port: f000 bus ID: 00:1f.6 
           IF: enp0s31f6 state: up speed: 1000 Mbps duplex: full mac: <filter> 
           Device-2: Broadcom and subsidiaries BCM4360 802.11ac Wireless Network Adapter vendor: ASUSTeK 
           driver: bcma-pci-bridge v: N/A port: e000 bus ID: 07:00.0 
           Device-3: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: kernel port: c000 bus ID: 0b:00.0 
           IF: enp11s0 state: down mac: <filter> 
Drives:    Local Storage: total: 3.47 TiB used: 38.24 GiB (1.1%) 
           ID-1: /dev/nvme0n1 model: PCIe SSD size: 111.79 GiB 
           ID-2: /dev/nvme1n1 vendor: Western Digital model: WDS100T3X0C-00SJG0 size: 931.51 GiB 
           ID-3: /dev/sda vendor: Samsung model: SSD 850 PRO 256GB size: 238.47 GiB 
           ID-4: /dev/sdb vendor: Samsung model: SSD 850 PRO 1TB size: 953.87 GiB 
           ID-5: /dev/sdc vendor: Crucial model: CT1050MX300SSD1 size: 978.09 GiB 
           ID-6: /dev/sdd vendor: Kingston model: SH100S3120G size: 111.79 GiB 
           ID-7: /dev/sde vendor: SanDisk model: SSD PLUS 240GB size: 223.58 GiB 
           ID-8: /dev/sdf vendor: Kingston model: SV300S37A120G size: 111.79 GiB 
Partition: ID-1: / size: 109.00 GiB used: 38.23 GiB (35.1%) fs: ext4 dev: /dev/sdf2 
Sensors:   System Temperatures: cpu: 29.0 C mobo: N/A gpu: nvidia temp: 52 C 
           Fan Speeds (RPM): N/A gpu: nvidia fan: 0% 
Info:      Processes: 300 Uptime: 3h 18m Memory: 62.75 GiB used: 3.63 GiB (5.8%) Init: systemd runlevel: 5 Compilers: 
           gcc: 9.3.0 Shell: bash v: 5.0.17 inxi: 3.0.38 

Additional Info

MPV dev claims it's not MPV's fault https://github.com/mpv-player/mpv/issues/9109

DanyGee commented 3 years ago

gimp (flatpak) vs inkscape (also flatpak) Screenshot from 2021-08-11 15 34 05@2x

stan-janssen commented 3 years ago

The "solution" for this is to add the following line to /home/USER/.local/share/flatpak/exports/share/applications/io.mpv.desktop:

StartupWMClass=mpv

And then reboot the computer. After that, the icon will no longer be duplicated and the icon will be crisp.

I looked in the flathub/io.mpv.Mpv repository, but could not find how and where the .desktop entry is created.

For example, in the flathub/org.mozilla.Thunderbird repository, there is a .desktop file in there that contains the correct StartupWMClass entry, which was contributed earlier to solve this exact issue.

The same goes, by the way, for the GIMP and InkScape application desktop entries. which need StartupWMClass = gimp-2.10 and Inkscape, respectively.

I'm new to Flatpak packaging, but if anyone can point me in the right direction on this, I'd be happy to contribute the fixes in the correct places.

stan-janssen commented 3 years ago

I created a pull request for the MPV maintainers, in case they'd like to include it: https://github.com/mpv-player/mpv/pull/9111.

avih commented 3 years ago

I created a pull request for the MPV maintainers, in case they'd like to include it: mpv-player/mpv#9111.

Shouldn't this be considered a bad flatpak package?

stan-janssen commented 3 years ago

Shouldn't this be considered a bad flatpak package?

Do you know where to update the .desktop entry in the Flatpak process? If so, we should maybe make this fix there. For now, this is the place I know that fixes this problem, and I don't believe it hurts anyone else, or am I missing something?

avih commented 3 years ago

Do you know where to update the .desktop entry in the Flatpak process?

No, completely unfalimiar with flatpak.

I don't believe it hurts anyone else, or am I missing something?

Not sure, but I think you're right. Though I'll let someone who knows more about freedesktop than myself to comment at the mpv issue.

stan-janssen commented 3 years ago

My pull request was merged. I'm not sure what happens next; do we need to create a new flatpak release?

palob commented 3 years ago

Maybe this script may be of help in this regard to any of you https://github.com/bilelmoussaoui/StartupWMClassFixer

Hasn't been updated in a while though.

cassidyjames commented 3 years ago

I can't reproduce this with mpv from Flathub, and it sounds like the issue may have been upstream in the first place.