From 4471ef23e5e4849360a1a08b34ac54351c03c885 Mon Sep 17 00:00:00 2001 From: Ken VanDine Date: Thu, 12 Jan 2012 00:49:05 +0100 Subject: Patch from ~covox (LP: #867649) In method ido_offscreen_proxy_realize(), a call is made to gdk_screen_get_rgba_visual() to get a GdkVisual handle, which is then passed as part of a GdkWindowAttr structure to gdk_window_new(). What's not taken into account is that gdk_screen_get_rgba_visual() will return NULL if RGBA isn't supported by the destination window manager (e.g. if someone turned the Composite extension off). In this case, as the field is always marked as valid for use (GDK_WA_VISUAL), gdk_window_new will fall over. Attached is a patch to fall back on gdk_screen_get_system_visual() if RGBA isn't available. With this, unity-panel-service no longer crashes after interacting with the Sound indicator if the Composite extension is switched off. --- src/idooffscreenproxy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/idooffscreenproxy.c b/src/idooffscreenproxy.c index 50a087d..79cb626 100644 --- a/src/idooffscreenproxy.c +++ b/src/idooffscreenproxy.c @@ -211,6 +211,10 @@ ido_offscreen_proxy_realize (GtkWidget *widget) | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK; attributes.visual = gdk_screen_get_rgba_visual (gdk_screen_get_default ());//gtk_widget_get_visual (widget); + if (!attributes.visual) + { + attributes.visual = gdk_screen_get_system_visual (gdk_screen_get_default ()); + } attributes.wclass = GDK_INPUT_OUTPUT; attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL; -- cgit v1.2.3