From a6b01632ebac469d75a6e178f47ae1d371ae71e6 Mon Sep 17 00:00:00 2001 From: frese Date: Wed, 7 May 2003 14:48:16 +0000 Subject: [PATCH] added a hack for cross-references --- src/main.scm | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main.scm b/src/main.scm index d857bcb..c3b7679 100644 --- a/src/main.scm +++ b/src/main.scm @@ -3,6 +3,7 @@ (define (orion-wm . args) (let ((dpy (open-display))) + (use-x-error-warnings! dpy #t) (synchronize dpy #t) (init-sync-x-events dpy) ;; first try if there is already a window-manager @@ -11,21 +12,19 @@ (mdisplay "Another window manager is already running on this screen\nTerminate it before running Orion.\n") (exit)) (lambda () + (display-sync dpy #f) (display-select-input dpy (default-root-window dpy) (event-mask substructure-redirect)) (display-sync dpy #f))) - ;; for debugging: -; (spawn (lambda () -; (let loop ((se (most-recent-sync-x-event))) -; (let ((e (sync-x-event-event se))) -; (if (not (eq? e 'no-event)) -; (display-event e)) -; (loop (next-sync-x-event se (lambda (e) #t))))))) - (let* ((initial-windows (window-children dpy (default-root-window dpy))) (root-options (load-configuration dpy)) - (root-manager (create-root-wm dpy root-options))) + ;; little hack to deal with cross-references: + (cross-ref-hack (lambda (name) + (case name + ((backup-layout) backup-layout) + (else (error "cross-ref-hack" name))))) + (root-manager (create-root-wm dpy root-options cross-ref-hack))) (restore-layout root-manager) (for-each (lambda (window) (root-wm-manage-window root-manager window)) @@ -34,6 +33,3 @@ (wait-for-root-wm root-manager) (backup-layout root-manager) (display "Orion-wm finished\n")))) - -(define (display-event e) - (mdisplay "event: " (any-event-type e) " " (any-event-window e) "\n"))