From e89cef37eb341a073b87d9b560a6501759bc60f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 16 Jul 2012 11:57:08 -0400 Subject: [PATCH] xwayland: Look up 32 depth rgba render format as well --- src/xwayland/window-manager.c | 15 ++++++++++++--- src/xwayland/xwayland.h | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c index 1ec6a8b..e65e5da 100644 --- a/src/xwayland/window-manager.c +++ b/src/xwayland/window-manager.c @@ -528,7 +528,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) cairo_xcb_surface_create_with_xrender_format(wm->conn, wm->screen, window->frame_id, - &wm->render_format, + &wm->format_rgb, width, height); hash_table_insert(wm->window_hash, window->frame_id, window); @@ -1065,10 +1065,19 @@ wxs_wm_get_resources(struct weston_wm *wm) return; formats = xcb_render_query_pict_formats_formats(formats_reply); - for (i = 0; i < formats_reply->num_formats; i++) + for (i = 0; i < formats_reply->num_formats; i++) { + if (formats[i].direct.red_mask != 0xff && + formats[i].direct.red_shift != 16) + continue; if (formats[i].type == XCB_RENDER_PICT_TYPE_DIRECT && formats[i].depth == 24) - wm->render_format = formats[i]; + wm->format_rgb = formats[i]; + if (formats[i].type == XCB_RENDER_PICT_TYPE_DIRECT && + formats[i].depth == 32 && + formats[i].direct.alpha_mask == 0xff && + formats[i].direct.alpha_shift == 24) + wm->format_rgba = formats[i]; + } free(formats_reply); } diff --git a/src/xwayland/xwayland.h b/src/xwayland/xwayland.h index 438b7be..fb68671 100644 --- a/src/xwayland/xwayland.h +++ b/src/xwayland/xwayland.h @@ -58,7 +58,7 @@ struct weston_wm { xcb_window_t wm_window; struct weston_wm_window *focus_window; struct theme *theme; - xcb_render_pictforminfo_t render_format; + xcb_render_pictforminfo_t format_rgb, format_rgba; struct wl_listener activate_listener; xcb_window_t selection_window; -- 2.7.4