Fix compilation with older XShape (#132310).

svn path=/trunk/KDE/kdebase/workspace/; revision=573246
This commit is contained in:
Luboš Luňák 2006-08-15 12:48:37 +00:00
parent 48fd383949
commit 093617aafb
3 changed files with 9 additions and 5 deletions

View file

@ -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)

View file

@ -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,

10
utils.h
View file

@ -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: