diff options
| author | Lauri Kasanen <cand@gmx.com> | 2015-03-16 11:07:00 +0000 |
|---|---|---|
| committer | Lauri Kasanen <cand@gmx.com> | 2015-03-16 11:07:00 +0000 |
| commit | a6c4b29a184ce7708819f4706877eedcd99a30f5 (patch) | |
| tree | 80e5a17091bf09191effef946e4c4cd0ae85a17e | |
| parent | fdab34b20e423ebac430a97f1ddcdae29ba881e0 (diff) | |
Detect XRender support
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10622 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/x.H | 1 | ||||
| -rw-r--r-- | configh.in | 8 | ||||
| -rw-r--r-- | configure.in | 10 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 16 |
4 files changed, 35 insertions, 0 deletions
@@ -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 @@ -124,6 +124,14 @@ #define HAVE_XCURSOR 0 /* + * HAVE_XRENDER: + * + * Do we have the X render library? + */ + +#define HAVE_XRENDER 0 + +/* * __APPLE_QUARTZ__: * * All Apple implementations are now based on Quartz and Cocoa, 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 <X11/Xlib.h>]) + 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 <X11/Xcursor/Xcursor.h> # endif +# if HAVE_XRENDER +# include <X11/extensions/Xrender.h> +# 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) { |
