diff options
author | Pierre-Loup A. Griffais <pgriffais@nvidia.com> | 2010-05-27 09:11:50 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-06-02 21:11:31 -0700 |
commit | 643cb6e87c10ab554c03ada81930001a8ebcc909 (patch) | |
tree | 1a833b1d1bee3013ce8e6c3bfb60bb77b66b889f | |
parent | d90f2cd98a97e6534792d3867b3fba70d850b706 (diff) |
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>
-rw-r--r-- | Xext/shape.c | 4 | ||||
-rw-r--r-- | hw/dmx/dmxwindow.c | 4 | ||||
-rw-r--r-- | hw/dmx/dmxwindow.h | 2 | ||||
-rw-r--r-- | hw/xnest/Window.c | 4 | ||||
-rw-r--r-- | hw/xnest/XNWindow.h | 2 | ||||
-rw-r--r-- | hw/xwin/win.h | 4 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowshape.c | 6 | ||||
-rw-r--r-- | hw/xwin/winwindow.c | 6 | ||||
-rw-r--r-- | include/scrnintstr.h | 3 | ||||
-rw-r--r-- | mi/mi.h | 3 | ||||
-rw-r--r-- | mi/mioverlay.c | 81 | ||||
-rw-r--r-- | mi/miwindow.c | 94 | ||||
-rw-r--r-- | xfixes/region.c | 2 |
13 files changed, 112 insertions, 103 deletions
diff --git a/Xext/shape.c b/Xext/shape.c index 93e4703e9..86b0bc0ec 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -222,3 +222,3 @@ RegionOperate ( REGION_DESTROY(pScreen, srcRgn); - (*pScreen->SetShape) (pWin); + (*pScreen->SetShape) (pWin, kind); SendShapeNotify (pWin, kind); @@ -644,3 +644,3 @@ ProcShapeOffset (ClientPtr client) REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff); - (*pScreen->SetShape) (pWin); + (*pScreen->SetShape) (pWin, stuff->destKind); } diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index 39af51032..5b0baff3a 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -993,3 +993,3 @@ 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) { @@ -1002,3 +1002,3 @@ void dmxSetShape(WindowPtr pWindow) if (pScreen->SetShape) - pScreen->SetShape(pWindow); + pScreen->SetShape(pWindow, kind); #endif diff --git a/hw/dmx/dmxwindow.h b/hw/dmx/dmxwindow.h index 740a21f0b..8bd1f74bd 100644 --- a/hw/dmx/dmxwindow.h +++ b/hw/dmx/dmxwindow.h @@ -96,3 +96,3 @@ extern Bool dmxBEDestroyWindow(WindowPtr pWindow); /* Support for shape extension */ -extern void dmxSetShape(WindowPtr pWindow); +extern void dmxSetShape(WindowPtr pWindow, int kind); diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index 48c870fac..11d53694e 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -425,6 +425,6 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed) void -xnestSetShape(WindowPtr pWin) +xnestSetShape(WindowPtr pWin, int kind) { xnestShapeWindow(pWin); - miSetShape(pWin); + miSetShape(pWin, kind); } diff --git a/hw/xnest/XNWindow.h b/hw/xnest/XNWindow.h index b59d86a97..92a190208 100644 --- a/hw/xnest/XNWindow.h +++ b/hw/xnest/XNWindow.h @@ -68,3 +68,3 @@ void xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed); -void xnestSetShape(WindowPtr pWin); +void xnestSetShape(WindowPtr pWin, int kind); void xnestShapeWindow(WindowPtr pWin); diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 26bb856e9..49b73d746 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -1206,3 +1206,3 @@ winMapWindowRootless (WindowPtr pWindow); void -winSetShapeRootless (WindowPtr pWindow); +winSetShapeRootless (WindowPtr pWindow, int kind); @@ -1228,3 +1228,3 @@ winReshapeMultiWindow (WindowPtr pWin); void -winSetShapeMultiWindow (WindowPtr pWindow); +winSetShapeMultiWindow (WindowPtr pWindow, int kind); diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c index 353235760..597eab62c 100644 --- a/hw/xwin/winmultiwindowshape.c +++ b/hw/xwin/winmultiwindowshape.c @@ -43,3 +43,3 @@ void -winSetShapeMultiWindow (WindowPtr pWin) +winSetShapeMultiWindow (WindowPtr pWin, int kind) { @@ -49,3 +49,3 @@ winSetShapeMultiWindow (WindowPtr pWin) #if CYGMULTIWINDOW_DEBUG - ErrorF ("winSetShapeMultiWindow - pWin: %08x\n", pWin); + ErrorF ("winSetShapeMultiWindow - pWin: %08x kind: %i\n", pWin, kind); #endif @@ -53,3 +53,3 @@ winSetShapeMultiWindow (WindowPtr pWin) WIN_UNWRAP(SetShape); - (*pScreen->SetShape)(pWin); + (*pScreen->SetShape)(pWin, kind); WIN_WRAP(SetShape, winSetShapeMultiWindow); diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c index 30b672941..d0c360f34 100644 --- a/hw/xwin/winwindow.c +++ b/hw/xwin/winwindow.c @@ -453,3 +453,3 @@ winMapWindowRootless (WindowPtr pWin) void -winSetShapeRootless (WindowPtr pWin) +winSetShapeRootless (WindowPtr pWin, int kind) { @@ -459,3 +459,3 @@ winSetShapeRootless (WindowPtr pWin) #if CYGDEBUG - winTrace ("winSetShapeRootless (%p)\n", pWin); + winTrace ("winSetShapeRootless (%p, %i)\n", pWin, kind); #endif @@ -463,3 +463,3 @@ winSetShapeRootless (WindowPtr pWin) WIN_UNWRAP(SetShape); - (*pScreen->SetShape)(pWin); + (*pScreen->SetShape)(pWin, kind); WIN_WRAP(SetShape, winSetShapeRootless); diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 6f1936c1f..21b4a1600 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -425,3 +425,4 @@ typedef void (* ReparentWindowProcPtr)( typedef void (* SetShapeProcPtr)( - WindowPtr /*pWin*/); + WindowPtr /*pWin*/, + int /* kind */); @@ -569,3 +569,4 @@ extern _X_EXPORT WindowPtr miGetLayerWindow( extern _X_EXPORT void miSetShape( - WindowPtr /*pWin*/ + WindowPtr /*pWin*/, + int /*kind*/ ); diff --git a/mi/mioverlay.c b/mi/mioverlay.c index 2de768215..df43196df 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -7,2 +7,3 @@ #include "scrnintstr.h" +#include <X11/extensions/shapeproto.h> #include "validate.h" @@ -84,3 +85,3 @@ static void miOverlayClearToBackground(WindowPtr, int, int, int, int, Bool); -static void miOverlaySetShape(WindowPtr); +static void miOverlaySetShape(WindowPtr, int); static void miOverlayChangeBorderWidth(WindowPtr, unsigned int); @@ -1499,49 +1500,51 @@ miOverlayResizeWindow( static void -miOverlaySetShape(WindowPtr pWin) +miOverlaySetShape(WindowPtr pWin, int kind) { - Bool WasViewable = (Bool)(pWin->viewable); - ScreenPtr pScreen = pWin->drawable.pScreen; - - if (WasViewable) { - (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); - - if (HasBorder (pWin)) { - RegionPtr borderVisible; - - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - pWin->valdata->before.resized = TRUE; - if(IN_UNDERLAY(pWin)) { - miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); - RegionPtr borderVisible2; - - borderVisible2 = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible2, - &pTree->borderClip, &pWin->winSize); - pTree->valdata->borderVisible = borderVisible2; - } - } - } + Bool WasViewable = (Bool)(pWin->viewable); + ScreenPtr pScreen = pWin->drawable.pScreen; + + if (kind != ShapeInput) { + if (WasViewable) { + (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); + + if (HasBorder (pWin)) { + RegionPtr borderVisible; + + borderVisible = REGION_CREATE(pScreen, NullBox, 1); + REGION_SUBTRACT(pScreen, borderVisible, + &pWin->borderClip, &pWin->winSize); + pWin->valdata->before.borderVisible = borderVisible; + pWin->valdata->before.resized = TRUE; + if(IN_UNDERLAY(pWin)) { + miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); + RegionPtr borderVisible2; + + borderVisible2 = REGION_CREATE(pScreen, NULL, 1); + REGION_SUBTRACT(pScreen, borderVisible2, + &pTree->borderClip, &pWin->winSize); + pTree->valdata->borderVisible = borderVisible2; + } + } + } - SetWinSize (pWin); - SetBorderSize (pWin); + SetWinSize (pWin); + SetBorderSize (pWin); - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); + ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - if (WasViewable) { - (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); + if (WasViewable) { + (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); - (*pScreen->ValidateTree)(pWin->parent, NullWindow, VTOther); - } + (*pScreen->ValidateTree)(pWin->parent, NullWindow, VTOther); + } - if (WasViewable) { - (*pScreen->HandleExposures)(pWin->parent); - if (pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pWin->parent, NullWindow, VTOther); + if (WasViewable) { + (*pScreen->HandleExposures)(pWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree)(pWin->parent, NullWindow, VTOther); + } } if (pWin->realized) - WindowsRestructured (); + WindowsRestructured (); CheckCursorConfinement(pWin); diff --git a/mi/miwindow.c b/mi/miwindow.c index 2550ca209..ce3597429 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -52,2 +52,3 @@ SOFTWARE. #include <X11/X.h> +#include <X11/extensions/shape.h> #include "regionstr.h" @@ -698,52 +699,55 @@ 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; + Bool WasViewable = (Bool)(pWin->viewable); + ScreenPtr pScreen = pWin->drawable.pScreen; + Bool anyMarked = FALSE; WindowPtr pLayerWin; - if (WasViewable) - { - anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, - &pLayerWin); - if (pWin->valdata) - { - if (HasBorder (pWin)) - { - RegionPtr borderVisible; - - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, - &pWin->borderClip, &pWin->winSize); - pWin->valdata->before.borderVisible = borderVisible; - } - pWin->valdata->before.resized = TRUE; - } - } - - SetWinSize (pWin); - SetBorderSize (pWin); - - ResizeChildrenWinSize(pWin, 0, 0, 0, 0); - - if (WasViewable) - { - anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, - NULL); - - - if (anyMarked) - (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, VTOther); - } - - if (WasViewable) - { - if (anyMarked) - (*pScreen->HandleExposures)(pLayerWin->parent); - if (anyMarked && pScreen->PostValidateTree) - (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, VTOther); + if (kind != ShapeInput) { + if (WasViewable) + { + anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, + &pLayerWin); + if (pWin->valdata) + { + if (HasBorder (pWin)) + { + RegionPtr borderVisible; + + borderVisible = REGION_CREATE(pScreen, NullBox, 1); + REGION_SUBTRACT(pScreen, borderVisible, + &pWin->borderClip, &pWin->winSize); + pWin->valdata->before.borderVisible = borderVisible; + } + pWin->valdata->before.resized = TRUE; + } + } + + SetWinSize (pWin); + SetBorderSize (pWin); + + ResizeChildrenWinSize(pWin, 0, 0, 0, 0); + + if (WasViewable) + { + anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin, + NULL); + + if (anyMarked) + (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, + VTOther); + } + + if (WasViewable) + { + if (anyMarked) + (*pScreen->HandleExposures)(pLayerWin->parent); + if (anyMarked && pScreen->PostValidateTree) + (*pScreen->PostValidateTree)(pLayerWin->parent, NullWindow, + VTOther); + } } if (pWin->realized) - WindowsRestructured (); + WindowsRestructured (); CheckCursorConfinement(pWin); diff --git a/xfixes/region.c b/xfixes/region.c index 7a71c78f9..b034ad01d 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -735,3 +735,3 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) *pDestRegion = pRegion; - (*pScreen->SetShape) (pWin); + (*pScreen->SetShape) (pWin, stuff->destKind); SendShapeNotify (pWin, stuff->destKind); |