[clfswm-cvs] r426 - in clfswm: . src
Philippe Brochard
pbrochard at common-lisp.net
Tue Mar 8 22:04:07 UTC 2011
Author: pbrochard
Date: Tue Mar 8 17:04:07 2011
New Revision: 426
Log:
src/clfswm-internal.lisp (show-all-children): Hide windows not in the current root before displaying those in current root. Remove all hide-all unnecessary calls.
Modified:
clfswm/ChangeLog
clfswm/src/clfswm-expose-mode.lisp
clfswm/src/clfswm-internal.lisp
clfswm/src/clfswm-nw-hooks.lisp
clfswm/src/clfswm-util.lisp
Modified: clfswm/ChangeLog
==============================================================================
--- clfswm/ChangeLog (original)
+++ clfswm/ChangeLog Tue Mar 8 17:04:07 2011
@@ -1,5 +1,9 @@
2011-03-08 Philippe Brochard <pbrochard at common-lisp.net>
+ * src/clfswm-internal.lisp (show-all-children): Hide windows not
+ in the current root before displaying those in current root.
+ Remove all hide-all unnecessary calls.
+
* src/clfswm-configuration.lisp (save-variables-in-conf-file):
Save only variables with a different value than there original
value.
Modified: clfswm/src/clfswm-expose-mode.lisp
==============================================================================
--- clfswm/src/clfswm-expose-mode.lisp (original)
+++ clfswm/src/clfswm-expose-mode.lisp Tue Mar 8 17:04:07 2011
@@ -156,7 +156,7 @@
(with-all-frames (first-restore-frame frame)
(setf (frame-data-slot frame :old-layout) (frame-layout frame)
(frame-layout frame) #'tile-space-layout))
- (show-all-children)
+ (show-all-children t)
(expose-mode-display-accel-windows)
(let ((grab-keyboard-p (xgrab-keyboard-p))
(grab-pointer-p (xgrab-pointer-p)))
@@ -184,7 +184,7 @@
(with-all-frames (first-restore-frame frame)
(setf (frame-layout frame) (frame-data-slot frame :old-layout)
(frame-data-slot frame :old-layout) nil))
- (show-all-children)
+ (show-all-children t)
(banish-pointer)
(unless grab-keyboard-p
(xungrab-keyboard)
@@ -208,10 +208,8 @@
(switch-to-root-frame :show-later t)
(expose-windows-generic *root-frame*
(lambda (parent)
- (hide-all-children *root-frame*)
(setf *current-root* parent))
(lambda ()
- (hide-all-children *current-root*)
(setf *current-root* orig-root)))))
(defun expose-windows-current-child-mode ()
@@ -220,12 +218,10 @@
(when (frame-p *current-child*)
(let ((orig-root *current-root*))
(unless (child-equal-p *current-child* *current-root*)
- (hide-all *current-root*)
(setf *current-root* *current-child*))
(expose-windows-generic *current-root*)
(unless (child-equal-p *current-child* orig-root)
- (hide-all *current-root*)
(setf *current-root* orig-root))
- (show-all-children))))
+ (show-all-children t))))
Modified: clfswm/src/clfswm-internal.lisp
==============================================================================
--- clfswm/src/clfswm-internal.lisp (original)
+++ clfswm/src/clfswm-internal.lisp Tue Mar 8 17:04:07 2011
@@ -738,6 +738,8 @@
(previous nil))
(labels ((rec (child parent selected-p in-current-root)
(let ((child-current-root-p (child-equal-p child *current-root*)))
+ (unless (or in-current-root child-current-root-p)
+ (hide-child child))
(when (or in-current-root child-current-root-p)
(when (adapt-child-to-parent child (if child-current-root-p nil parent))
(setf geometry-change t))
@@ -750,9 +752,8 @@
(rec sub-child child
(and selected-p (child-equal-p sub-child selected-child))
(or in-current-root child-current-root-p)))))
- (if (or in-current-root child-current-root-p)
- (show-child child parent previous)
- (hide-child child))
+ (when (or in-current-root child-current-root-p)
+ (show-child child parent previous))
(setf previous child))))
(rec (if from-root-from *root-frame* *current-root*)
nil t (child-equal-p *current-root* *root-frame*))
@@ -856,17 +857,15 @@
(defun enter-frame ()
"Enter in the selected frame - ie make it the root frame"
- (hide-all *current-root*)
(setf *current-root* *current-child*)
- (show-all-children))
+ (show-all-children t))
(defun leave-frame ()
"Leave the selected frame - ie make its parent the root frame"
- (hide-all *current-root*)
(awhen (find-parent-frame *current-root*)
(when (frame-p it)
(setf *current-root* it)))
- (show-all-children))
+ (show-all-children t))
;;; Other actions (select-next-child, select-next-brother...) are in
@@ -919,18 +918,16 @@
(defun switch-to-root-frame (&key (show-later nil))
"Switch to the root frame"
- (hide-all *current-root*)
(setf *current-root* *root-frame*)
(unless show-later
- (show-all-children)))
+ (show-all-children t)))
(defun switch-and-select-root-frame (&key (show-later nil))
"Switch and select the root frame"
- (hide-all *current-root*)
(setf *current-root* *root-frame*)
(setf *current-child* *current-root*)
(unless show-later
- (show-all-children)))
+ (show-all-children t)))
(defun toggle-show-root-frame ()
Modified: clfswm/src/clfswm-nw-hooks.lisp
==============================================================================
--- clfswm/src/clfswm-nw-hooks.lisp (original)
+++ clfswm/src/clfswm-nw-hooks.lisp Tue Mar 8 17:04:07 2011
@@ -158,13 +158,12 @@
(when parent
(pushnew new-frame (frame-child parent))
(pushnew window (frame-child new-frame))
- (hide-all *current-root*)
(setf *current-root* parent
*current-child* parent)
(set-layout-once #'tile-space-layout)
(setf *current-child* new-frame)
(default-window-placement new-frame window)
- (show-all-children)
+ (show-all-children t)
t)))
@@ -202,12 +201,11 @@
(when (frame-p frame)
(pushnew window (frame-child frame))
(unless (find-child frame *current-root*)
- (hide-all *current-root*)
(setf *current-root* frame))
(setf *current-child* frame)
(focus-all-children window frame)
(default-window-placement frame window)
- (show-all-children)
+ (show-all-children t)
t))
;;; Open a new window in a named frame
@@ -249,12 +247,11 @@
(pushnew window (frame-child frame))
(unless *in-process-existing-windows*
(unless (find-child frame *current-root*)
- (hide-all *current-root*)
(setf *current-root* frame))
(setf *current-child* frame)
(focus-all-children window frame)
(default-window-placement frame window)
- (show-all-children))
+ (show-all-children t))
(throw 'nw-hook-loop t)))
nil)
Modified: clfswm/src/clfswm-util.lisp
==============================================================================
--- clfswm/src/clfswm-util.lisp (original)
+++ clfswm/src/clfswm-util.lisp Tue Mar 8 17:04:07 2011
@@ -220,22 +220,21 @@
(defun cut-current-child ()
"Cut the current child to the selection"
(copy-current-child)
- (hide-all *current-child*)
(remove-child-in-frame *current-child* (find-parent-frame *current-child* *current-root*))
(setf *current-child* *current-root*)
- (show-all-children))
+ (show-all-children t))
(defun remove-current-child ()
"Remove the current child from its parent frame"
- (hide-all *current-child*)
(remove-child-in-frame *current-child* (find-parent-frame *current-child* *current-root*))
(setf *current-child* *current-root*)
+ (show-all-children t)
(leave-second-mode))
(defun delete-current-child ()
"Delete the current child and its children in all frames"
- (hide-all *current-child*)
(delete-child-and-children-in-all-frames *current-child*)
+ (show-all-children t)
(leave-second-mode))
@@ -401,11 +400,10 @@
;;; Focus by functions
(defun focus-frame-by (frame)
(when (frame-p frame)
- (hide-all *current-root*)
(focus-all-children frame (or (find-parent-frame frame *current-root*)
(find-parent-frame frame)
*root-frame*))
- (show-all-children)))
+ (show-all-children t)))
(defun focus-frame-by-name ()
@@ -440,14 +438,13 @@
;;; Delete by functions
(defun delete-frame-by (frame)
- (hide-all *current-root*)
(unless (child-equal-p frame *root-frame*)
(when (child-equal-p frame *current-root*)
(setf *current-root* *root-frame*))
(when (child-equal-p frame *current-child*)
(setf *current-child* *current-root*))
(remove-child-in-frame frame (find-parent-frame frame)))
- (show-all-children))
+ (show-all-children t))
(defun delete-frame-by-name ()
@@ -464,11 +461,10 @@
;;; Move by function
(defun move-child-to (child frame-dest)
(when (and child (frame-p frame-dest))
- (hide-all *current-root*)
(remove-child-in-frame child (find-parent-frame child))
(pushnew child (frame-child frame-dest))
(focus-all-children child frame-dest)
- (show-all-children)))
+ (show-all-children t)))
(defun move-current-child-by-name ()
"Move current child in a named frame"
@@ -488,10 +484,9 @@
;;; Copy by function
(defun copy-child-to (child frame-dest)
(when (and child (frame-p frame-dest))
- (hide-all *current-root*)
(pushnew child (frame-child frame-dest))
(focus-all-children child frame-dest)
- (show-all-children)))
+ (show-all-children t)))
(defun copy-current-child-by-name ()
"Copy current child in a named frame"
@@ -732,11 +727,10 @@
"Jump to slot"
(let ((jump-child (aref key-slots current-slot)))
(when (find-child jump-child *root-frame*)
- (hide-all *current-root*)
(setf *current-root* jump-child
*current-child* *current-root*)
(focus-all-children *current-child* *current-child*)
- (show-all-children))))
+ (show-all-children t))))
(defun bind-or-jump (n)
"Bind or jump to a slot (a frame or a window)"
@@ -1133,11 +1127,10 @@
"Store the current child and switch to the previous one"
(let ((current-child *current-child*))
(when last-child
- (hide-all *current-root*)
(setf *current-root* last-child
*current-child* *current-root*)
(focus-all-children *current-child* *current-child*)
- (show-all-children))
+ (show-all-children t))
(setf last-child current-child))))
@@ -1561,13 +1554,12 @@
(return win)))))
(if window
(let ((parent (find-parent-frame window)))
- (hide-all-children *current-root*)
(setf *current-child* parent)
(put-child-on-top window parent)
(when maximized
(setf *current-root* parent))
(focus-all-children window parent)
- (show-all-children))
+ (show-all-children t))
(funcall run-fn))))
More information about the clfswm-cvs
mailing list