From: Philippe Brochard Date: Thu, 10 Jan 2013 10:18:31 +0000 (+0100) Subject: Move child in its original parent if no destination child is found. Show all children... X-Git-Url: https://repo.or.cz/w/clfswm.git/commitdiff_plain/53b3bd4d5badf51a6f69f3fba27b1b21fde7ba85 Move child in its original parent if no destination child is found. Show all children before waiting the child move. --- diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp index 859ef9f..6ccabf1 100644 --- a/src/clfswm-util.lisp +++ b/src/clfswm-util.lisp @@ -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))