diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-02-19 03:08:53 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-02-19 03:08:53 +0200 |
commit | c6ba6dc7f458720d9f8666881f45a830580468cb (patch) | |
tree | 3a89f6a811252843600d4d52c3b778666701d09b | |
parent | c33ce914769ffb079f5811b14a99c70d8bfac5e3 (diff) | |
download | metacity-c6ba6dc7f458720d9f8666881f45a830580468cb.tar.gz |
ui: use rgba visual in meta_ui_get_pixbuf_from_pixmap
-rw-r--r-- | src/ui/ui.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ui/ui.c b/src/ui/ui.c index e0ffa8b8..14a9602c 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -931,7 +931,7 @@ meta_ui_get_pixbuf_from_pixmap (Pixmap pixmap) Window root; int x, y; unsigned int width, height, border, depth; - XWindowAttributes attrs; + GdkVisual *visual; cairo_surface_t *surface; GdkPixbuf *pixbuf; @@ -940,10 +940,11 @@ meta_ui_get_pixbuf_from_pixmap (Pixmap pixmap) if (!XGetGeometry (display, pixmap, &root, &x, &y, &width, &height, &border, &depth)) return NULL; - if (!XGetWindowAttributes (display, root, &attrs)) - return NULL; + visual = gdk_screen_get_rgba_visual (gdk_screen_get_default()); + if (!visual) + visual = gdk_screen_get_system_visual (gdk_screen_get_default()); - surface = cairo_xlib_surface_create (display, pixmap, attrs.visual, width, height); + surface = cairo_xlib_surface_create (display, pixmap, GDK_VISUAL_XVISUAL (visual), width, height); pixbuf = gdk_pixbuf_get_from_surface (surface, x, y, width, height); cairo_surface_destroy (surface); |