Commit 82e6e32c authored by Benjamin Otte's avatar Benjamin Otte

x11: Don't set ParentRealtive if the parent's visual is different

Causes a BadMatch otherwise, see code comments.

https://bugzilla.gnome.org/show_bug.cgi?id=630864
parent 72d48cbc
......@@ -2639,8 +2639,17 @@ gdk_window_x11_set_background (GdkWindow *window,
if (pattern == NULL)
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), ParentRelative);
GdkWindow *parent;
/* X throws BadMatch if the parent has a different visual when
* using ParentRelative */
parent = gdk_window_get_parent (window);
if (parent && gdk_window_get_visual (parent) == gdk_window_get_visual (window))
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), ParentRelative);
else
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), None);
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment