added a hack for cross-references
This commit is contained in:
parent
8b65473e1a
commit
a6b01632eb
20
src/main.scm
20
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"))
|
||||
|
|
Loading…
Reference in New Issue