Only deal with input code when changing the input shape.

Propagate the shape kind all the way to SetShape to avoid performing non-input
operations such as revalidating the tree and generating exposures when only
changing a window's input shape.

Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com>
Acked-by: Aaron Plattner<aplattner@nvidia.com>
Reviewed-by: Daniel Stone<daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Pierre-Loup A. Griffais 2010-05-27 09:11:50 -07:00 committed by Keith Packard
parent d90f2cd98a
commit 643cb6e87c
13 changed files with 102 additions and 93 deletions

View File

@ -220,7 +220,7 @@ RegionOperate (
}
if (srcRgn)
REGION_DESTROY(pScreen, srcRgn);
(*pScreen->SetShape) (pWin);
(*pScreen->SetShape) (pWin, kind);
SendShapeNotify (pWin, kind);
return Success;
}
@ -642,7 +642,7 @@ ProcShapeOffset (ClientPtr client)
if (srcRgn)
{
REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff);
(*pScreen->SetShape) (pWin);
(*pScreen->SetShape) (pWin, stuff->destKind);
}
SendShapeNotify (pWin, (int)stuff->destKind);
return Success;

View File

@ -991,7 +991,7 @@ static void dmxDoSetShape(WindowPtr pWindow)
}
/** Set shape of \a pWindow on the back-end server. */
void dmxSetShape(WindowPtr pWindow)
void dmxSetShape(WindowPtr pWindow, int kind)
{
ScreenPtr pScreen = pWindow->drawable.pScreen;
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
@ -1000,7 +1000,7 @@ void dmxSetShape(WindowPtr pWindow)
DMX_UNWRAP(SetShape, dmxScreen, pScreen);
#if 1
if (pScreen->SetShape)
pScreen->SetShape(pWindow);
pScreen->SetShape(pWindow, kind);
#endif
if (pWinPriv->window) {

View File

@ -94,7 +94,7 @@ extern void dmxResizeRootWindow(WindowPtr pRoot,
extern Bool dmxBEDestroyWindow(WindowPtr pWindow);
/* Support for shape extension */
extern void dmxSetShape(WindowPtr pWindow);
extern void dmxSetShape(WindowPtr pWindow, int kind);
/** Private index. \see dmxwindow.c \see dmxscrinit.c */
extern DevPrivateKey dmxWinPrivateKey;

View File

@ -423,10 +423,10 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed)
}
void
xnestSetShape(WindowPtr pWin)
xnestSetShape(WindowPtr pWin, int kind)
{
xnestShapeWindow(pWin);
miSetShape(pWin);
miSetShape(pWin, kind);
}
static Bool

View File

@ -66,7 +66,7 @@ void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion);
void xnestClipNotify(WindowPtr pWin, int dx, int dy);
void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn,
RegionPtr other_exposed);
void xnestSetShape(WindowPtr pWin);
void xnestSetShape(WindowPtr pWin, int kind);
void xnestShapeWindow(WindowPtr pWin);
#endif /* XNESTWINDOW_H */

View File

@ -1204,7 +1204,7 @@ Bool
winMapWindowRootless (WindowPtr pWindow);
void
winSetShapeRootless (WindowPtr pWindow);
winSetShapeRootless (WindowPtr pWindow, int kind);
/*
@ -1226,7 +1226,7 @@ void
winReshapeMultiWindow (WindowPtr pWin);
void
winSetShapeMultiWindow (WindowPtr pWindow);
winSetShapeMultiWindow (WindowPtr pWindow, int kind);
void
winUpdateRgnMultiWindow (WindowPtr pWindow);

View File

@ -41,17 +41,17 @@
*/
void
winSetShapeMultiWindow (WindowPtr pWin)
winSetShapeMultiWindow (WindowPtr pWin, int kind)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
winScreenPriv(pScreen);
#if CYGMULTIWINDOW_DEBUG
ErrorF ("winSetShapeMultiWindow - pWin: %08x\n", pWin);
ErrorF ("winSetShapeMultiWindow - pWin: %08x kind: %i\n", pWin, kind);
#endif
WIN_UNWRAP(SetShape);
(*pScreen->SetShape)(pWin);
(*pScreen->SetShape)(pWin, kind);
WIN_WRAP(SetShape, winSetShapeMultiWindow);
/* Update the Windows window's shape */

View File

