diff --git a/src/root-manager.scm b/src/root-manager.scm index ab433fa..304261c 100644 --- a/src/root-manager.scm +++ b/src/root-manager.scm @@ -125,11 +125,19 @@ (sync-point-wait (root-wm:finish root-wm))) (define (root-wm-manage-window root-wm window) - (set-wm-state! (root-wm:dpy root-wm) window (wm-state normal) none) - (wm-manage-window (root-wm:current-manager root-wm) window)) + (let ((dpy (root-wm:dpy root-wm))) + (if (window-exists? dpy window) + (begin + ;; TODO: initial-state iconic ?? + (set-wm-state! (root-wm:dpy root-wm) window (wm-state normal) none) + (wm-manage-window (root-wm:current-manager root-wm) window + (window-rectangle dpy window)))))) (define (root-wm-configure-window root-wm window changes) - (wm-configure-window (root-wm:current-manager root-wm) window changes)) + (let ((wm (manager-of-window root-wm window))) + (mdisplay "root-wm configure: " (list wm window changes) "\n") + (wm-configure-window (or wm (root-wm:current-manager root-wm)) + window changes))) (define (handle-xevent root-wm exit xevent) (let ((type (any-event-type xevent))