[metacity] ui: use rgba visual in meta_ui_get_pixbuf_from_pixmap
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] ui: use rgba visual in meta_ui_get_pixbuf_from_pixmap
- Date: Thu, 19 Feb 2015 01:54:01 +0000 (UTC)
commit c6ba6dc7f458720d9f8666881f45a830580468cb
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Feb 19 03:08:53 2015 +0200
ui: use rgba visual in meta_ui_get_pixbuf_from_pixmap
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 e0ffa8b..14a9602 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]