Commit a83e36e6 authored by Philippe Brochard's avatar Philippe Brochard
Browse files

Add an expose mode to present child without changing there position

parent 8fb65ba0
......@@ -76,6 +76,7 @@
(define-main-key ("Home" :mod-1 :shift) 'switch-and-select-root-frame)
(define-main-key ("Menu") 'fastswitch-mode)
(define-main-key ("Menu" :control) 'fastswitch-move-mode)
(define-main-key ("Menu" :mod-5) 'expose-current-child-mode)
(define-main-key ("F10" :mod-1) 'fast-layout-switch)
(define-main-key ("F10" :shift :control) 'toggle-show-root-frame)
(define-main-key ("F10") 'expose-windows-mode)
......@@ -156,5 +157,3 @@
(define-main-mouse (5 :mod-1 :control :shift) 'inc-transparency-slow))
(add-hook *binding-hook* 'set-default-main-mouse)
......@@ -170,16 +170,18 @@
(frame-data-slot child :old-layout) nil)))))
(defun expose-mode-display-accel-windows ()
(with-all-root-child (root)
(with-all-children-reversed (root child)
(let ((ex-child (find child *expose-child-list* :test #'child-equal-p :key #'expose-child-child)))
(when ex-child
(if (or (frame-p (expose-child-child ex-child))
(managed-window-p (expose-child-child ex-child)
(find-parent-frame (expose-child-child ex-child) *root-frame*)))
(expose-create-window ex-child)
(hide-child (expose-child-child ex-child)))))))
(expose-draw-letter))
(let ((all-hidden-windows (get-hidden-windows)))
(with-all-root-child (root)
(with-all-children-reversed (root child)
(let ((ex-child (find child *expose-child-list* :test #'child-equal-p :key #'expose-child-child)))
(when ex-child
(if (or (frame-p (expose-child-child ex-child))
(managed-window-p (expose-child-child ex-child)
(find-parent-frame (expose-child-child ex-child) *root-frame*)))
(unless (child-member (expose-child-child ex-child) all-hidden-windows)
(expose-create-window ex-child))
(hide-child (expose-child-child ex-child)))))))
(expose-draw-letter)))
(defun expose-find-child-from-letters (letters)
......@@ -196,7 +198,7 @@
(expose-child-child ex-child))))))
(defun expose-restore-windows ()
(defun expose-restore-windows (&optional (present-window t))
(remove-hook *query-key-press-hook* 'expose-query-key-press-hook)
(remove-hook *query-button-press-hook* 'expose-query-button-press-hook)
(dolist (ex-child *expose-child-list*)
......@@ -208,7 +210,8 @@
(expose-child-window ex-child) nil))
(when *expose-font*
(xlib:close-font *expose-font*))
(expose-unpresent-windows))
(when present-window
(expose-unpresent-windows)))
(defun expose-focus-child (child)
(let ((parent (typecase child
......@@ -219,13 +222,14 @@
(setf (current-child) child)
(focus-all-children child parent t))))
(defun expose-do-main ()
(defun expose-do-main (&optional (present-window t))
(stop-button-event)
(expose-init)
(expose-present-windows)
(when present-window
(expose-present-windows))
(expose-mode-display-accel-windows)
(let ((child (expose-select-child)))
(expose-restore-windows)
(expose-restore-windows present-window)
child))
(defun expose-windows-mode ()
......@@ -247,3 +251,10 @@
(expose-focus-child child)))
(show-all-children)
t)
(defun expose-current-child-mode ()
"Present all windows in currents roots (An expose like)"
(awhen (expose-do-main nil)
(expose-focus-child it))
(show-all-children)
t)
......@@ -1826,7 +1826,3 @@ managed."
(print-frame-tree (dump-frame-tree store #'xid->window)
#'(lambda (x)
(format nil "~A" (if (frame-p x) x (child-fullname x)))))))
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