added a hack for cross-references

This commit is contained in:
frese 2003-05-07 14:48:16 +00:00
parent 8b65473e1a
commit a6b01632eb
1 changed files with 8 additions and 12 deletions

View File

@ -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"))