Bug 299001 - White text in gtk3 apps while in Unity
Summary: White text in gtk3 apps while in Unity
Status: CLOSED UPSTREAM
Alias: None
Product: Oxygen
Classification: Plasma
Component: gtk3-engine (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-28 22:40 UTC by ror
Modified: 2012-05-15 04:11 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
patch (912 bytes, application/octet-stream)
2012-04-30 19:40 UTC, Hugo Pereira Da Costa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ror 2012-04-28 22:40:09 UTC
Screeshot: http://i.imgur.com/0L27f.png

That is how oxygen-gtk3 looks on gtk3 application. gtk2 version is fine

As can be seen, in Nautilus, font is white and can't be read
On Gedit screenshot can be noticed that by default Ambiance Ubuntu theme, Gedit is rendered with white backround and black text, but with oxygen-gtk seems like it's inversed
Also on Gedit open dialog can be seen that inputbox is deformed, and that's same also for combobox element - they are somehow reduced, both horizontally and vertically by couple of pixels

Reproducible: Always
Comment 1 Ruslan Kabatsayev 2012-04-28 22:44:04 UTC
Please check that you are using latest (git) oxygen-gtk version.
If it still has this bug, post your GTK3 version and distribution version.
Comment 2 ror 2012-04-28 22:48:55 UTC
Yes, forgot to mention I use Ubuntu 12.04 and don't know which gtk3 version it uses. If I may guess I'd say 3.4

I use latest to date git version of oxygen-gtk
Comment 3 ror 2012-04-28 23:00:49 UTC
I found solution:

I commented this lines in /usr/share/themes/oxygen-gtk/gtk-3.0/kdeglobals:
========================================
[WM]
#activeBackground=48,174,232
#activeForeground=255,255,255
========================================

For some reason it corrected everything, including inputbox/combobox deformations
Comment 4 ror 2012-04-28 23:49:24 UTC
Sorry, this doesn't solve it.
It seemed so after I changed the file, but after I started new session (log out/in) everything back the same as in first report.
Comment 5 Ruslan Kabatsayev 2012-04-28 23:50:35 UTC
Hmm... what session do you start to reproduce this? Gnome classic? Unity?
Comment 6 ror 2012-04-29 00:14:47 UTC
Default - Unity
Comment 7 Hugo Pereira Da Costa 2012-04-29 18:58:58 UTC
Can't reproduce.
Can you post version of oxygen-gtk you are using. 
Issue is possibly already fixed in latest version.
PS: can't reproduce, naturally. (though not on unity)

See e.g.: http://wstaw.org/m/2012/04/29/plasma-desktoprx2272.png

Also, the wrong arrow position at the top of the nautilus window (the pathbar) is a bug I'm sure we fixed in a recent commit. So please try compile latest oxygen-gtk3 from source and provide feedback

Cheers,

Hugo
Comment 8 Ruslan Kabatsayev 2012-04-29 19:03:38 UTC
@ror
BTW, if you've had git tree before upgrade to Ubuntu 12.04 and just do "git pull && make && make install", then you are likely installing to the wrong directory, especially true if you have 64 bit kernel. So, try doing 'apt-get remove gtk3-engines-oxygen', reinstall oxygen-gtk3 from source and check that the gtk3 apps are still using oxygen.
Comment 9 ror 2012-04-30 03:45:06 UTC
I use latest git version (at the day I wrote about this bug)
I can reproduce with both unity and gnome-shell
Please try Ubuntu 12.04 in virtualbox or something similar
Comment 10 ror 2012-04-30 03:46:53 UTC
By try I mean change the theme, logout / login
Comment 11 ror 2012-04-30 03:55:47 UTC
I don't know how to see which version it is, but from cmake files it seems like 1.0.50
Comment 12 ror 2012-04-30 03:57:49 UTC
that's fot gtk3 and oxygen-gtk for gtk2 seems 1.2.50
Comment 13 ror 2012-04-30 04:01:50 UTC
And please suggest what to do, as I'm stucked with this orange Ambiance theme.
I use unmodified oxygen-gtk theme just because of this bug report which was suggested on kde-apps page, otherwise I'd include settings from Ambiance gtk.css and do aditional tweaks to make it work
Comment 14 Ruslan Kabatsayev 2012-04-30 09:40:36 UTC
@ror
Have you checked that removing gtk3-engines-oxygen and installing from source doesn't lead oxygen-gtk3 to no longer being used? (see comment 8)
Comment 15 ror 2012-04-30 16:21:00 UTC
I don't understand what are you suggesting?
I didn't update Ubuntu to 12.04 - I installed fresh 12.04

oxygen-gtk theme files are at correct place
"liboxygen-gtk.so" for gtk3 is at "/usr/lib/i386-linux-gnu/gtk-3.0/3.000/theming-engines/"
Comment 16 ror 2012-04-30 16:22:01 UTC
typo: 3.000 should be 3.0.0
Comment 17 Hugo Pereira Da Costa 2012-04-30 16:29:37 UTC
From what I can see with ubuntu 12.04, oxygen-gtk versions are patched 1.0.2 for gtk3 and 1.2.2 for gtk.
I would _really_ recommand that you download latest release from 

http://kde-look.org/content/show.php/?content=136216

And try compile it manually by hand, verify that the files are installed at the right place, and see if the bugs remain.
Comment 18 ror 2012-04-30 16:42:38 UTC
But I don't use oxygen-gtk from repository, I use git version, even mentioned version 1.0.50 and 1.2.50
Comment 19 ror 2012-04-30 16:43:32 UTC
see comments #11 and #12
Comment 20 Ruslan Kabatsayev 2012-04-30 16:45:24 UTC
@ror
Sorry for that many questions. I've now installed ubuntu-desktop which includes Unity, and can now reproduce this issue.
Comment 21 ror 2012-04-30 16:47:17 UTC
No problem.

Something is missing in oxygen-gtk gtk.css file.
I included Ambiance css helpr files and managed to reduce just to gtk-widgets.css and some base colors.
Will continue after couple of hours break
Comment 22 Hugo Pereira Da Costa 2012-04-30 16:49:41 UTC
@Ruslan,
- could you look for any .css style forced on top of ours by unity ? 
- how does thing look if using another widget style ?
Comment 23 Ruslan Kabatsayev 2012-04-30 16:51:53 UTC
@Hugo
It definitely looks like Adwaita or whatever is forced desktop-wide by Unity's settings manager. The problem seems related to the fact that gnome appearance settings GUI doesn't detect oxygen-gtk3 at all. It only suggests some of defaults themes.
Comment 24 ror 2012-04-30 16:56:37 UTC
@Ruslan: install this tool:

sudo add-apt-repository ppa:diesch/testing
sudo apt-get update
sudo apt-get install unsettings

I copied colors defines in gtk.css from Ambiance theme and included:

@import url("../Ambiance/gtk-3.0/gtk-widgets.css");

in oxygen-gtk gtk.css

This can be reduced further of course
Comment 25 ror 2012-04-30 17:04:38 UTC
ups again, in case it matters, should be

@import url("../../Ambiance/...)

two folders back

just in case
Comment 26 Ruslan Kabatsayev 2012-04-30 17:22:14 UTC
@Hugo
There's plenty of errors when running oxygen-gtk3-demo: http://pastebin.com/1HtNGFQ8

I've checked what causes them, and it appears that at least gtk_settings_get_default() in loadKdeGlobalsOptions() returns 0. What should this mean at all?
I'm starting to think that it's Unity or GTK3 who is guilty in all this mess, not oxygen-gtk3.
Comment 27 Hugo Pereira Da Costa 2012-04-30 17:45:14 UTC
@Russlan, if gtk_settings_get_default fails yes, all loading of the settings from OxygenQtSettings will fail
(cause we write directly to this guy and not to a css file)
Notably all the color settings that are read from kdeglobals.

http://developer.gnome.org/gtk3/stable/GtkSettings.html#gtk-settings-get-default

Is the documentation.
It returns NULL if no screen is defined.
Might be a unity hack.
Maybe the theme gets loaded/initialized too early.

The "return 0" from QtSettings usually happens when settings have already been initialized and is called a second time.
What we (you :)) could try:
at the top of QtSettings::initialize, and before setting initialized to true, check the validity of gtk_settings_get_default() and gdk_screen_get_default(), and return false if they are invalid.
If the method is called again, later, at least it would try again to redo the full thing. Makes sense ? Maybe this time the screen will be valid.
and if not, it would be up to us to make sure that the method is called again and again until the screen is valid 
(this should happen, at some point ;))
Comment 28 Hugo Pereira Da Costa 2012-04-30 17:45:53 UTC
PS: I can add that myself if needed. Though I have a couple of commits to push first ;)
Comment 29 Hugo Pereira Da Costa 2012-04-30 19:40:02 UTC
Created attachment 70781 [details]
patch

After some digging with Ruslan,
Attached patch fixes the issue
+but+
we do not want to commit the patch to oxygen-gtk, because it is ugly (I might think about something less ugly later)
The real issue is really with Unity and/or gtk3, comming from the fact that GdkScreen is not valid at the time when create_engine() (a gtk global function that the widget style must re-implement), is called. There is nothing we can do about this and this should really be fixed upstream.
Please report to unity, with a link to this bug report.

Here, closing.

Thanks,

Hugo
Comment 31 Hugo Pereira Da Costa 2012-05-02 14:46:59 UTC
Thanks ror for the link.
Just added a bit more comments there, for them to track things better.