[PATCH xserver] Fix race condition in ConfigureWindow

Erik Kurzinger ekurzinger at nvidia.com
Sat Oct 29 00:56:34 UTC 2016


Resubmitting with proper formatting, and a small change to the patch.

Signed-off-by: Erik Kurzinger <ekurzinger at nvidia.com>
---
  dix/window.c | 42 ++++++++++++++++++++++--------------------
  1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/dix/window.c b/dix/window.c
index ead4dc2..677fe65 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -2380,26 +2380,6 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)
          }
      }

-    if (SubStrSend(pWin, pParent)) {
-        xEvent event = {
-            .u.configureNotify.window = pWin->drawable.id,
-            .u.configureNotify.aboveSibling = pSib ? pSib->drawable.id : None,
-            .u.configureNotify.x = x,
-            .u.configureNotify.y = y,
-            .u.configureNotify.width = w,
-            .u.configureNotify.height = h,
-            .u.configureNotify.borderWidth = bw,
-            .u.configureNotify.override = pWin->overrideRedirect
-        };
-        event.u.u.type = ConfigureNotify;
-#ifdef PANORAMIX
-        if (!noPanoramiXExtension && (!pParent || !pParent->parent)) {
-            event.u.configureNotify.x += screenInfo.screens[0]->x;
-            event.u.configureNotify.y += screenInfo.screens[0]->y;
-        }
-#endif
-        DeliverEvents(pWin, &event, 1, NullWindow);
-    }
      if (mask & CWBorderWidth) {
          if (action == RESTACK_WIN) {
              action = MOVE_WIN;
@@ -2425,6 +2405,28 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client)

      if (action != RESTACK_WIN)
          CheckCursorConfinement(pWin);
+
+    if (SubStrSend(pWin, pParent)) {
+        xEvent event = {
+            .u.configureNotify.window = pWin->drawable.id,
+            .u.configureNotify.aboveSibling = pSib ? pSib->drawable.id : None,
+            .u.configureNotify.x = x,
+            .u.configureNotify.y = y,
+            .u.configureNotify.width = w,
+            .u.configureNotify.height = h,
+            .u.configureNotify.borderWidth = bw,
+            .u.configureNotify.override = pWin->overrideRedirect
+        };
+        event.u.u.type = ConfigureNotify;
+#ifdef PANORAMIX
+        if (!noPanoramiXExtension && (!pParent || !pParent->parent)) {
+            event.u.configureNotify.x += screenInfo.screens[0]->x;
+            event.u.configureNotify.y += screenInfo.screens[0]->y;
+        }
+#endif
+        DeliverEvents(pWin, &event, 1, NullWindow);
+    }
+
      return Success;
  #undef RESTACK_WIN
  #undef MOVE_WIN
-- 
2.7.4



More information about the xorg-devel mailing list