@ -451,17 +451,17 @@ winMapWindowRootless (WindowPtr pWin)
void
winSetShapeRootless (WindowPtr pWin)
winSetShapeRootless (WindowPtr pWin, int kind)
{
ScreenPtr pScreen = pWin->drawable.pScreen;
winScreenPriv(pScreen);
#if CYGDEBUG
winTrace ("winSetShapeRootless (%p)\n", pWin);
winTrace ("winSetShapeRootless (%p, %i)\n", pWin, kind);
#endif
WIN_UNWRAP(SetShape);
(*pScreen->SetShape)(pWin);
(*pScreen->SetShape)(pWin, kind);
WIN_WRAP(SetShape, winSetShapeRootless);
winReshapeRootless (pWin);

View File

@ -423,7 +423,8 @@ typedef void (* ReparentWindowProcPtr)(
WindowPtr /*pPriorParent*/);
typedef void (* SetShapeProcPtr)(
WindowPtr /*pWin*/);
WindowPtr /*pWin*/,
int /* kind */);
typedef void (* ChangeBorderWidthProcPtr)(
WindowPtr /*pWin*/,

View File

@ -567,7 +567,8 @@ extern _X_EXPORT WindowPtr miGetLayerWindow(
);
extern _X_EXPORT void miSetShape(
WindowPtr /*pWin*/
WindowPtr /*pWin*/,
int /*kind*/
);
extern _X_EXPORT void miChangeBorderWidth(

View File

@ -5,6 +5,7 @@
#include <X11/X.h>
#include "scrnintstr.h"
#include <X11/extensions/shapeproto.h>
#include "validate.h"
#include "windowstr.h"
#include "mi.h"
@ -82,7 +83,7 @@ static void miOverlayResizeWindow(WindowPtr, int, int, unsigned int,
unsigned int, WindowPtr);
static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool);
static void miOverlaySetShape(WindowPtr);
static void miOverlaySetShape(WindowPtr, int);
static void miOverlayChangeBorderWidth(WindowPtr, unsigned int);
#define MIOVERLAY_GET_SCREEN_PRIVATE(pScreen) ((miOverlayScreenPtr) \
@ -1497,11 +1498,12 @@ miOverlayResizeWindow(
static void
miOverlaySetShape(WindowPtr pWin)
miOverlaySetShape(WindowPtr pWin, int kind)
{
Bool WasViewable = (Bool)(pWin->viewable);
ScreenPtr pScreen = pWin->drawable.pScreen;
if (kind != ShapeInput) {
if (WasViewable) {
(*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
@ -1542,6 +1544,7 @@ miOverlaySetShape(WindowPtr pWin)
if (pScreen->PostValidateTree)
(*pScreen->PostValidateTree)(pWin->parent, NullWindow, VTOther);
}
}
if (pWin->realized)
WindowsRestructured ();
CheckCursorConfinement(pWin);

View File

@ -50,6 +50,7 @@ SOFTWARE.
#endif
#include <X11/X.h>
#include <X11/extensions/shape.h>
#include "regionstr.h"
#include "region.h"
#include "mi.h"
@ -696,13 +697,14 @@ miGetLayerWindow(WindowPtr pWin)
*/
void
miSetShape(WindowPtr pWin)
miSetShape(WindowPtr pWin, int kind)
{
Bool WasViewable = (Bool)(pWin->viewable);
ScreenPtr pScreen = pWin->drawable.pScreen;
Bool anyMarked = FALSE;
WindowPtr pLayerWin;
if (kind != ShapeInput) {
if (WasViewable)
{
anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin,
@ -732,9 +734,9 @@ miSetShape(WindowPtr pWin)
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
NULL);
if (anyMarked)
(*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, VTOther);
(*pScreen->ValidateTree)(pLayerWin->parent, NullWindow,
VTOther);
}
if (WasViewable)
@ -742,7 +744,9 @@ miSetShape(WindowPtr pWin)
if (anyMarked)
(*pScreen->HandleExposures)(pLayerWin->parent);
if (anyMarked && pScreen->PostValidateTree)
(*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, VTOther);
(*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow,
VTOther);
}
}
if (pWin->realized)
WindowsRestructured ();

View File

@ -733,7 +733,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
if (*pDestRegion)
REGION_DESTROY(pScreen, *pDestRegion);
*pDestRegion = pRegion;
(*pScreen->SetShape) (pWin);
(*pScreen->SetShape) (pWin, stuff->destKind);
SendShapeNotify (pWin, stuff->destKind);
return Success;
}