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:
parent
d90f2cd98a
commit
643cb6e87c
|
@ -220,7 +220,7 @@ RegionOperate (
|
||||||
}
|
}
|
||||||
if (srcRgn)
|
if (srcRgn)
|
||||||
REGION_DESTROY(pScreen, srcRgn);
|
REGION_DESTROY(pScreen, srcRgn);
|
||||||
(*pScreen->SetShape) (pWin);
|
(*pScreen->SetShape) (pWin, kind);
|
||||||
SendShapeNotify (pWin, kind);
|
SendShapeNotify (pWin, kind);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -642,7 +642,7 @@ ProcShapeOffset (ClientPtr client)
|
||||||
if (srcRgn)
|
if (srcRgn)
|
||||||
{
|
{
|
||||||
REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff);
|
REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff);
|
||||||
(*pScreen->SetShape) (pWin);
|
(*pScreen->SetShape) (pWin, stuff->destKind);
|
||||||
}
|
}
|
||||||
SendShapeNotify (pWin, (int)stuff->destKind);
|
SendShapeNotify (pWin, (int)stuff->destKind);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
|
@ -991,7 +991,7 @@ static void dmxDoSetShape(WindowPtr pWindow)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set shape of \a pWindow on the back-end server. */
|
/** 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;
|
ScreenPtr pScreen = pWindow->drawable.pScreen;
|
||||||
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
|
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
|
||||||
|
@ -1000,7 +1000,7 @@ void dmxSetShape(WindowPtr pWindow)
|
||||||
DMX_UNWRAP(SetShape, dmxScreen, pScreen);
|
DMX_UNWRAP(SetShape, dmxScreen, pScreen);
|
||||||
#if 1
|
#if 1
|
||||||
if (pScreen->SetShape)
|
if (pScreen->SetShape)
|
||||||
pScreen->SetShape(pWindow);
|
pScreen->SetShape(pWindow, kind);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (pWinPriv->window) {
|
if (pWinPriv->window) {
|
||||||
|
|
|
@ -94,7 +94,7 @@ extern void dmxResizeRootWindow(WindowPtr pRoot,
|
||||||
extern Bool dmxBEDestroyWindow(WindowPtr pWindow);
|
extern Bool dmxBEDestroyWindow(WindowPtr pWindow);
|
||||||
|
|
||||||
/* Support for shape extension */
|
/* Support for shape extension */
|
||||||
extern void dmxSetShape(WindowPtr pWindow);
|
extern void dmxSetShape(WindowPtr pWindow, int kind);
|
||||||
|
|
||||||
/** Private index. \see dmxwindow.c \see dmxscrinit.c */
|
/** Private index. \see dmxwindow.c \see dmxscrinit.c */
|
||||||
extern DevPrivateKey dmxWinPrivateKey;
|
extern DevPrivateKey dmxWinPrivateKey;
|
||||||
|
|
|
@ -423,10 +423,10 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
xnestSetShape(WindowPtr pWin)
|
xnestSetShape(WindowPtr pWin, int kind)
|
||||||
{
|
{
|
||||||
xnestShapeWindow(pWin);
|
xnestShapeWindow(pWin);
|
||||||
miSetShape(pWin);
|
miSetShape(pWin, kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
|
|
@ -66,7 +66,7 @@ void xnestCopyWindow(WindowPtr pWin, xPoint oldOrigin, RegionPtr oldRegion);
|
||||||
void xnestClipNotify(WindowPtr pWin, int dx, int dy);
|
void xnestClipNotify(WindowPtr pWin, int dx, int dy);
|
||||||
void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn,
|
void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn,
|
||||||
RegionPtr other_exposed);
|
RegionPtr other_exposed);
|
||||||
void xnestSetShape(WindowPtr pWin);
|
void xnestSetShape(WindowPtr pWin, int kind);
|
||||||
void xnestShapeWindow(WindowPtr pWin);
|
void xnestShapeWindow(WindowPtr pWin);
|
||||||
|
|
||||||
#endif /* XNESTWINDOW_H */
|
#endif /* XNESTWINDOW_H */
|
||||||
|
|
|
@ -1204,7 +1204,7 @@ Bool
|
||||||
winMapWindowRootless (WindowPtr pWindow);
|
winMapWindowRootless (WindowPtr pWindow);
|
||||||
|
|
||||||
void
|
void
|
||||||
winSetShapeRootless (WindowPtr pWindow);
|
winSetShapeRootless (WindowPtr pWindow, int kind);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1226,7 +1226,7 @@ void
|
||||||
winReshapeMultiWindow (WindowPtr pWin);
|
winReshapeMultiWindow (WindowPtr pWin);
|
||||||
|
|
||||||
void
|
void
|
||||||
winSetShapeMultiWindow (WindowPtr pWindow);
|
winSetShapeMultiWindow (WindowPtr pWindow, int kind);
|
||||||
|
|
||||||
void
|
void
|
||||||
winUpdateRgnMultiWindow (WindowPtr pWindow);
|
winUpdateRgnMultiWindow (WindowPtr pWindow);
|
||||||
|
|
|
@ -41,17 +41,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
winSetShapeMultiWindow (WindowPtr pWin)
|
winSetShapeMultiWindow (WindowPtr pWin, int kind)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
winScreenPriv(pScreen);
|
winScreenPriv(pScreen);
|
||||||
|
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
ErrorF ("winSetShapeMultiWindow - pWin: %08x\n", pWin);
|
ErrorF ("winSetShapeMultiWindow - pWin: %08x kind: %i\n", pWin, kind);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WIN_UNWRAP(SetShape);
|
WIN_UNWRAP(SetShape);
|
||||||
(*pScreen->SetShape)(pWin);
|
(*pScreen->SetShape)(pWin, kind);
|
||||||
WIN_WRAP(SetShape, winSetShapeMultiWindow);
|
WIN_WRAP(SetShape, winSetShapeMultiWindow);
|
||||||
|
|
||||||
/* Update the Windows window's shape */
|
/* Update the Windows window's shape */
|
||||||
|
|
|
@ -451,17 +451,17 @@ winMapWindowRootless (WindowPtr pWin)
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
winSetShapeRootless (WindowPtr pWin)
|
winSetShapeRootless (WindowPtr pWin, int kind)
|
||||||
{
|
{
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
winScreenPriv(pScreen);
|
winScreenPriv(pScreen);
|
||||||
|
|
||||||
#if CYGDEBUG
|
#if CYGDEBUG
|
||||||
winTrace ("winSetShapeRootless (%p)\n", pWin);
|
winTrace ("winSetShapeRootless (%p, %i)\n", pWin, kind);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WIN_UNWRAP(SetShape);
|
WIN_UNWRAP(SetShape);
|
||||||
(*pScreen->SetShape)(pWin);
|
(*pScreen->SetShape)(pWin, kind);
|
||||||
WIN_WRAP(SetShape, winSetShapeRootless);
|
WIN_WRAP(SetShape, winSetShapeRootless);
|
||||||
|
|
||||||
winReshapeRootless (pWin);
|
winReshapeRootless (pWin);
|
||||||
|
|
|
@ -423,7 +423,8 @@ typedef void (* ReparentWindowProcPtr)(
|
||||||
WindowPtr /*pPriorParent*/);
|
WindowPtr /*pPriorParent*/);
|
||||||
|
|
||||||
typedef void (* SetShapeProcPtr)(
|
typedef void (* SetShapeProcPtr)(
|
||||||
WindowPtr /*pWin*/);
|
WindowPtr /*pWin*/,
|
||||||
|
int /* kind */);
|
||||||
|
|
||||||
typedef void (* ChangeBorderWidthProcPtr)(
|
typedef void (* ChangeBorderWidthProcPtr)(
|
||||||
WindowPtr /*pWin*/,
|
WindowPtr /*pWin*/,
|
||||||
|
|
3
mi/mi.h
3
mi/mi.h
|
@ -567,7 +567,8 @@ extern _X_EXPORT WindowPtr miGetLayerWindow(
|
||||||
);
|
);
|
||||||
|
|
||||||
extern _X_EXPORT void miSetShape(
|
extern _X_EXPORT void miSetShape(
|
||||||
WindowPtr /*pWin*/
|
WindowPtr /*pWin*/,
|
||||||
|
int /*kind*/
|
||||||
);
|
);
|
||||||
|
|
||||||
extern _X_EXPORT void miChangeBorderWidth(
|
extern _X_EXPORT void miChangeBorderWidth(
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
#include <X11/extensions/shapeproto.h>
|
||||||
#include "validate.h"
|
#include "validate.h"
|
||||||
#include "windowstr.h"
|
#include "windowstr.h"
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
@ -82,7 +83,7 @@ static void miOverlayResizeWindow(WindowPtr, int, int, unsigned int,
|
||||||
unsigned int, WindowPtr);
|
unsigned int, WindowPtr);
|
||||||
static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool);
|
static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool);
|
||||||
|
|
||||||
static void miOverlaySetShape(WindowPtr);
|
static void miOverlaySetShape(WindowPtr, int);
|
||||||
static void miOverlayChangeBorderWidth(WindowPtr, unsigned int);
|
static void miOverlayChangeBorderWidth(WindowPtr, unsigned int);
|
||||||
|
|
||||||
#define MIOVERLAY_GET_SCREEN_PRIVATE(pScreen) ((miOverlayScreenPtr) \
|
#define MIOVERLAY_GET_SCREEN_PRIVATE(pScreen) ((miOverlayScreenPtr) \
|
||||||
|
@ -1497,53 +1498,55 @@ miOverlayResizeWindow(
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
miOverlaySetShape(WindowPtr pWin)
|
miOverlaySetShape(WindowPtr pWin, int kind)
|
||||||
{
|
{
|
||||||
Bool WasViewable = (Bool)(pWin->viewable);
|
Bool WasViewable = (Bool)(pWin->viewable);
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
if (WasViewable) {
|
if (kind != ShapeInput) {
|
||||||
(*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
|
if (WasViewable) {
|
||||||
|
(*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
|
||||||
|
|
||||||
if (HasBorder (pWin)) {
|
if (HasBorder (pWin)) {
|
||||||
RegionPtr borderVisible;
|
RegionPtr borderVisible;
|
||||||
|
|
||||||
borderVisible = REGION_CREATE(pScreen, NullBox, 1);
|
borderVisible = REGION_CREATE(pScreen, NullBox, 1);
|
||||||
REGION_SUBTRACT(pScreen, borderVisible,
|
REGION_SUBTRACT(pScreen, borderVisible,
|
||||||
&pWin->borderClip, &pWin->winSize);
|
&pWin->borderClip, &pWin->winSize);
|
||||||
pWin->valdata->before.borderVisible = borderVisible;
|
pWin->valdata->before.borderVisible = borderVisible;
|
||||||
pWin->valdata->before.resized = TRUE;
|
pWin->valdata->before.resized = TRUE;
|
||||||
if(IN_UNDERLAY(pWin)) {
|
if(IN_UNDERLAY(pWin)) {
|
||||||
miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
|
miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
|
||||||
RegionPtr borderVisible2;
|
RegionPtr borderVisible2;
|
||||||
|
|
||||||
borderVisible2 = REGION_CREATE(pScreen, NULL, 1);
|
borderVisible2 = REGION_CREATE(pScreen, NULL, 1);
|
||||||
REGION_SUBTRACT(pScreen, borderVisible2,
|
REGION_SUBTRACT(pScreen, borderVisible2,
|
||||||
&pTree->borderClip, &pWin->winSize);
|
&pTree->borderClip, &pWin->winSize);
|
||||||
pTree->valdata->borderVisible = borderVisible2;
|
pTree->valdata->borderVisible = borderVisible2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetWinSize (pWin);
|
SetWinSize (pWin);
|
||||||
SetBorderSize (pWin);
|
SetBorderSize (pWin);
|
||||||
|
|
||||||
ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
|
ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
|
||||||
|
|
||||||
if (WasViewable) {
|
if (WasViewable) {
|
||||||
(*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
|
(*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL);
|
||||||
|
|
||||||
|
|
||||||
(*pScreen->ValidateTree)(pWin->parent, NullWindow, VTOther);
|
(*pScreen->ValidateTree)(pWin->parent, NullWindow, VTOther);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WasViewable) {
|
if (WasViewable) {
|
||||||
(*pScreen->HandleExposures)(pWin->parent);
|
(*pScreen->HandleExposures)(pWin->parent);
|
||||||
if (pScreen->PostValidateTree)
|
if (pScreen->PostValidateTree)
|
||||||
(*pScreen->PostValidateTree)(pWin->parent, NullWindow, VTOther);
|
(*pScreen->PostValidateTree)(pWin->parent, NullWindow, VTOther);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pWin->realized)
|
if (pWin->realized)
|
||||||
WindowsRestructured ();
|
WindowsRestructured ();
|
||||||
CheckCursorConfinement(pWin);
|
CheckCursorConfinement(pWin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ SOFTWARE.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
#include <X11/extensions/shape.h>
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
#include "mi.h"
|
#include "mi.h"
|
||||||
|
@ -696,56 +697,59 @@ miGetLayerWindow(WindowPtr pWin)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
miSetShape(WindowPtr pWin)
|
miSetShape(WindowPtr pWin, int kind)
|
||||||
{
|
{
|
||||||
Bool WasViewable = (Bool)(pWin->viewable);
|
Bool WasViewable = (Bool)(pWin->viewable);
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
Bool anyMarked = FALSE;
|
Bool anyMarked = FALSE;
|
||||||
WindowPtr pLayerWin;
|
WindowPtr pLayerWin;
|
||||||
|
|
||||||
if (WasViewable)
|
if (kind != ShapeInput) {
|
||||||
{
|
if (WasViewable)
|
||||||
anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin,
|
{
|
||||||
&pLayerWin);
|
anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin,
|
||||||
if (pWin->valdata)
|
&pLayerWin);
|
||||||
{
|
if (pWin->valdata)
|
||||||
if (HasBorder (pWin))
|
{
|
||||||
{
|
if (HasBorder (pWin))
|
||||||
RegionPtr borderVisible;
|
{
|
||||||
|
RegionPtr borderVisible;
|
||||||
|
|
||||||
borderVisible = REGION_CREATE(pScreen, NullBox, 1);
|
borderVisible = REGION_CREATE(pScreen, NullBox, 1);
|
||||||
REGION_SUBTRACT(pScreen, borderVisible,
|
REGION_SUBTRACT(pScreen, borderVisible,
|
||||||
&pWin->borderClip, &pWin->winSize);
|
&pWin->borderClip, &pWin->winSize);
|
||||||
pWin->valdata->before.borderVisible = borderVisible;
|
pWin->valdata->before.borderVisible = borderVisible;
|
||||||
}
|
}
|
||||||
pWin->valdata->before.resized = TRUE;
|
pWin->valdata->before.resized = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetWinSize (pWin);
|
SetWinSize (pWin);
|
||||||
SetBorderSize (pWin);
|
SetBorderSize (pWin);
|
||||||
|
|
||||||
ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
|
ResizeChildrenWinSize(pWin, 0, 0, 0, 0);
|
||||||
|
|
||||||
if (WasViewable)
|
if (WasViewable)
|
||||||
{
|
{
|
||||||
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
|
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
if (anyMarked)
|
||||||
|
(*pScreen->ValidateTree)(pLayerWin->parent, NullWindow,
|
||||||
|
VTOther);
|
||||||
|
}
|
||||||
|
|
||||||
if (anyMarked)
|
if (WasViewable)
|
||||||
(*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, VTOther);
|
{
|
||||||
}
|
if (anyMarked)
|
||||||
|
(*pScreen->HandleExposures)(pLayerWin->parent);
|
||||||
if (WasViewable)
|
if (anyMarked && pScreen->PostValidateTree)
|
||||||
{
|
(*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow,
|
||||||
if (anyMarked)
|
VTOther);
|
||||||
(*pScreen->HandleExposures)(pLayerWin->parent);
|
}
|
||||||
if (anyMarked && pScreen->PostValidateTree)
|
|
||||||
(*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, VTOther);
|
|
||||||
}
|
}
|
||||||
if (pWin->realized)
|
if (pWin->realized)
|
||||||
WindowsRestructured ();
|
WindowsRestructured ();
|
||||||
CheckCursorConfinement(pWin);
|
CheckCursorConfinement(pWin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -733,7 +733,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
|
||||||
if (*pDestRegion)
|
if (*pDestRegion)
|
||||||
REGION_DESTROY(pScreen, *pDestRegion);
|
REGION_DESTROY(pScreen, *pDestRegion);
|
||||||
*pDestRegion = pRegion;
|
*pDestRegion = pRegion;
|
||||||
(*pScreen->SetShape) (pWin);
|
(*pScreen->SetShape) (pWin, stuff->destKind);
|
||||||
SendShapeNotify (pWin, stuff->destKind);
|
SendShapeNotify (pWin, stuff->destKind);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue