x11: Relax requirements for setting ParentRelative

XSetWindowBackgroundPixmap() will throw BadMatch only in the case of a
different parent window depth. Different visuals are fine and actually
expected in Gtk+ 3.16 (since we don't stick to the system default visual
but try to pick a better one).

https://bugzilla.gnome.org/show_bug.cgi?id=747524
This commit is contained in:
Evangelos Foutras 2015-04-11 11:20:56 +03:00 committed by Matthias Clasen
parent fe7bc84c89
commit 374bedc0e2

View File

@ -2963,15 +2963,15 @@ gdk_window_x11_set_background (GdkWindow *window,
{
GdkWindow *parent;
/* X throws BadMatch if the parent has a different visual when
/* X throws BadMatch if the parent has a different depth 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
if (parent && window->depth != parent->depth)
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), None);
else
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), ParentRelative);
return;
}