stumpwm-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[STUMP] Patch: improvement for scripting frame splits


From: Michael Raskin
Subject: [STUMP] Patch: improvement for scripting frame splits
Date: Wed, 23 Sep 2009 09:36:10 +0400
User-agent: Thunderbird 2.0.0.22 (X11/20090913)

                Hello.
        I noticed that saved layout work strangely if monitor layout changes.
So I needed a way to script creating a layout relative to whatever head
it is run on. For this task knowing something about the new frame
created by split is needed. As its number is set inside split function,
I found it useful to return it. The patch follows.

#
#
# patch "tile-group.lisp"
#  from [5d5c45df1af2201dc2607a43d48fd4390737e483]
#    to [b4854fb0863db690a58fad873cb189c12d55c6fc]
#
============================================================
--- tile-group.lisp     5d5c45df1af2201dc2607a43d48fd4390737e483
+++ tile-group.lisp     b4854fb0863db690a58fad873cb189c12d55c6fc
@@ -725,7 +725,9 @@ depending on the tree's split direction.
                        (sync-frame-windows group leaf))))))

 (defun split-frame (group how &optional (ratio 1/2))
-  "split the current frame into 2 frames. return T if it succeeded. NIL
otherwise."
+  "split the current frame into 2 frames. return new frame number
+  if it succeeded. NIL otherwise. Note: this function used to return
+  T on success"
   (check-type how (member :row :column))
   (let* ((frame (tile-group-current-frame group))
          (head (frame-head group frame)))
@@ -760,7 +762,7 @@ depending on the tree's split direction.
         ;; we also need to show the new window in the other frame
         (when (frame-window f2)
           (unhide-window (frame-window f2)))
-        t))))
+        (frame-number f2)))))

 (defun draw-frame-outline (group f tl br)
   "Draw an outline around FRAME."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]