Skip to content

Commit

Permalink
Fix initialization bugs with randr and the tiling wm
Browse files Browse the repository at this point in the history
  • Loading branch information
mwitmer committed Jul 8, 2019
1 parent f3c7b3b commit cd86ecf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions module/guile-wm/module/randr.scm
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ to SetCrtcConfig"))
(define-once screen-change-hook (make-wm-hook))

(define (setup-randr change)
(screen-resources (reply-for get-screen-resources-current (current-root)))
(screen-resources (reply-for get-screen-resources (current-root)))
(let ((outputs (xref (screen-resources) 'outputs))
(crtcs (xref (screen-resources) 'crtcs)))
(screen-info (reply-for get-screen-info (current-root)))
Expand All @@ -340,4 +340,4 @@ to SetCrtcConfig"))
(when (solicit (delay-enable-extension 'randr))
(select-input (current-root) '(crtc-change screen-change output-change))
(listen! screen-change-notify-event 'screen-change-notify setup-randr)
(setup-randr #f))))
(setup-randr #t))))
6 changes: 4 additions & 2 deletions module/guile-wm/module/tiling.scm
Original file line number Diff line number Diff line change
Expand Up @@ -510,15 +510,17 @@
(set-split-container! content new-frame)
(set-tile-container! content new-frame))
(delq new-frame unused-new-frames)))
(else (lp (cdr unused-new-frames))))))
(else (lp (cdr unused))))))
(define (frames-match? frame1 frame2)
(and (= (frame-x frame1) (frame-x frame2))
(= (frame-y frame1) (frame-y frame2))
(= (frame-height frame1) (frame-height frame2))
(= (frame-width frame1) (frame-width frame2))))

(and-let* ((frame-list) (new-frames (detect-frames)))
(fold find-matching-frame new-frames frame-list)
(set! frame-list new-frames)))
(set! frame-list new-frames)
(set! selected-tile (frame-content (car frame-list)))))

(define (tiling-menu-select-window x-window)
(define parent (window-parent x-window))
Expand Down

0 comments on commit cd86ecf

Please sign in to comment.