summaryrefslogtreecommitdiff
path: root/gdk/x11
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-06-18 16:26:06 +0200
committerBenjamin Otte <otte@redhat.com>2018-06-18 23:49:53 +0200
commitcbbb7604b6e0d66cb5b8b51d4ca28d56f412452d (patch)
tree42dae61dc10bab7e802ac7d5e23b736256e6c525 /gdk/x11
parent9a91d3739dc1986651f384cc4021e1ac32453268 (diff)
downloadgtk+-cbbb7604b6e0d66cb5b8b51d4ca28d56f412452d.tar.gz
x11: Set background as transparent as possible
Instead of making the background black, make it transparent black for RGBA visuals and set a None background otherwise.
Diffstat (limited to 'gdk/x11')
-rw-r--r--gdk/x11/gdksurface-x11.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 96eba37274..a833b7ccd5 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -885,10 +885,19 @@ _gdk_x11_display_create_surface_impl (GdkDisplay *display,
{
class = InputOutput;
- xattributes.background_pixel = BlackPixel (xdisplay, x11_screen->screen_num);
+ if (gdk_display_is_rgba (display))
+ {
+ xattributes.background_pixel = 0;
+ xattributes_mask |= CWBackPixel;
+ }
+ else
+ {
+ xattributes.background_pixmap = None;
+ xattributes_mask |= CWBackPixmap;
+ }
xattributes.border_pixel = BlackPixel (xdisplay, x11_screen->screen_num);
- xattributes_mask |= CWBorderPixel | CWBackPixel;
+ xattributes_mask |= CWBorderPixel;
xattributes.bit_gravity = NorthWestGravity;
xattributes_mask |= CWBitGravity;