(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))