diff --git a/client.cpp b/client.cpp index 30c9d5f3a3..87ecbc4b6f 100644 --- a/client.cpp +++ b/client.cpp @@ -475,7 +475,7 @@ void Client::updateShape() XShapeCombineMask( display(), frameId(), ShapeBounding, 0, 0, None, ShapeSet); } - if( Extensions::shapeMajor() > 1 || Extensions::shapeMinor() >= 1 ) // has input shape support + if( Shape::version() >= 0x11 ) // 1.1, has input shape support { // there appears to be no way to find out if a window has input // shape set or not, so always set propagate the input shape // (it's the same like the bounding shape by default) diff --git a/utils.cpp b/utils.cpp index d707609cc4..4bf35fbf5f 100644 --- a/utils.cpp +++ b/utils.cpp @@ -63,7 +63,7 @@ void Extensions::init() { int major, minor; if( XShapeQueryVersion( display(), &major, &minor )) - shape_version = major * 16 + minor; + shape_version = major * 0x10 + minor; } #ifdef HAVE_XRANDR has_randr = XRRQueryExtension( display(), &randr_event_base, &dummy ); diff --git a/utils.h b/utils.h index 334866e993..981b4202c1 100644 --- a/utils.h +++ b/utils.h @@ -149,8 +149,7 @@ class Extensions public: static void init(); static bool shapeAvailable() { return shape_version > 0; } - static int shapeMajor() { return shape_version / 16; } - static int shapeMinor() { return shape_version % 16; } + static int shapeVersion() { return shape_version; } // as 16*major+minor, i.e. two hex digits static int shapeNotifyEvent(); static bool randrAvailable() { return has_randr; } static int randrNotifyEvent(); @@ -161,7 +160,7 @@ class Extensions static bool fixesAvailable() { return has_fixes; } static bool hasShape( Window w ); private: - static int shape_version; // as 16*major+minor + static int shape_version; static int shape_event_base; static bool has_randr; static int randr_event_base; @@ -172,6 +171,11 @@ class Extensions static bool has_fixes; }; +// compile with XShape older than 1.0 +#ifndef ShapeInput +const int ShapeInput = 2; +#endif + class Motif { public: