mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
x11: Remove display_x11->have_render
Also remove setters and getters for the variable and the GdkTristate enum, as it's the only place where it was used.
This commit is contained in:
parent
7182a2dc19
commit
8868e77fa0
@ -1257,8 +1257,6 @@ gdk_display_open (const gchar *display_name)
|
||||
|
||||
display_x11->leader_window_title_set = FALSE;
|
||||
|
||||
display_x11->have_render = GDK_UNKNOWN;
|
||||
|
||||
#ifdef HAVE_XFIXES
|
||||
if (XFixesQueryExtension (display_x11->xdisplay,
|
||||
&display_x11->xfixes_event_base,
|
||||
|
@ -45,13 +45,6 @@ typedef struct _GdkDisplayX11Class GdkDisplayX11Class;
|
||||
#define GDK_IS_DISPLAY_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_X11))
|
||||
#define GDK_DISPLAY_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_X11, GdkDisplayX11Class))
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_UNKNOWN,
|
||||
GDK_NO,
|
||||
GDK_YES
|
||||
} GdkTristate;
|
||||
|
||||
struct _GdkDisplayX11
|
||||
{
|
||||
GdkDisplay parent_instance;
|
||||
@ -76,7 +69,6 @@ struct _GdkDisplayX11
|
||||
GdkKeymap *keymap;
|
||||
guint keymap_serial;
|
||||
|
||||
GdkTristate have_render;
|
||||
gboolean have_xfixes;
|
||||
gint xfixes_event_base;
|
||||
|
||||
|
@ -136,94 +136,6 @@ _gdk_x11_drawable_update_size (GdkDrawable *drawable)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
try_pixmap (Display *xdisplay,
|
||||
int screen,
|
||||
int depth)
|
||||
{
|
||||
Pixmap pixmap = XCreatePixmap (xdisplay,
|
||||
RootWindow (xdisplay, screen),
|
||||
1, 1, depth);
|
||||
XFreePixmap (xdisplay, pixmap);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gdk_x11_have_render (GdkDisplay *display)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/* At this point, we might have a false positive;
|
||||
* buggy versions of Xinerama only report depths for
|
||||
* which there is an associated visual; so we actually
|
||||
* go ahead and try create pixmaps.
|
||||
*/
|
||||
if (!(has_8 && has_32))
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
if (!has_8)
|
||||
try_pixmap (xdisplay, screen, 8);
|
||||
if (!has_32)
|
||||
try_pixmap (xdisplay, screen, 32);
|
||||
XSync (xdisplay, False);
|
||||
if (gdk_error_trap_pop () == 0)
|
||||
{
|
||||
has_8 = TRUE;
|
||||
has_32 = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* X11 specific implementations of generic functions *
|
||||
*****************************************************/
|
||||
|
@ -72,8 +72,6 @@ gint _gdk_send_xevent (GdkDisplay *display,
|
||||
glong event_mask,
|
||||
XEvent *event_send);
|
||||
|
||||
gboolean _gdk_x11_have_render (GdkDisplay *display);
|
||||
|
||||
/* Routines from gdkgeometry-x11.c */
|
||||
void _gdk_window_move_resize_child (GdkWindow *window,
|
||||
gint x,
|
||||
|
Loading…
Reference in New Issue
Block a user