diff --git a/client.cpp b/client.cpp index f4aa05f05d..6c28200205 100644 --- a/client.cpp +++ b/client.cpp @@ -438,7 +438,7 @@ void Client::updateShape() XShapeCombineMask( display(), frameId(), ShapeBounding, 0, 0, None, ShapeSet); } - if( Shape::major() > 1 || Shape::minor() >= 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 37da15fbd2..65a1256b0c 100644 --- a/utils.cpp +++ b/utils.cpp @@ -76,7 +76,7 @@ void Shape::init() int major, minor; if( !XShapeQueryVersion( display(), &major, &minor )) return; - kwin_shape_version = major * 16 + minor; + kwin_shape_version = major * 0x10 + minor; } void Motif::readFlags( WId w, bool& noborder, bool& resize, bool& move, diff --git a/utils.h b/utils.h index eb0e4318e3..d5cea983e4 100644 --- a/utils.h +++ b/utils.h @@ -113,16 +113,20 @@ class Shape { public: static bool available() { return kwin_shape_version > 0; } - static int major() { return kwin_shape_version / 16; } - static int minor() { return kwin_shape_version % 16; } + static int version() { return kwin_shape_version; } // as 16*major+minor, i.e. two hex digits static bool hasShape( WId w); static int shapeEvent(); static void init(); private: - static int kwin_shape_version; // as 16*major+minor + static int kwin_shape_version; static int kwin_shape_event; }; +// compile with XShape older than 1.0 +#ifndef ShapeInput +const int ShapeInput = 2; +#endif + class Motif { public: