Merge lp:~ken-vandine/ido/lp_867649 into lp:ido/0.3

Proposed by Ken VanDine
Status: Merged
Merged at revision: 99
Proposed branch: lp:~ken-vandine/ido/lp_867649
Merge into: lp:ido/0.3
Diff against target: 14 lines (+4/-0)
1 file modified
src/idooffscreenproxy.c (+4/-0)
To merge this branch: bzr merge lp:~ken-vandine/ido/lp_867649
Reviewer Review Type Date Requested Status
Canonical Desktop Experience Team Pending
Review via email: mp+88290@code.launchpad.net

Description of the change

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.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/idooffscreenproxy.c'
--- src/idooffscreenproxy.c 2011-09-06 17:52:37 +0000
+++ src/idooffscreenproxy.c 2012-01-11 23:59:23 +0000
@@ -211,6 +211,10 @@
211 | GDK_ENTER_NOTIFY_MASK211 | GDK_ENTER_NOTIFY_MASK
212 | GDK_LEAVE_NOTIFY_MASK;212 | GDK_LEAVE_NOTIFY_MASK;
213 attributes.visual = gdk_screen_get_rgba_visual (gdk_screen_get_default ());//gtk_widget_get_visual (widget);213 attributes.visual = gdk_screen_get_rgba_visual (gdk_screen_get_default ());//gtk_widget_get_visual (widget);
214 if (!attributes.visual)
215 {
216 attributes.visual = gdk_screen_get_system_visual (gdk_screen_get_default ());
217 }
214 attributes.wclass = GDK_INPUT_OUTPUT;218 attributes.wclass = GDK_INPUT_OUTPUT;
215 219
216 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;220 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;

Subscribers

People subscribed via source and target branches