summaryrefslogtreecommitdiff
path: root/mi/mioverlay.c
diff options
context:
space:
mode:
authorPierre-Loup A. Griffais <pgriffais@nvidia.com>2010-05-27 09:11:50 -0700
committerKeith Packard <keithp@keithp.com>2010-06-02 21:11:31 -0700
commit643cb6e87c10ab554c03ada81930001a8ebcc909 (patch)
tree1a833b1d1bee3013ce8e6c3bfb60bb77b66b889f /mi/mioverlay.c
parentd90f2cd98a97e6534792d3867b3fba70d850b706 (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>
Diffstat (limited to 'mi/mioverlay.c')
-rw-r--r--mi/mioverlay.c81
1 files changed, 42 insertions, 39 deletions
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 2de768215..df43196df 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -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,53 +1498,55 @@ 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);
}