Summary: | dev-qt/qtgui should export GTK2_RC_FILES when USE="gtkstyle" is enabled | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Brad Laue <brad> |
Component: | Current packages | Assignee: | Qt Bug Alias <qt> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gnome |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=491226 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | qtgui-gtk2rc.patch |
Description
Brad Laue
2011-10-26 14:10:40 UTC
qt4 checks *only* for 'gtk+-2.0 ">=" 2.10 atk gobject-2.0' and only uses libs from gobject-2.0. But the problem lies actually in src/gui/styles/qgtkstyle_p.cpp (and a couple other): - it dlopens (more or less) libgtk-x11-2.0.so.0 - then it checks GTK2_RC_FILES env var, if it's unset - falls back to /desktop/gnome/interface/gtk_theme gconf key (which it dlopens to) (it checks few other gconf keys too, but this is the only, that really matters) - finally, to make things really ugly, it dlopens libgnomeui-2 and libgnomevfs-2 to determine filesystem icons (though it seems this step can safely fail without affecting the rest of the theme) Given the state of libgnomeui and gnome-vfs, I think the solution would be to find more recent api equivalents - actually, only gnome_icon_lookup_sync seems to matter, as gnome_vfs_init seems to be called only for the sake of the former. Additionally, since version 4.8.0, Qt reads font hinting settings from GConf if it's available. (In reply to comment #2) > Additionally, since version 4.8.0, Qt reads font hinting settings from GConf if > it's available. ...right in time for GConf going out of style (even if certain gsettings specifics are quite a bother)... :sigh: As my first comment says, this is an upstream problem of using obsolete tools. While a few Gnome programs still use GConf, those libs are simply dead. + 13 Jul 2012; Ben de Groot <yngwin@gentoo.org> qt-gui-4.7.4-r1.ebuild, + qt-gui-4.8.1-r1.ebuild, qt-gui-4.8.2.ebuild: + Add elog message to inform users about how to use gtkstyle, bug #388551 if use gtkstyle ; then # see bug 388551 elog "For Qt's GTK style to work, you need to either export" elog "the following variable into your environment:" elog ' GTK2_RC_FILES="$HOME/.gtkrc-2.0"' elog "or alternatively install gnome-base/libgnomeui" fi (In reply to comment #4) > + 13 Jul 2012; Ben de Groot <yngwin@gentoo.org> qt-gui-4.7.4-r1.ebuild, > + qt-gui-4.8.1-r1.ebuild, qt-gui-4.8.2.ebuild: > + Add elog message to inform users about how to use gtkstyle, bug #388551 > > if use gtkstyle ; then > # see bug 388551 > elog "For Qt's GTK style to work, you need to either export" > elog "the following variable into your environment:" > elog ' GTK2_RC_FILES="$HOME/.gtkrc-2.0"' > elog "or alternatively install gnome-base/libgnomeui" > fi Is there any reason for not exporting this variable always? (using env.d file I mean) (In reply to comment #5) > Is there any reason for not exporting this variable always? (using env.d > file I mean) Applied in Qt 4.8.3 Thanks a lot :) Change reverted because it doesn't work, leading to bug #435054. (In reply to comment #8) > Change reverted because it doesn't work, leading to bug #435054. Per https://bugs.gentoo.org/show_bug.cgi?id=435054#c3 looks like the solution would be to add a simple script exporting that variable into /etc/profile.d, similar to java-config-2.sh, that exports needed variables ;) patches welcome (In reply to comment #10) > patches welcome Isn't adding a qt-qui.sh script with this: export GTK2_RC_FILES=${HOME}/.gtkrc-2.0 enough? (In reply to comment #4) > + 13 Jul 2012; Ben de Groot <yngwin@gentoo.org> qt-gui-4.7.4-r1.ebuild, > + qt-gui-4.8.1-r1.ebuild, qt-gui-4.8.2.ebuild: > + Add elog message to inform users about how to use gtkstyle, bug #388551 > > if use gtkstyle ; then > # see bug 388551 > elog "For Qt's GTK style to work, you need to either export" > elog "the following variable into your environment:" > elog ' GTK2_RC_FILES="$HOME/.gtkrc-2.0"' > elog "or alternatively install gnome-base/libgnomeui" > fi As mentioned in some other threads out there, and my personal experience, exporting the variable is not enough in some situations where people do not have enough gnome infrastructure installed. Installing gnome-base/gconf and telling it the theme seems to work: (coming from a fvwm user) gconftool-2 --set --type string /desktop/gnome/interface/gtk_theme MY_THEME Created attachment 341644 [details, diff]
qtgui-gtk2rc.patch
Please review this patch installing 'export GTK2_RC_FILES=${HOME}/.gtkrc-2.0' to /etc/profile.d/qtgui.sh
(In reply to Michael Palimaka (kensington) from comment #13) > Created attachment 341644 [details, diff] [details, diff] > qtgui-gtk2rc.patch > > Please review this patch installing 'export > GTK2_RC_FILES=${HOME}/.gtkrc-2.0' to /etc/profile.d/qtgui.sh Just tested and it works fine :D Thanks! Thanks, patch is applied in git and will hit the tree with 4.8.5 (In reply to Michael Palimaka (kensington) from comment #15) > Thanks, patch is applied in git and will hit the tree with 4.8.5 No more "if use gtkstyle; ... fi" ? (In reply to Davide Pesavento from comment #16) > No more "if use gtkstyle; ... fi" ? Do you mean we should only install that file if that USE flag is set? (In reply to Michael Palimaka (kensington) from comment #17) > (In reply to Davide Pesavento from comment #16) > > No more "if use gtkstyle; ... fi" ? > > Do you mean we should only install that file if that USE flag is set? That's what I mean yes. I guess it's useless if gtkstyle is not built. Good point, fixed in git. Now in tree with qtgui-4.8.5. Thanks everybody! |