summaryrefslogtreecommitdiff
path: root/mi
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
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')
-rw-r--r--mi/mi.h3
-rw-r--r--mi/mioverlay.c81
-rw-r--r--mi/miwindow.c94
3 files changed, 93 insertions, 85 deletions
diff --git a/mi/mi.h b/mi/mi.h
index 812edce94..321523b98 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -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(
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);
}
diff --git a/mi/miwindow.c b/mi/miwindow.c
index 2550ca209..ce3597429 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -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,56 +697,59 @@ 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);
}