Skip to content

Bundle themes #60

Closed
Closed

Description

@probonopd

Should we do `cp -a "${QT_PLUGIN_PATH}/platformthemes"?

Activity

  1. vadi2 commented on Feb 12, 2017

    @vadi2

    If this means my Qt application will look more native on a GTK sytem - yes, definitely.

  2. probonopd commented on Feb 12, 2017

    @probonopd
    OwnerAuthor

    Which of the platformthemes are the "standard" ones and should be copied in? Can you send a PR?

  3. vadi2 commented on Feb 19, 2017

    @vadi2

    I don't see such a folder in my Qt installation. I can't send a pr in, sorry.

  4. revast commented on Sep 26, 2017

    @revast

    libqgtk2.so to have a gtk look on qt5

  5. revast commented on Sep 26, 2017

    @revast

    You would need all plugins I would say. Plus QT_PLUGIN_PATH}/styles

    Now there is a bit of a chicken and egg situation here. If you just add the ones which are installed on the machine the appimage gets packed, you will miss out some which are installed on the target system. You cannot guess which style/theme is used on the target systems. So if you do not ship with all, the appimage will look like an alien in some target systems.

    So I guess its the best to have a list of all possible qt5 styles' and themes' .so files beforehand (the most common, I count 8 at archlinux wiki), and compare these with the ones installed in the qt5 installation of the machine the appimage gets packed, and then inform/warn the user of the fact that if he does not have all the platformthemes and styles installed in his plugins folder, that his app will not look right in different target systems.

    If applicable, it would be wise to host these plugins here on github, (for each qt version I guess - or maybe one set of .so's work across more than one version/qtbase-abi...?), and insert them automatically.

    Or provide a quick apt-get install or yum install list suggestion depending on the distro linuxdeployqt is run on, or maybe ask the user if linuxdeployqt itself should install these themes/styles via package system before building the appimage.

  6. TheAssassin commented on Sep 26, 2017

    @TheAssassin
    Collaborator

    Can't Qt be made look for platform themes in one place and the rest in another? How do they solve it on Windows/macOS?

  7. probonopd commented on Sep 29, 2017

    @probonopd
    OwnerAuthor

    It is super important never to mix Qt versions. So if we bundle Qt (which we do) we must make sure that Qt themes are never loaded from the system or else we will crash. Check out the Krita AppImage, it ships with a dark Qt theme.

  8. revast commented on Sep 30, 2017

    @revast

    never loaded from the system or else we will crash.

    I suspected that.

    The way to solve it, from my point of view, is to ship the themes and styles, with ALL their dependencies, that is, you also will need to package GTK it you plan to also support libqgtk2.so (and related) themes.

    That is for sure overkill for the average user, but some definitely strive to have a consistent desktop experience for their Apps, and a Dark theme does not necessarily help there.

    What would be nice from a user perspective would be to have a possibility to ship the themes with all the dependencies if demanded, e.g. through an extra flag, and that the User is being hinted/warned that when generating the Appimage as it happens now, theme inconsistencies are gonna happen.

  9. probonopd commented on Oct 1, 2017

    @probonopd
    OwnerAuthor

    you also will need to package GTK

    No, since we consider Gtk+2 to be ABI stable and part of each target system.

    So we would "only" have to bundle all Qt-GTK parts (libraries, plugins, themes, whatever is needed), if a certain extra flag was specified.

    PR welcome!

  10. revast commented on Oct 3, 2017

    @revast

    libgtk2.0 is part of a kde-based distro?

    ok, here are the dependecies of the platformthemes and styles:

    libqgtk2.so
    libqgtk2style.so
    NEEDED libgtk-x11-2.0.so.0
    NEEDED libgdk-x11-2.0.so.0
    NEEDED libgdk_pixbuf-2.0.so.0
    NEEDED libpango-1.0.so.0
    NEEDED libgobject-2.0.so.0
    NEEDED libglib-2.0.so.0
    NEEDED libX11.so.6
    NEEDED libQt5Widgets.so.5
    NEEDED libQt5Gui.so.5
    NEEDED libQt5Core.so.5
    NEEDED libstdc++.so.6
    NEEDED libm.so.6
    NEEDED libc.so.6

    libqcleanlooksstyle.so
    libqmotifstyle.so
    libqplastiquestyle.so
    NEEDED libQt5Widgets.so.5
    NEEDED libQt5Gui.so.5
    NEEDED libQt5Core.so.5
    NEEDED libstdc++.so.6
    NEEDED libm.so.6
    NEEDED libc.so.6

    breeze.so
    qtcurve.so
    NEEDED libqtcurve-utils.so.2
    NEEDED libKF5KDELibs4Support.so.5
    NEEDED libKF5XmlGui.so.5
    NEEDED libQt5PrintSupport.so.5
    NEEDED libKF5IconThemes.so.5
    NEEDED libQt5Svg.so.5
    NEEDED libKF5ConfigWidgets.so.5
    NEEDED libKF5GuiAddons.so.5
    NEEDED libKF5WidgetsAddons.so.5
    NEEDED libKF5WindowSystem.so.5
    NEEDED libKF5ConfigCore.so.5
    NEEDED libQt5DBus.so.5
    NEEDED libQt5X11Extras.so.5
    NEEDED libQt5Widgets.so.5
    NEEDED libQt5Gui.so.5
    NEEDED libQt5Core.so.5

    oxygen.so
    NEEDED libKF5Style.so.5
    NEEDED libKF5WindowSystem.so.5
    NEEDED liboxygenstyle5.so.5
    NEEDED libxcb.so.1
    NEEDED libKF5WaylandClient.so.5
    NEEDED libKF5ConfigWidgets.so.5
    NEEDED libKF5GuiAddons.so.5
    NEEDED libQt5X11Extras.so.5
    NEEDED libKF5ConfigGui.so.5
    NEEDED libKF5ConfigCore.so.5
    NEEDED libQt5Widgets.so.5
    NEEDED libQt5DBus.so.5
    NEEDED libQt5Gui.so.5
    NEEDED libQt5Core.so.5
    NEEDED libstdc++.so.6
    NEEDED libm.so.6
    NEEDED libc.so.6

    so for breeze, qtcurve, oxygen as default, one would have to ship parts of kde libs...

    I now query the QT_QPA_PLATFORMTHEME variable of the system and then set the theme accordingly. But doing so, on a system where QT_QPA_PLATFORMTHEME is set to gtk2, and with the gtk2 platformtheme and style installed, results in this error (vanilla xubuntu 17.10 daily image)

    
    QGtkStyle could not resolve GTK. Make sure you have installed the proper libraries.
    QCommonStyle::drawComplexControl: Control 1 not handled
    

    as well as this appearance:

    1

    instead of

    2

    If I try to install the qt5-gtk-platformtheme plugin via debian package in xubuntu 17.10, it shows these dependencies

    
    libdouble-conversion1 libqt5core5a libqt5dbus5 libqt5gui5 libqt5network5
      libqt5widgets5 libxcb-icccm4 libxcb-image0 libxcb-keysyms1
      libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1
      libxkbcommon-x11-0 qt5-gtk-platformtheme
    
    
    
  11. probonopd commented on Oct 3, 2017

    @probonopd
    OwnerAuthor

    Try running with LD_DEBUG=libs your.AppImage to see what is being loaded and what fails to load.

  12. revast commented on Oct 4, 2017

    @revast

    https://pastebin.com/8bUR910v
    notably, I have a
    /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: error: symbol lookup error: undefined symbol: hb_font_funcs_set_variation_glyph_func (fatal)

    and it tries to find all the libs I get when installing libgnomeui-0, that is

    libbonobo2-0 libbonobo2-common libbonoboui2-0 libbonoboui2-common libglade2-0 libgnome-2-0 libgnome-keyring-common libgnome-keyring0 libgnome2-common libgnomecanvas2-0 libgnomecanvas2-common libgnomeui-0 libgnomeui-common libgnomevfs2-0 libgnomevfs2-common liborbit-2-0

    I found elsewhere this answer to install libgnomeui-0 when searching for a solution to "could not resolve GTK".
    So note: while xfce is a GTK-based desktop, it did NOT have the necessary libs shipped!

    Obviously, when I try to install these on the target system via package-manager, the app tries to link against them, which results in a segfault. So I am not entirely shure about ABI stability helps here. So you will have to ship all these libs in the appimage for proper theming. You will have to rethink that anyways if you get kde-based themes into play, as well as qt5.8+ switching the theme /style plugins to gtk3...
    Does not seem to be a trivial task, also given the fact that the machine where the appimage gets created would need to have all these installed..

  13. probonopd commented on Oct 4, 2017

    @probonopd
    OwnerAuthor

    I'm asking myself whether it's a good idea to depend on GNOME when all we (probably) really want is to render in Gtk+ 2.

    What exactly pulls in libgnomeui-0?

  14. 26 remaining items

  15. simoniz0r commented on Dec 29, 2017

    @simoniz0r
  16. probonopd commented on Dec 29, 2017

    @probonopd
    OwnerAuthor

    Strange. We still don't know why it is behaving so differently with different system/Qt combinations.

  17. simoniz0r commented on Dec 29, 2017

    @simoniz0r

    Like I said before, the only Qt AppImages that follow my system theme are applications that have been built with GTK support and have an option to switch to GTK based theming. No other Qt AppImages follow my system theme.

  18. probonopd commented on Dec 29, 2017

    @probonopd
    OwnerAuthor

    applications that have been built with GTK support

    How does one do that?

  19. simoniz0r commented on Dec 29, 2017

    @simoniz0r

    Sorry, no idea on that one; I'm not a Qt dev... You might try asking someone like CDrummond who works on Cantata or the qxgedit developer.

  20. probonopd commented on Jan 20, 2019

    @probonopd
    OwnerAuthor

    What do people think of
    https://github.com/CrimsonAS/gtkplatform?

    gtkplatform is a Qt Platform Abstraction plugin providing Qt applications with the capability to use gtk+ as a host toolkit, primarily intended for use on Linux desktops.

    That is: it lets Qt applications render with native gtk+ menus, and use gtk+ for input (mouse, keyboard, touch), and getting window content on screen, the same as it uses e.g. cocoa on macOS for instance.

    Unfortunately it seems to be using the more complex and "moving target" Gtk+ 3 rather than the mature Gtk+ 2.

  21. vadi2 commented on Jan 20, 2019

    @vadi2

    Tried it out and it didn't work: CrimsonAS/gtkplatform#23

    GTK+ 2 isn't mature btw, it's deprecated - the last release was 8 years ago. An application using GTK+ 2 now would look out of place in a modern desktop.

  22. probonopd commented on Jan 21, 2019

    @probonopd
    OwnerAuthor

    According to https://askubuntu.com/a/910143,

    The problem has occurred since Qt5.7. In this release, the GTK2 platform theme and style was removed and replaced with the GTK3 platform theme. I've recently been in discussion with the Qt developers and it appears there isn't a GTK3 style to complement the platform theme and there are currently no plans to implement this in the future.

    So, bundle the GTK2 platform theme and style?

  23. probonopd commented on Jan 21, 2019

    @probonopd
    OwnerAuthor

    Yes, that does the trick:

    ########################################################################
    # https://askubuntu.com/a/910143
    # https://askubuntu.com/a/748186
    # At runtime, export QT_QPA_PLATFORMTHEME=gtk2 (Xfce does it automatically)
    ########################################################################
    
    apt-get update
    apt-get -y install libgtk2.0-dev
    git clone http://code.qt.io/qt/qtstyleplugins.git
    cd qtstyleplugins
    qmake
    make -j$(nproc)
    make install 
    cd -
    
    (...)
    
    linuxdeployqt (...) -extra-plugins=platformthemes/libqgtk2.so,styles/libqgtk2style.so
    
  24. Vanuan commented on Feb 20, 2023

    @Vanuan

    As the AppImageKit issue closed, what's the status on this one?

    Can platformthemes be bundled and how to make sure the version is compatible with the host version? Specifically QGnome

  25. probonopd commented on Feb 20, 2023

    @probonopd
    OwnerAuthor

    The issue is that if you bundle QGnome, then you need to bundle all of its dependencies, too - since you can't assume Gnome to be present on all systems. And in practice, this can lead to all kinds of difficulties.

    So over the years the contributors in this project have come to the conclusion that it's not worth the effort, but ymmv. You'd have to use another tool for that, though.

  26. Vanuan commented on Feb 24, 2023

    @Vanuan

    @probonopd I think you're confusing Qt platform themes with desktop environments. QGnomePlatform theme is quite lightweight and doesn't require any GNOME dependencies.

    • It is more a part of Qt rather than GNOME, so it depends on Qt.
    • It does depend on Gtk3 though
    • It also depends on gsettings schemas which is a small XML file it uses to get desktop settings over dbus which is a part of Qt.
    • There's also Adwaita-Qt which only depends on Qt

    As you can see, there's nothing whatsoever that involves any of GNOME libraries other than Gtk3. And if Gtk3 is not present on target system, the platform plugin would just not load, so noop.

    What difficulties you're talking about?

  27. probonopd commented on Feb 24, 2023

    @probonopd
    OwnerAuthor

    And if Gtk3 is not present on target system, the platform plugin would just not load, so noop.

    if that is how it works, then it's good. But I remember that back in the time when we bundled Gtk Qt platform themes, we eventually ran into issues that made us decide it was not worth keeping them.

    If you are interested in the details:
    AppImageCommunity/AppImageUpdate#150

  28. Vanuan commented on Feb 25, 2023

    @Vanuan

    @probonopd It looks like the issue is not that Gtk is not present, but that it is loaded from the system and has incompatibility issues. Either it's a configuration issue or a binary incompatibility with bundled libraries. That's indeed a valid issue. Typically, AppImage doesn't load libraries and resources from the system. So this issue is not specific to the platform themes, but to any library that is loaded by AppImage from the system. Are there successful examples where AppImage loads a *.so from the system and it works?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions