flathub / org.libreoffice.LibreOffice

https://flathub.org/apps/details/org.libreoffice.LibreOffice
29 stars 18 forks source link

Base, Calc, Draw and Impress show wrong icon in KDE Plasma task switcher (alt+tab menu) #19

Open glaubersm opened 6 years ago

glaubersm commented 6 years ago

Hi I use libreoffice installed from flathub on Arch Linux, KDE Plasma 5.12.2.

Set the Plasma Large Icons style for the Task Switcher (System Settings > Window Management > Task Switcher > Main > Large icons)

libreoffice

stbergmann commented 6 years ago

And a Writer window would show the correct icon (i.e., the generic LO document icon that the LO flatpak version uses for all types of app windows)?

glaubersm commented 6 years ago

Same problem affects writer and math, but intermittently.. Sometimes they show correct icon.

stbergmann commented 6 years ago

What is "correct icon" for you on KDE? (I only have GNOME to test here right now, and assume that the flatpak'ed LO will always use the generic white-empty-document-with-earmark LO icon, but may be wrong, and what you see on KDE---when it works---is e.g. the blue-text-and-picture-document-with-earmark Writer icon.)

glaubersm commented 6 years ago

When writer flatpak works I see a blue icon, math shows a dark grey icon.

Following gif shows the icons of LO 6.0.1 installed from Arch repositories. I think these icons are correct. libreoffice

stbergmann commented 6 years ago

Yes, I meanwhile clarified that LO always showing the generic white-empty-document-with-earmark icon for all kinds of windows (be they Writer, Calc, ... windows) is specific to LO running on GNOME/GTK3. So on KDE you should presumably see specific icons for the different types of LO windows, as you demonstrate with your second gif. (The icon theme included in the LO flatpak is different from the theme apparently used on Arch, so the icons would look rather different, but should still be different icons for different types of LO windows.) The LO flatpak just bundles the hicolor icons in the various sizes (.png for 16x16, 32x32, 48x48, 128x128, 256x256, 512x512; and .svg for scalable) that the upstream LO sources include (under sysui/desktop/icons/hicolor/*/apps/). However, I see that the 512x512 dir (in the upstream LO sources and in the LO flatpak) only contains a generic main.png (the white-empty-document-with-earmark icon), not also the base/calc/draw/impress/math/startcenter/writer icons like the other dirs. I'm not sure whether that's related to the issue you observe.

glaubersm commented 6 years ago

LO from Arch repositories uses breeze icon theme. I compared LO 6.0.1 installed via flatpak and via DEB packages on Neon distribution. LO flatpak + breeze icon theme lo flatpak breeze

LO DEB + breeze icon theme lo deb breeze

glaubersm commented 6 years ago

There seems to be some problem between LO flatpak and breeze icon theme.

stbergmann commented 6 years ago

"The LO flatpak just bundles the hicolor icons in the various sizes (.png for 16x16, 32x32, 48x48, 128x128, 256x256, 512x512; and .svg for scalable) that the upstream LO sources include (under sysui/desktop/icons/hicolor/*/apps/). However, I see that the 512x512 dir (in the upstream LO sources and in the LO flatpak) only contains a generic main.png (the white-empty-document-with-earmark icon), not also the base/calc/draw/impress/math/startcenter/writer icons like the other dirs. I'm not sure whether that's related to the issue you observe." Looks like I was confused and the above can be ignored. It is about the "application icons" (that "app choosers" like GNOME Software display), not about individual windows' icons which this issue is apparently about.

Pointedstick commented 6 years ago

The non-Flatpak Large Icons Task Switcher icons that LO displays (visible in the above gifs) are themselves wrong; see https://bugs.documentfoundation.org/show_bug.cgi?id=65754

The underlying issue for non-Flatpak is a KWin bug/design decision that makes it query the window for the icon to use; LO specifies terrible, low-res icons, so KWin uses them.

I'm not familiar with how Flatpak apps hint window/app icons to KWin, but maybe the above can assist in the investigation.

ramcq commented 6 years ago

@stbergmann I believe this is due to the export process only placing the LO app icons in the /app/share/icons icon theme path with their app-id (org.libreoffice.LibreOffice-foo) names and not the original libreoffice-foo names. It seems LO itself, at least in some parts (maybe widget set / desktop integration code), expects the icon theme to contain the libreoffice-foo app icons with their original names. This is pretty common in Flatpak - flatpak-builder has "copy-icon" for this reason.

We can reproduce this partly on my GNOME-based Endless system - I see on the Flatpak'd Writer that the window icon (in the top left) is the Gtk+ "missing icon" rather than the writer icon. This fixes it on my system: ramcq@upsilon:/var/lib/flatpak/app/org.libreoffice.LibreOffice/current/active/files/share/icons/hicolor$ for i in *; do sudo ln -rs $i/apps/org.libreoffice.LibreOffice-writer.png $i/apps/libreoffice-writer.png; done

I think the assemble-flatpak.sh (here https://cgit.freedesktop.org/libreoffice/core/tree/solenv/bin/assemble-flatpak.sh#n36) should copy the LO icons into the /app/share/icons folder with their original libreoffice-foo name as well as the org.libreoffice.LibreOffice-foo name. The duplicates will be linked together by Flatpak anyway.

DinizBortolotto commented 5 years ago

Hi people! Same problem here with Slackware and LibreOffice built with SlackBuild packages. Trying to reproduce/fix the problem like @ramcq did I keept Writer icons untouched and created symbolic links to Calc. See below:

Libreoffice_icon_error_1

Libreoffice_icon_error_2

After that opened both and got the results below in task bar and when switching:

Libreoffice_icon_error_3 Libreoffice_icon_error_4 Libreoffice_icon_error_5

stbergmann commented 5 years ago

Oops, no idea why the suggested fix by @ramcq had fallen through the cracks. Will implement that now.

stbergmann commented 5 years ago

...but upon looking closer now, I'm confused:

First, @ramcq: It appears you implemented the suggestion from your above Apr 26, 2018 comment as part of https://github.com/flathub/org.libreoffice.LibreOffice/commit/945f6caad87658b1df1e8918bd5f64939058ab7f "clean up desktop integration" (though by copying instead of symlinking): The LO flatpak contains now in addition to e.g. /app/share/icons/hicolor/16x16/apps/org.libreoffice.LibreOffice.writer.png also /app/share/icons/hicolor/16x16/apps/libreoffice-writer.png. According to your above comment, that should have fixed this issue, right? If yes, any reason you did not close this issue then?

Second, @DinizBortolotto: If I understand you correctly, you claim that you need to add symlinks not in the LO flatpak image but in the host system, from e.g. /usr/share/icons/hicolor/16x16/apps/libreoffice-writer.png to the existing /usr/share/icons/hicolor/16x16/apps/libreoffice6.2-writer.png, right? I would have no idea what part of your system put the existing /usr/share/icons/hicolor/16x16/apps/libreoffice6.2-writer.png there (maybe that's from your Linux distro's LO version?), why creating those symlinks in your host /usr/share/icons would be necessary for the LO flatpak, nor how the LO flatpak could cause those symlinks to be created.

DinizBortolotto commented 5 years ago

Second, @DinizBortolotto: If I understand you correctly, you claim that you need to add symlinks not in the LO flatpak image but in the host system, from e.g. /usr/share/icons/hicolor/16x16/apps/libreoffice-writer.png to the existing /usr/share/icons/hicolor/16x16/apps/libreoffice6.2-writer.png, right? I would have no idea what part of your system put the existing /usr/share/icons/hicolor/16x16/apps/libreoffice6.2-writer.png there (maybe that's from your Linux distro's LO version?), why creating those symlinks in your host /usr/share/icons would be necessary for the LO flatpak, nor how the LO flatpak could cause those symlinks to be created.

Yep, you're right @stbergmann. I made those adjusts in the "host side", not in LO flatpaks.

The "sources" that SlackBuild Script uses are from the tarball with the RPMs downloaded from https://download.documentfoundation.org/libreoffice/stable/6.2.4/rpm/x86_64/LibreOffice_6.2.4_Linux_x86-64_rpm.tar.gz

To clarify, the SlackBuild Script (attached) basically do the steps below:

  1. Extracts the downloaded tarball - tar xvf $CWD/$TARNAME -C $TMP
  2. Extracts every RPM content - for FILE in *.rpm ; do rpm2cpio < $FILE | cpio -imdv ; done
  3. Moves opt and usr to the _packagedir - mv opt usr $PKG
  4. Create the Slackware Package from _packagedir - /sbin/makepkg -l y -c n $OUTPUT/libreoffice-6.2.4-x86_64-2_SBo.tgz

libreoffice.SlackBuild.txt