Bug 333983 - GtkLayout as the main GtkWindow widget does not use standard Oxygen window background
Summary: GtkLayout as the main GtkWindow widget does not use standard Oxygen window ba...
Status: RESOLVED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: gtk3-engine (show other bugs)
Version: 4.13.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-27 23:33 UTC by Pietro Gagliardi
Modified: 2014-06-26 10:17 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
The expected output with GtkLayout; this shows up with all other controls and layouts. (16.18 KB, image/png)
2014-04-27 23:33 UTC, Pietro Gagliardi
Details
The background that GtkLayout shows instead; note that it is a solid color. (13.38 KB, image/png)
2014-04-27 23:33 UTC, Pietro Gagliardi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pietro Gagliardi 2014-04-27 23:33:03 UTC
Created attachment 86303 [details]
The expected output with GtkLayout; this shows up with all other controls and layouts.

I first asked this question on Stack Overflow thinking it was a bug in GtkLayout itself: http://stackoverflow.com/questions/22940588/how-do-i-really-make-a-gtk-3-gtklayout-transparent-draw-theme-background — now I am reporting it here.

When running the simple program at the bottom of my Stack Overflow question, I get the output in the first attachment (imgur: http://imgur.com/oo5zaJe) with the standard layouts and with GtkDrawingArea. This is sthe standard Oyxgen window background. However, with GtkLayout, I get the output in the seocnd attchment (imgur: http://imgur.com/5EG64vY), which shows a plain solid background, instead of the Oyxgen window background, which I expected. The CSS

GtkLayout {
  background-color: transparent;
}

alone will fix GtkLayout to show the standard Oxygen window background (I don't know if having one on GtkViewpoirt as well will be useful). I do not know if this happens with GTK+ 2, or how to fix it if it does.

Thanks.
Comment 1 Pietro Gagliardi 2014-04-27 23:33:56 UTC
Created attachment 86304 [details]
The background that GtkLayout shows instead; note that it is a solid color.
Comment 2 Pietro Gagliardi 2014-04-27 23:34:34 UTC
Forgot to say that the CSS there was what the person who answered my quesiton suggested, rather than my own; it just happens to be the one that works.
Comment 3 Hugo Pereira Da Costa 2014-04-28 15:56:13 UTC
Hi,
Thanks for reporting.
So to make sure I understand right, if you explicitly set gtklayout as transparent in your CSS, you get the background you expect. Correct ?
If so, I believe I am just missing this line in the oxygen-gtk3 defaults :)
Will add, hoping for no regressions in other applications.

PS: can you report the gtk3 version you are using ? 
these things tend to change a lot (sadly) from one gtk version to the other ...

Thanks for reporting, 

Hugo
Comment 4 Hugo Pereira Da Costa 2014-04-28 16:11:27 UTC
Patch:

diff --git a/src/oxygenqtsettings.cpp b/src/oxygenqtsettings.cpp
index e02aa28..bd79d36 100644
--- a/src/oxygenqtsettings.cpp
+++ b/src/oxygenqtsettings.cpp
@@ -725,6 +725,7 @@ namespace Oxygen
             "GtkImage, "
             "GtkInfoBar, "
             "GtkLabel, "
+            "GtkLayout, "
             "GtkMenuItem, "
             "GtkOverlay, "
             "GtkRevealer, "

Can  you try apply it ? 
Confirm that it fixes the issue ? 
if yes I'll commit and close the report.
Comment 5 Pietro Gagliardi 2014-06-11 21:41:33 UTC
Very sorry for the delay; had issues figuring out how to apply package patches.

Yes, this fixes the bug. Thanks!
Comment 6 Hugo Pereira Da Costa 2014-06-26 09:43:40 UTC
Git commit 76ff7ce3a5cd97b7fb43cb1ee5288c0cde725c53 by Hugo Pereira Da Costa.
Committed on 28/04/2014 at 16:09.
Pushed by hpereiradacosta into branch 'gtk3'.

Added GtkLayout to the list of transparent widgets.

M  +1    -0    src/oxygenqtsettings.cpp

http://commits.kde.org/oxygen-gtk/76ff7ce3a5cd97b7fb43cb1ee5288c0cde725c53
Comment 7 Hugo Pereira Da Costa 2014-06-26 10:17:21 UTC
this has been pushed to gtk3 branch, will land into some release soon, so closing.