summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-01-09 15:23:30 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-01-09 15:23:30 +0000
commit63e511bcf4fa6ff1cee8f18ee9499fc401fec5e8 (patch)
tree18ccc1a68ca30a29ea89a927ebb765d5d0200996 /gdk
parent9b2a1356f0b86f8fdd44af0e6434734244c016b7 (diff)
downloadgtk+-63e511bcf4fa6ff1cee8f18ee9499fc401fec5e8.tar.gz
Check for RENDER before trying to use it... XRenderFindFormat() prints
Wed Jan 9 10:20:16 2002 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkdrawable-x11.c gdk/x11/gdkgc-c11.c: Check for RENDER before trying to use it... XRenderFindFormat() prints warnings if called when extension isn't present.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkdrawable-x11.c17
-rw-r--r--gdk/x11/gdkgc-x11.c3
2 files changed, 14 insertions, 6 deletions
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index ad4c97096b..89c7661ff4 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -1,4 +1,4 @@
-/* GDK - The GIMP Drawing Kit
+/* GIMP Drawing Kit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
*
* This library is free software; you can redistribute it and/or
@@ -238,6 +238,9 @@ gdk_x11_drawable_get_picture (GdkDrawable *drawable)
{
GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
+ if (!_gdk_x11_have_render ())
+ return None;
+
if (impl->picture == None)
{
GdkVisual *visual = gdk_drawable_get_visual (drawable);
@@ -802,12 +805,14 @@ select_format (Display *xdisplay,
XRenderPictFormat **mask)
{
XRenderPictFormat pf;
-
-/* Look for a 32-bit xRGB and Axxx formats that exactly match the
- * in memory data format. We can use them as pixmap and mask
- * to deal with non-premultiplied data.
- */
+ if (!_gdk_x11_have_render ())
+ return FORMAT_NONE;
+
+ /* Look for a 32-bit xRGB and Axxx formats that exactly match the
+ * in memory data format. We can use them as pixmap and mask
+ * to deal with non-premultiplied data.
+ */
pf.type = PictTypeDirect;
pf.depth = 32;
diff --git a/gdk/x11/gdkgc-x11.c b/gdk/x11/gdkgc-x11.c
index b703b7e3b9..3605718e13 100644
--- a/gdk/x11/gdkgc-x11.c
+++ b/gdk/x11/gdkgc-x11.c
@@ -804,6 +804,9 @@ _gdk_x11_gc_get_fg_picture (GdkGC *gc)
g_return_val_if_fail (GDK_IS_GC_X11 (gc), None);
+ if (!_gdk_x11_have_render ())
+ return None;
+
x11_gc = GDK_GC_X11 (gc);
if (x11_gc->fg_picture == None)