Commit 8fb65ba0 authored by Philippe Brochard's avatar Philippe Brochard
Browse files

Find free keys instead of incrementing the last one for each new child

parent 7c63375c
......@@ -28,7 +28,7 @@
(defparameter *expose-font* nil)
(defparameter *expose-selected-child* nil)
(defstruct expose-child child key window gc string)
(defstruct expose-child number child key window gc string)
(defun leave-expose-mode ()
"Leave the expose mode"
......@@ -51,13 +51,16 @@
(defun expose-associate-keys ()
(let* ((all nil)
(new nil))
(new nil)
(all-numbers (loop for ec in *expose-child-list*
collect (expose-child-number ec))))
(with-all-children-reversed (*root-frame* child)
(unless (child-equal-p child *root-frame*)
(push child all)
(unless (member child *expose-child-list* :test #'child-equal-p :key #'expose-child-child)
(push (make-expose-child :child child :key (number->letter *expose-current-number*)) new)
(incf *expose-current-number*))))
(let ((number (find-free-number all-numbers)))
(push (make-expose-child :child child :number number :key (number->letter number)) new)
(push number all-numbers)))))
(append (remove-if-not (lambda (x) (member x all :test #'child-equal-p)) *expose-child-list*
:key #'expose-child-child)
(nreverse new))))
......@@ -216,7 +216,6 @@
:drawable *root*)
*in-second-mode* nil
*x-error-count* 0
*expose-current-number* 0
*expose-child-list* nil)
......@@ -342,6 +341,3 @@
(format t "~&~A~%Reinitializing...~%" msg)
(setf error-msg (list (list msg *info-color-title*)
......@@ -86,7 +86,6 @@ It is particulary useful with CLISP/MIT-CLX.")
(defparameter *background-image* nil)
(defparameter *background-gc* nil)
(defparameter *expose-current-number* 0)
(defparameter *expose-child-list* nil)
(defconfig *loop-timeout* 1 nil
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment