Move child in its original parent if no destination child is found. Show all children...
authorPhilippe Brochard <pbrochard@common-lisp.net>
Thu, 10 Jan 2013 10:18:31 +0000 (10 11:18 +0100)
committerPhilippe Brochard <pbrochard@common-lisp.net>
Thu, 10 Jan 2013 10:18:31 +0000 (10 11:18 +0100)
src/clfswm-util.lisp

index 859ef9f..6ccabf1 100644 (file)
@@ -1248,16 +1248,18 @@ For window: set current child to window or its parent according to window-parent
   (let ((child (find-child-under-mouse root-x root-y)))
     (unless (child-root-p child)
       (hide-all child)
-      (remove-child-in-frame child (find-parent-frame child))
-      (wait-mouse-button-release 50 51)
-      (multiple-value-bind (x y)
-         (xlib:query-pointer *root*)
-       (let ((dest (find-child-under-mouse x y)))
-         (when (xlib:window-p dest)
-           (setf dest (find-parent-frame dest)))
-         (unless (child-equal-p child dest)
-           (move-child-to child dest)
-           (show-all-children))))))
+      (let ((parent (find-parent-frame child)))
+        (remove-child-in-frame child parent)
+        (show-all-children)
+        (wait-mouse-button-release 50 51)
+        (multiple-value-bind (x y)
+            (xlib:query-pointer *root*)
+          (let ((dest (find-child-under-mouse x y)))
+            (when (xlib:window-p dest)
+              (setf dest (find-parent-frame dest)))
+            (unless (child-equal-p child dest)
+              (move-child-to child (or dest parent))))))
+      (show-all-children)))
   (stop-button-event))