From 50a788d6335cfc99fd405db36697dc812801f463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Sun, 29 Apr 2007 21:59:40 +0000 Subject: [PATCH] Merging from old trunk: r594160 | lunakl | 2006-10-10 12:28:32 +0200 (Tue, 10 Oct 2006) | 6 lines Build the input shape on a helper window instead of directly, this avoids having a hole in the shape temporarily. This seems to break non-click-to-focus mouse policies on some systems (works fine here though). svn path=/trunk/KDE/kdebase/workspace/; revision=659292 --- client.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/client.cpp b/client.cpp index 4364e0eacf..44b4a4462b 100644 --- a/client.cpp +++ b/client.cpp @@ -475,17 +475,30 @@ void Client::updateShape() // calls it or when the decoration is created/destroyed 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) - XShapeCombineShape( display(), frameId(), ShapeInput, 0, 0, + { // There appears to be no way to find out if a window has input + // shape set or not, so always propagate the input shape + // (it's the same like the bounding shape by default). + // Also, build the shape using a helper window, not directly + // in the frame window, because the sequence set-shape-to-frame, + // remove-shape-of-client, add-input-shape-of-client has the problem + // that after the second step there's a hole in the input shape + // until the real shape of the client is added and that can make + // the window lose focus (which is a problem with mouse focus policies) + static Window helper_window = None; + if( helper_window == None ) + helper_window = XCreateSimpleWindow( display(), rootWindow(), + 0, 0, 1, 1, 0, 0, 0 ); + XResizeWindow( display(), helper_window, width(), height()); + XShapeCombineShape( display(), helper_window, ShapeInput, 0, 0, frameId(), ShapeBounding, ShapeSet ); - XShapeCombineShape( display(), frameId(), ShapeInput, + XShapeCombineShape( display(), helper_window, ShapeInput, clientPos().x(), clientPos().y(), window(), ShapeBounding, ShapeSubtract ); - XShapeCombineShape( display(), frameId(), ShapeInput, + XShapeCombineShape( display(), helper_window, ShapeInput, clientPos().x(), clientPos().y(), window(), ShapeInput, ShapeUnion ); + XShapeCombineShape( display(), frameId(), ShapeInput, 0, 0, + helper_window, ShapeInput, ShapeSet ); } if( compositing()) addDamageFull();