Skip to content

Commit

Permalink
Added Dave Thompson's 'delete-current-tile' command.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwitmer committed Jul 10, 2014
1 parent ce3b916 commit 30c32e1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions module/guile-wm/module/tiling.scm
Original file line number Diff line number Diff line change
Expand Up @@ -593,3 +593,24 @@ them both with one tile containing the selected tile's contents"
(else (set-frame-content! super new-tile)))
(set-tile-container! new-tile super)
(place-window! selected-window new-tile #t))))

(define-command (delete-tile)
"Delete the currently selected tile and replace the containing split
with the other tile's contents."
(let* ((split (tile-container selected-tile))
(super (container-of split))
(window (tile-window
(if (split? split)
(other-element split selected-tile)
selected-tile)))
(tile (make-tile (height-of super) (width-of super))))
(for-each-tile hide-tile-window! split)
(cond
((and (split? super) (eq? (split-element1 super) split))
(set-split-element1! super tile))
((and (split? super) (eq? (split-element2 super) split))
(set-split-element2! super tile))
(else
(set-frame-content! super tile)))
(set-tile-container! tile super)
(place-window! window tile #t)))

0 comments on commit 30c32e1

Please sign in to comment.