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)
This commit is contained in:
Owen Taylor 2003-04-18 20:21:44 +00:00 committed by Owen Taylor
parent 5e5dd39adf
commit dcaf1b80e2
8 changed files with 83 additions and 6 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,9 @@
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

View File

@ -1,3 +1,9 @@
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

View File

@ -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);

View File

@ -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

View File

@ -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);
return XRenderQueryExtension (GDK_DISPLAY_XDISPLAY (display),
&event_base, &error_base);
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 x11display->have_render == GDK_YES;
}
#ifdef HAVE_XFT2