diff --git a/FL/x.H b/FL/x.H index b4fe5fa05..f1f23f918 100644 --- a/FL/x.H +++ b/FL/x.H @@ -161,6 +161,7 @@ public: static void x(Fl_Window* wi, int X) {wi->x(X);} static void y(Fl_Window* wi, int Y) {wi->y(Y);} static int ewmh_supported(); + static int xrender_supported(); static void activate_window(Window w); }; diff --git a/configh.in b/configh.in index 49add67f8..39b3f2560 100644 --- a/configh.in +++ b/configh.in @@ -123,6 +123,14 @@ #define HAVE_XCURSOR 0 +/* + * HAVE_XRENDER: + * + * Do we have the X render library? + */ + +#define HAVE_XRENDER 0 + /* * __APPLE_QUARTZ__: * diff --git a/configure.in b/configure.in index f74b3670e..70a5a55fc 100644 --- a/configure.in +++ b/configure.in @@ -1018,6 +1018,16 @@ case $host_os_gui in LIBS="-lXcursor $LIBS") fi + dnl Check for the Xrender library unless disabled... + AC_ARG_ENABLE(xrender, [ --enable-xrender turn on Xrender support [[default=yes]]]) + + if test x$enable_xrender != xno; then + AC_CHECK_HEADER(X11/extensions/Xrender.h, AC_DEFINE(HAVE_XRENDER),, + [#include ]) + AC_CHECK_LIB(Xrender, XRenderQueryVersion, + LIBS="-lXrender $LIBS") + fi + dnl Check for overlay visuals... AC_PATH_PROG(XPROP, xprop) AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay, diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 772acae28..8ca25201e 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -69,6 +69,9 @@ static bool have_xfixes = false; # if HAVE_XCURSOR # include # endif +# if HAVE_XRENDER +# include +# endif static Fl_Xlib_Graphics_Driver fl_xlib_driver; static Fl_Display_Device fl_xlib_display(&fl_xlib_driver); Fl_Display_Device *Fl_Display_Device::_display = &fl_xlib_display;// the platform display @@ -2230,6 +2233,19 @@ int Fl_X::ewmh_supported() { return result; } +int Fl_X::xrender_supported() { + static int result = -1; + + if (result == -1) { + fl_open_display(); + + int nop1, nop2; + result = XRenderQueryExtension(fl_display, &nop1, &nop2); + } + + return result; +} + extern Fl_Window *fl_xfocus; void Fl_X::activate_window(Window w) {