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

Proposed by Ken VanDine on 2012-01-11
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 2012-01-11 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
1=== modified file 'src/idooffscreenproxy.c'
2--- src/idooffscreenproxy.c 2011-09-06 17:52:37 +0000
3+++ src/idooffscreenproxy.c 2012-01-11 23:59:23 +0000
4@@ -211,6 +211,10 @@
5 | GDK_ENTER_NOTIFY_MASK
6 | GDK_LEAVE_NOTIFY_MASK;
7 attributes.visual = gdk_screen_get_rgba_visual (gdk_screen_get_default ());//gtk_widget_get_visual (widget);
8+ if (!attributes.visual)
9+ {
10+ attributes.visual = gdk_screen_get_system_visual (gdk_screen_get_default ());
11+ }
12 attributes.wclass = GDK_INPUT_OUTPUT;
13
14 attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;

Subscribers

People subscribed via source and target branches