Description of problem: I am using xfce and all qt application recently stopped to apply the gtk theme and fall back to a basic qt style. During the startup they print out the message: QGtkStyle was unable to detect the current GTK+ theme. I asked on #qt and they provided me with a little patch, namely to remove line 511 in qgtkstyle_p.cpp: 509 if (themeName.isEmpty()) { 510 qWarning("QGtkStyle was unable to detect the current GTK+ theme."); 511 return; I don't know if this patch would be applicable but it would really enhance the usability of Qt in Xfce, because afaik only Xfce is affected by this. Version-Release number of selected component (if applicable): rpm -qa | grep qt qt-config-4.7.2-8.fc15.x86_64 qt-4.7.2-8.fc15.x86_64 Expected results: Additional info:
I use KDE and gtk applications no longer use qt/kde themes. In F13/F14 gtk apps looked like kde/qt ones. In F15 gtk apps are gtk on kde. I noticed with Firefox, sadly i never reported it because i was busy with other bug-reports.
Re comment #1, this is completely unrelated to this bug report (which is about Qt applications not picking up the correct GTK+ theme, not the opposite), and not a bug at all. Many GTK+ applications in F15 are now gtk3. The oxygen-gtk currently packaged in Fedora 15 is only for gtk2. A GTK+ 3 port is under development, but there is no stable release yet, and it isn't packaged in Fedora yet. In addition, overriding the systemwide default gtk3 theme for KDE Plasma sessions (through kcm-gtk) is not implemented yet either. So you're getting the Adwaita gtk3 theme, which is the only stable one at this time.
I am getting mixed experience. Some applications do pick Adwaita (linguist-qt4), some do not (qmc2, available in RPM Fusion). I am not sure what the difference is.
Could someone who is in charge, please leave a comment on this bug?
I've got some odd/interesting results testing in gnome3 today too: ALT-2: yakuake => kde/oxygen themed in yakuake, run konsole => qgtkstyle'd quit yakuake, start again => qgtkstyle'd wtf.
testing apps on xfce, launched via ALT-F2: konsole -> qgtkstyle qtconfig-qt4 -> qgtkstyle linguist-qt4 -> qgtkstyle qmc2-sdlmess -> mixed qgtkstyle and something else?, maybe this app isn't using standard widgets? anyone experiencing this, can you provide details on which apps your using and see this please?
There was a style-related bug in qmc2 which is fixed in svn. I can make a package if you would like to try.
I use various qt apps in Xfce. So far they are all affected by this. - texmakerx - vlc - recoll - qtconfig-qt4
What do the follfing commands return? $ grep ThemeName ~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml $ grep style ~/.config/Trolltech.conf
$grep ThemeName ~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml <property name="ThemeName" type="string" value="egtk-git"/> <property name="IconThemeName" type="string" value="elementary-mono-dark"/> <property name="SoundThemeName" type="string" value="default"/> <property name="KeyThemeName" type="string" value=""/> <property name="CursorThemeName" type="string" value=""/> $grep style ~/.config/Trolltech.conf usr\lib\kde4\plugins\styles\oxygen.so=40503, 0, i386 linux g++-4 full-config, 2009-12-03T18:30:02 com.trolltech.Qt.QStyleFactoryInterface%3A\usr\lib\kde4\plugins\styles\oxygen.so=2009-12-03T18:30:02, Oxygen style= usr\lib\kde4\plugins\styles\oxygen.so=40601, 0, i386 linux g++-4 full-config, 2010-02-10T16:51:44 usr\lib\kde4\kcm_style.so=40602, 0, i386 linux g++-4 full-config, 2010-02-26T08:45:17 com.trolltech.Qt.QStyleFactoryInterface%3A\usr\lib\kde4\plugins\styles\oxygen.so=2010-02-10T16:51:44, Oxygen The egtk-git version has a gtk-3.0 version. I don't know if this is depending on the used gtk-theme.
$grep style ~/.config/Trolltech.conf usr\lib\kde4\plugins\styles\oxygen.so=40503, 0, i386 linux g++-4 full-config, Means, you've configured oxygen at some point. Try removing ~/.config/Trolltech.conf and see what happens.
Sorry, I should have let you grep for ^style instead of style to filter out the noise. But as you can see you have no have no style selected for qt, otherwise it would return grep ^style ~/.config/Trolltech.conf style=GTK+ Please set the style to GTK+ with qtconfig-qt4 and make sure you have either /usr/share/themes/egtk-git/gtk-2.0/gtkrc or ~/.themes/egtk-git/gtk-2.0/gtkrc.
Alright removed the .conf file and set GTK+ with qtconfig-qt4. $ grep ^style ~/.config/Trolltech.conf style=GTK+ Also the gtkrc files are there: ls -al ~/.themes/egtk-git/gtk-2.0/ total 84 drwxrwxr-x 9 johannes johannes 4096 Jun 3 09:22 . drwxrwxr-x 8 johannes johannes 4096 May 25 18:42 .. drwxrwxr-x 4 johannes johannes 4096 Jun 20 21:43 Apps drwxrwxr-x 2 johannes johannes 4096 Jun 20 21:36 Button -rw-rw-r-- 1 johannes johannes 23038 Jun 3 09:22 gtkrc drwxrwxr-x 2 johannes johannes 4096 Jun 20 21:36 Handle drwxrwxr-x 2 johannes johannes 4096 Jun 20 21:36 Icons drwxrwxr-x 4 johannes johannes 4096 Jun 20 21:36 nautilus -rw-r--r-- 1 johannes johannes 22776 Apr 7 20:24 old_gtkrc drwxrwxr-x 2 johannes johannes 4096 Jun 20 21:36 Range drwxrwxr-x 2 johannes johannes 4096 Jun 20 21:36 Sidebar But the appearance of any newly started qt program looks like before and gives the exact same message as before "QGtkStyle was unable to detect the current GTK+ theme.". btw thanks for your interest
No problem, you are welcome. Can you try another GTK theme for a moment, say Adwaita?
Created attachment 509744 [details] Screenshots of Xfce and Qt applications
Makes no difference as far as I can see.
I've got 'QGtkStyle was unable to detect the current GTK+ theme.' and a lot of messages like below when running Python Qt application: (process:7350): Gtk-CRITICAL **: IA__gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed (process:7350): GnomeUI-CRITICAL **: gnome_icon_lookup: assertion `GTK_IS_ICON_THEME (icon_theme)' failed Is it possible to fix that for everybody?
Yes, my config is Fedora 15 with what I believe is called Gnome 3.
Hmmm, I guess Qt is still looking in GConf for the GTK+ theme to use, but GNOME 3 is using GSettings with dconf to store the setting. Either Qt needs to look in dconf, or (probably the better idea), it should be using the xsettings setting which GNOME sets, which would also allow reacting to theme changes on the fly (if QGtkStyle is able to do that in the first place).
Can somebody report this to upstream Nokia?
That's not only a problem of Gnome but also other DEs so I don't know if this approach will cover other DEs as well. Also I think upstreaming of a bug is mostly the duty of a package maintainer. -johannes
(In reply to comment #20) > Can somebody report this to upstream Nokia? Done. https://bugreports.qt.nokia.com/browse/QTBUG-21294
Could someone please add to the upstream report that this is _not_ only an issue in Gnome3?
(In reply to comment #23) > Could someone please add to the upstream report that this is _not_ only an > issue in Gnome3? It is not hard of course, but it would be better added by a person who experiences the problem and can answer the questions. I am not too excited about being a proxy between bugtrackers, and registering account on https://bugreports.qt.nokia.com/ is not harder than on https://bugzilla.redhat.com/
This request wasn't addressed at you techtonik but rather to the qt maintainer(s). Not that I, as maintainer of various other packages, hesitate to upstream a bug but imho it's one of the responsibilities of the package maintainer to upstream bugs. [1] I do it if I couldn't solve a bug and I expect it from others as well. [1] http://fedoraproject.org/wiki/Package_maintainer_responsibilities#Deal_with_reported_bugs_in_a_timely_manner
I'm a comaintainer for the Qt package. I see my role as a maintainer, not as a messenger. If you want to tell the Nokia Qt developers something, then tell them, not us. I don't see how playing "Stille Post" helps anybody, it's much more effective to talk to the intended people directly.
I don't want you to play "Stille Post", I just want the bug to be fixed actually. If it is fixed for all DEs by simply checking which theme Gnome uses, it's fine but otherwise the bug isn't fixed for many users. Also I don't see how this scales when every regular user needs an upstream bug tracker account. If your reasoning would really apply we won't need this bugzilla because most of the bugs should be better filed upstream.
Seems that also reporting bugs upstream doesn't seem to help getting them fixed. Is there any additional information needed?
The following workaround works for me, don't know if we could incorporate it. I doubt. http://mikemcquaid.com/2011/12/make-qt-use-the-gtk-style-on-xfce-or-xubuntu/
That doesn't look like a good solution indeed. Qt's QGtkStyle needs to either look in xsettings (Net/ThemeName) itself or just let GTK+ handle the theme selection itself (it will use xsettings just fine). The workaround looks as if QGtkStyle were looking only in the GTK2_RC_FILES, which is very broken.
I have the same issue with F17 and vlc (gnome-shell and cinnamon as DE). When launched from terminal: QGtkStyle was unable to detect the current GTK theme. This bug seems related to: https://bbs.archlinux.org/viewtopic.php?id=99175 https://bugreports.qt-project.org/browse/QTBUG-5545 First workaround (probably the weakest): $ export GTK2_RC_FILES="/etc/gtk-2.0/gtkrc" $ vlc Second workaround (don't needs other packages): $ gconftool-2 --set --type string /desktop/gnome/interface/gtk_theme Adwaita Third workaround (probably the best): # yum install libgnomeui All these workarounds work for me. Note: the third workaround needs to restart the environment. Hope this helps.
This gives a hint that adding a method to use xsettings to query current gtk theme may be one way to help fix this.
This would be a bug now more than ever because even GNOME doesn't use gconf any more to set the interface (uses gsettings). So I was about to look for and eventually open a bug report so it would check xfsettingsd settings instead (or something more general). https://bugreports.qt-project.org/browse/QTBUG-5545 has just been marked as resolved for qt 5.0.0 beta 2 I just didn't understand the reason nor do I know if they just dropped the feature etc. Does anyone know if that 'fix' will make it work with Xfce? Maybe someone has an account at qt bugs and could ask? TBH, if we use a standalone window manager, with ~/.gtkrc-2.0 and ~/.config/gtk-3.0/settings.ini qt doesn't pick up the style either so the best solution would be some that would include also these files.
Upstream says: "We have simply removed the sanity check at startup. It should be safe to ignore this as the cause for the sanity check (gtk qt theme) is no longer supported by modern linux distributions." I think we can do the same in our Qt 4 builds, we stopped shipping gtk-qt-engine years ago!
qt-4.8.4-4.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/FEDORA-2013-0277/qt-4.8.4-4.fc17
qt-4.8.4-5.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/FEDORA-2013-0199/qt-4.8.4-5.fc18
qt-4.8.4-5.fc16 has been submitted as an update for Fedora 16. https://admin.fedoraproject.org/updates/FEDORA-2013-0270/qt-4.8.4-5.fc16
qt-4.8.4-5.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/FEDORA-2013-0277/qt-4.8.4-5.fc17
Package qt-4.8.4-5.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing qt-4.8.4-5.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-0199/qt-4.8.4-5.fc18 then log in and leave karma (feedback).
qt-4.8.4-6.fc17 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.
qt-4.8.4-6.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.
qt-4.8.4-6.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.
Removing external tracker bug with the id '21294' as it is not valid for this tracker
Removing external tracker bug with the id '5545' as it is not valid for this tracker