Commit dcaf1b80 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

Patch from Morten Welinder to catch Sun servers with a broken

Fri Apr 18 15:56:46 2003  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkdrawable-x11.[ch]:
        Patch from Morten Welinder to catch Sun servers with a
        broken implementation of the RENDER extension. (#108309)
parent 5e5dd39a
Fri Apr 18 15:56:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkdrawable-x11.[ch]:
Patch from Morten Welinder to catch Sun servers with a
broken implementation of the RENDER extension. (#108309)
Fri Apr 18 15:30:38 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkwindow-x11.c (set_text_property): Use
......
Fri Apr 18 15:56:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkdrawable-x11.[ch]:
Patch from Morten Welinder to catch Sun servers with a
broken implementation of the RENDER extension. (#108309)
Fri Apr 18 15:30:38 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkwindow-x11.c (set_text_property): Use
......
Fri Apr 18 15:56:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkdrawable-x11.[ch]:
Patch from Morten Welinder to catch Sun servers with a
broken implementation of the RENDER extension. (#108309)
Fri Apr 18 15:30:38 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkwindow-x11.c (set_text_property): Use
......
Fri Apr 18 15:56:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkdrawable-x11.[ch]:
Patch from Morten Welinder to catch Sun servers with a
broken implementation of the RENDER extension. (#108309)
Fri Apr 18 15:30:38 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkwindow-x11.c (set_text_property): Use
......
Fri Apr 18 15:56:46 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkdrawable-x11.[ch]:
Patch from Morten Welinder to catch Sun servers with a
broken implementation of the RENDER extension. (#108309)
Fri Apr 18 15:30:38 2003 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkwindow-x11.c (set_text_property): Use
......
......@@ -153,6 +153,7 @@ gdk_display_open (const gchar *display_name)
display_x11->have_shape = GDK_UNKNOWN;
display_x11->gravity_works = GDK_UNKNOWN;
display_x11->have_render = GDK_UNKNOWN;
if (_gdk_synchronize)
XSynchronize (display_x11->xdisplay, True);
......
......@@ -79,6 +79,7 @@ struct _GdkDisplayX11
gboolean have_shm_pixmaps;
GdkTristate have_shape;
GdkTristate gravity_works;
GdkTristate have_render;
/* Information about current pointer and keyboard grabs held by this
* client. If gdk_pointer_xgrab_window or gdk_keyboard_xgrab_window
......
......@@ -227,13 +227,58 @@ gdk_drawable_impl_x11_finalize (GObject *object)
gboolean
_gdk_x11_have_render (GdkDisplay *display)
{
/* This check is cheap, but if we have to do version checks, we will
* need to cache the result since version checks are round-trip
*/
int event_base, error_base;
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
GdkDisplayX11 *x11display = GDK_DISPLAY_X11 (display);
if (x11display->have_render == GDK_UNKNOWN)
{
int event_base, error_base;
x11display->have_render =
XRenderQueryExtension (xdisplay, &event_base, &error_base)
? GDK_YES : GDK_NO;
if (x11display->have_render == GDK_YES)
{
/*
* Sun advertises RENDER, but fails to support 32-bit pixmaps.
* That is just no good. Therefore, we check all screens
* for proper support.
*/
int screen;
for (screen = 0; screen < ScreenCount (xdisplay); screen++)
{
int count;
int *depths = XListDepths (xdisplay, screen, &count);
gboolean has_8 = FALSE, has_32 = FALSE;
if (depths)
{
int i;
for (i = 0; i < count; i++)
{
if (depths[i] == 8)
has_8 = TRUE;
else if (depths[i] == 32)
has_32 = TRUE;
}
XFree (depths);
}
if (!(has_8 && has_32))
{
g_warning ("The X server advertises that RENDER support is present,\n"
"but fails to supply the necessary pixmap support. In\n"
"other words, it is buggy.");
x11display->have_render = GDK_NO;
break;
}
}
}
}
return XRenderQueryExtension (GDK_DISPLAY_XDISPLAY (display),
&event_base, &error_base);
return x11display->have_render == GDK_YES;
}
#ifdef HAVE_XFT2
......
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