[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[STUMP] [PATCH] Fix multiple heads frame numbering bug.
From: |
John Li |
Subject: |
[STUMP] [PATCH] Fix multiple heads frame numbering bug. |
Date: |
Thu, 31 Jul 2008 01:33:32 -0400 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
When adding a new head, the frame on the new head inherits its number
from the head number, regardless of whether that number is in use or
not, which can lead to frames with duplicate numbers.
---
I described how to reproduce this bug in an email sent on May 31 with
subject line "[STUMP] multihead frame number bug".
For the morbidly lazy:
http://lists.gnu.org/archive/html/stumpwm-devel/2008-05/msg00138.html
_ _ _ _ _
Consider this another bug___| | | |__ _ _ (_) (_)
/ _ \ \ /\ / / '_ \ / _ \/ _` | | '_ \| | | | | | | |
| (_) \ V V /| | | | __/ (_| | | |_) | |_| | | | | |_
\___/ \_/\_/ |_| |_|\___|\__,_| |_.__/ \__, | _/ |_|_(_)
|___/ |__/
screen.lisp | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
(18 lines of this ^ is just re-indenting)
diff --git a/screen.lisp b/screen.lisp
index 4be2598..e82c8b0 100644
--- a/screen.lisp
+++ b/screen.lisp
@@ -555,15 +555,17 @@ (defun add-head (screen head)
(dformat 1 "Adding head #~D~%" (head-number head))
(setf (screen-heads screen) (sort (push head (screen-heads screen)) #'< :key
'head-number))
(dolist (group (screen-groups screen))
- (setf (tile-group-frame-tree group)
- (insert-before (tile-group-frame-tree group)
- (copy-frame head)
- (head-number head)))
- ;; Try to put something in the new frame
- (let ((frame (tile-group-frame-head group head)))
- (choose-new-frame-window frame group)
- (when (frame-window frame)
- (unhide-window (frame-window frame))))))
+ (let ((new-frame-num (find-free-frame-number group)))
+ (setf (tile-group-frame-tree group)
+ (insert-before (tile-group-frame-tree group)
+ (copy-frame head)
+ (head-number head)))
+ ;; Try to put something in the new frame and give it an unused number
+ (let ((frame (tile-group-frame-head group head)))
+ (setf (frame-number frame) new-frame-num)
+ (choose-new-frame-window frame group)
+ (when (frame-window frame)
+ (unhide-window (frame-window frame)))))))
(defun remove-head (screen head)
(dformat 1 "Removing head #~D~%" (head-number head))
--
1.5.6.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [STUMP] [PATCH] Fix multiple heads frame numbering bug.,
John Li <=