From 48c4012614a2cfda0d312e0710ceec8fbeee8b03 Mon Sep 17 00:00:00 2001 From: Philippe Brochard Date: Sun, 6 Mar 2011 21:01:29 +0100 Subject: [PATCH] (show-all-children): add the ability to display all child from *root-frame* and hide all those who are not in *current-root*. -> remove hide-all-children when needed. --- ChangeLog | 5 +++++ src/clfswm-circulate-mode.lisp | 6 ++---- src/clfswm-expose-mode.lisp | 1 - src/clfswm-internal.lisp | 40 ++++++++++++++++++++++++---------------- src/package.lisp | 2 +- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index e952586..cd9be80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ * src/clfswm-internal.lisp (show-all-children): Simplify the selection method. + (show-child): Display an unmanaged window whe it's the current + child. + (show-all-children): add the ability to display all child from + *root-frame* and hide all those who are not in *current-root*. + -> remove hide-all-children when needed. * src/xlib-util.lisp (move-window,resize-window): Add a *color-move-window* border when moving or resizing a window. diff --git a/src/clfswm-circulate-mode.lisp b/src/clfswm-circulate-mode.lisp index efbddfc..06db596 100644 --- a/src/clfswm-circulate-mode.lisp +++ b/src/clfswm-circulate-mode.lisp @@ -85,9 +85,7 @@ (no-focus) (let ((frame-is-root? (and (child-equal-p *current-root* *current-child*) (not (child-equal-p *current-root* *root-frame*))))) - (if frame-is-root? - (hide-all *current-root*) - (select-current-frame nil)) + (select-current-frame nil) (unless (and *circulate-orig* *circulate-parent*) (reset-circulate-brother)) (let ((len (length *circulate-orig*))) @@ -98,7 +96,7 @@ *current-child* (frame-selected-child *circulate-parent*)))) (when frame-is-root? (setf *current-root* *current-child*)))) - (show-all-children) + (show-all-children t) (draw-circulate-mode-window))) (defun reorder-subchild (direction) diff --git a/src/clfswm-expose-mode.lisp b/src/clfswm-expose-mode.lisp index 091c1d2..3550312 100644 --- a/src/clfswm-expose-mode.lisp +++ b/src/clfswm-expose-mode.lisp @@ -167,7 +167,6 @@ (if (generic-mode 'expose-mode 'exit-expose-loop :original-mode '(main-mode)) (multiple-value-bind (x y) (xlib:query-pointer *root*) - (dbg *expose-selected-child* (child-fullname *expose-selected-child*)) (let* ((child (or *expose-selected-child* (find-child-under-mouse x y))) (parent (find-parent-frame child *root-frame*))) (when (and child parent) diff --git a/src/clfswm-internal.lisp b/src/clfswm-internal.lisp index b851fb0..daa7b66 100644 --- a/src/clfswm-internal.lisp +++ b/src/clfswm-internal.lisp @@ -644,6 +644,7 @@ (defmethod show-child ((window xlib:window) parent previous) (if (or (managed-window-p window parent) + (child-equal-p window *current-child*) (not (hide-unmanaged-window-p parent)) (child-equal-p parent *current-child*)) (progn @@ -730,23 +731,31 @@ -(defun show-all-children () - "Show all children from *current-root*." +(defun show-all-children (&optional (from-root-from nil)) + "Show all children from *current-root*. When from-root-from is true +Display all children from root frame and hide those not in *current-root*" (let ((geometry-change nil) (previous nil)) - (labels ((rec (child parent selected-p) - (when (adapt-child-to-parent child parent) - (setf geometry-change t)) - (select-child child (cond ((child-equal-p child *current-child*) t) - (selected-p :maybe) - (t nil))) - (when (frame-p child) - (let ((selected-child (frame-selected-child child))) - (dolist (sub-child (frame-child child)) - (rec sub-child child (and selected-p (child-equal-p sub-child selected-child)))))) - (show-child child parent previous) - (setf previous child))) - (rec *current-root* nil t) + (labels ((rec (child parent selected-p in-current-root) + (let ((child-current-root-p (child-equal-p child *current-root*))) + (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)) + (select-child child (cond ((child-equal-p child *current-child*) t) + (selected-p :maybe) + (t nil)))) + (when (frame-p child) + (let ((selected-child (frame-selected-child child))) + (dolist (sub-child (frame-child child)) + (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)) + (setf previous child)))) + (rec (if from-root-from *root-frame* *current-root*) + nil t (child-equal-p *current-root* *root-frame*)) (set-focus-to-current-child) geometry-change))) @@ -926,7 +935,6 @@ For window: set current child to window or its parent according to window-parent (defun toggle-show-root-frame () "Show/Hide the root frame" - (hide-all *current-root*) (setf *show-root-frame-p* (not *show-root-frame-p*)) (show-all-children)) diff --git a/src/package.lisp b/src/package.lisp index a735974..49148fe 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -71,7 +71,7 @@ It is particulary useful with CLISP/MIT-CLX.") (defparameter *default-font-string* "fixed" "Config(): The default font used in clfswm") -(defparameter *color-move-window* "Green" +(defparameter *color-move-window* "DeepPink" "Config(Main mode group): Color when moving or resizing a windows") (defparameter *child-selection* nil) -- 2.11.4.GIT