From pbrochard at common-lisp.net Fri Apr 5 19:39:35 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Fri, 05 Apr 2013 12:39:35 -0700 Subject: [clfswm-cvs] [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1212-20-g88db02b Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager". The branch, master has been updated via 88db02bdbaaf6107864c82cf3df3bf95bcd0ec0d (commit) from d6b1dd9193b247f52b6815d39653a2ea729f5477 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 88db02bdbaaf6107864c82cf3df3bf95bcd0ec0d Author: Renaud Casenave-P?r? Date: Fri Apr 5 21:38:51 2013 +0200 Add a three columns layout diff --git a/src/clfswm-layout.lisp b/src/clfswm-layout.lisp index 710bbc0..ef1ce73 100644 --- a/src/clfswm-layout.lisp +++ b/src/clfswm-layout.lisp @@ -428,13 +428,49 @@ + + +(defun three-columns-layout (child parent) + "Three Colums: main child in the middle, others on the two sides." + (with-slots (rx ry rw rh) parent + (let* ((managed-children (update-layout-managed-children child parent)) + (pos (child-position child managed-children)) + (len (max (1- (length managed-children)) 1)) + (dy (round (/ rh (max (truncate (/ (+ (if (oddp pos) 1 0) len) 2)) 1)))) + (size (or (frame-data-slot parent :tile-size) 0.75)) + (other-size (if (> len 1) (/ (- 1 size) 2) (- 1 size)))) + (if (> (length managed-children) 1) + (if (= pos 0) + (values (adj-border-xy (if (> len 1) + (round (+ rx (* rw other-size))) + rx) parent) + (adj-border-xy ry parent) + (adj-border-wh (round (* rw size)) child) + (adj-border-wh rh child)) + (values (adj-border-xy (if (oddp pos) + (round (+ rx (* rw (if (> len 1) (+ size other-size) size)))) + rx) parent) + (adj-border-xy (round (+ ry (* dy (truncate (/ (1- pos) 2))))) parent) + (adj-border-wh (round (* rw other-size)) parent) + (adj-border-wh dy parent))) + (no-layout child parent))))) + +(defun set-three-columns-layout () + "Three Columns: main child in the middle, others on the two sides." + (layout-ask-size "Tile size in percent (%)" :tile-size) + (set-layout-managed-children) + (set-layout #'three-columns-layout)) + + + (register-layout-sub-menu 'frame-tile-layout-menu "Frame tile layout menu" '(("v" set-tile-layout) ("h" set-tile-horizontal-layout) ("m" set-tile-layout-mix) ("c" set-one-column-layout) ("l" set-one-line-layout) - ("s" set-tile-space-layout))) + ("s" set-tile-space-layout) + ("t" set-three-columns-layout))) ----------------------------------------------------------------------- Summary of changes: src/clfswm-layout.lisp | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager From pbrochard at alpha-cl-net.common-lisp.net Mon Apr 22 18:49:59 2013 From: pbrochard at alpha-cl-net.common-lisp.net (Philippe Brochard) Date: Mon, 22 Apr 2013 11:49:59 -0700 (PDT) Subject: [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1212-25-g7e2726f Message-ID: <20130422184959.E197C356692@mail.common-lisp.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager". The branch, master has been updated via 7e2726f3a0e34066352db72134c2a5d1150f47f4 (commit) via 29b3dd3e5a9b59100a89bd221162d42c1ddd5b1c (commit) via b5a6f441b15afa75bd6b01e64a8687b253c78d41 (commit) from 316a299e213378cde64bd947e7b380aacfa183d5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7e2726f3a0e34066352db72134c2a5d1150f47f4 Author: Philippe Brochard Date: Mon Apr 22 20:49:52 2013 +0200 Allow to move the current focused child when circulating over brothers (new bindings) diff --git a/src/bindings-second-mode.lisp b/src/bindings-second-mode.lisp index c2e76b3..93620a2 100644 --- a/src/bindings-second-mode.lisp +++ b/src/bindings-second-mode.lisp @@ -112,12 +112,23 @@ (define-second-key ("Home" :mod-1 :control :shift) 'exit-clfswm) (define-second-key ("Right" :mod-1) 'select-next-brother) (define-second-key ("Left" :mod-1) 'select-previous-brother) + + (define-second-key ("Right" :mod-1 :shift) 'select-next-brother-take-current) + (define-second-key ("Left" :mod-1 :shift) 'select-previous-brother-take-current) + (define-second-key ("Down" :mod-1) 'select-previous-level) (define-second-key ("Up" :mod-1) 'select-next-level) + (define-second-key ("Left" :control :mod-1) 'select-brother-spatial-move-left) (define-second-key ("Right" :control :mod-1) 'select-brother-spatial-move-right) (define-second-key ("Up" :control :mod-1) 'select-brother-spatial-move-up) (define-second-key ("Down" :control :mod-1) 'select-brother-spatial-move-down) + + (define-second-key ("Left" :control :mod-1 :shift) 'select-brother-spatial-move-left-take-current) + (define-second-key ("Right" :control :mod-1 :shift) 'select-brother-spatial-move-right-take-current) + (define-second-key ("Up" :control :mod-1 :shift) 'select-brother-spatial-move-up-take-current) + (define-second-key ("Down" :control :mod-1 :shift) 'select-brother-spatial-move-down-take-current) + (define-second-key ("j") 'swap-frame-geometry) (define-second-key ("h") 'rotate-frame-geometry) (define-second-key ("h" :shift) 'anti-rotate-frame-geometry) diff --git a/src/bindings.lisp b/src/bindings.lisp index 106ae9a..45d40d6 100644 --- a/src/bindings.lisp +++ b/src/bindings.lisp @@ -47,10 +47,20 @@ (define-main-key ("Left" :mod-1) 'select-previous-brother) (define-main-key ("Down" :mod-1) 'select-previous-level) (define-main-key ("Up" :mod-1) 'select-next-level) + + (define-main-key ("Right" :mod-1 :shift) 'select-next-brother-take-current) + (define-main-key ("Left" :mod-1 :shift) 'select-previous-brother-take-current) + (define-main-key ("Left" :control :mod-1) 'select-brother-spatial-move-left) (define-main-key ("Right" :control :mod-1) 'select-brother-spatial-move-right) (define-main-key ("Up" :control :mod-1) 'select-brother-spatial-move-up) (define-main-key ("Down" :control :mod-1) 'select-brother-spatial-move-down) + + (define-main-key ("Left" :control :mod-1 :shift) 'select-brother-spatial-move-left-take-current) + (define-main-key ("Right" :control :mod-1 :shift) 'select-brother-spatial-move-right-take-current) + (define-main-key ("Up" :control :mod-1 :shift) 'select-brother-spatial-move-up-take-current) + (define-main-key ("Down" :control :mod-1 :shift) 'select-brother-spatial-move-down-take-current) + (define-main-key ("Tab" :mod-1) 'select-next-child) (define-main-key ("Tab" :mod-1 :shift) 'select-previous-child) (define-main-key ("Tab" :mod-1 :control) 'select-next-subchild) diff --git a/src/clfswm-circulate-mode.lisp b/src/clfswm-circulate-mode.lisp index fd8ca93..7c52dda 100644 --- a/src/clfswm-circulate-mode.lisp +++ b/src/clfswm-circulate-mode.lisp @@ -264,6 +264,29 @@ (setf *circulate-orig* (frame-child *circulate-parent*))) (circulate-mode :brother-direction -1)) + +(defmacro with-move-current-focused-window (() &body body) + (let ((window (gensym))) + `(with-focus-window (,window) + , at body + (move-child-to ,window (if (frame-p (current-child)) + (current-child) + (find-parent-frame (current-child) (find-current-root))))))) + + + +(defun select-next-brother-take-current () + "Select the next brother and move the current focused child in it" + (with-move-current-focused-window () + (select-next-brother))) + +(defun select-previous-brother-take-current () + "Select the previous brother and move the current focused child in it" + (with-move-current-focused-window () + (select-previous-brother))) + + + (defun select-next-subchild () "Select the next subchild" (when (and (frame-p (current-child)) @@ -376,3 +399,26 @@ (middle-child-x child) (child-y2 child)))))) +(defun select-brother-spatial-move-right-take-current () + "Select spatially the nearest brother of the current child in the right direction - move current focused child" + (with-move-current-focused-window () + (select-brother-spatial-move-right))) + + +(defun select-brother-spatial-move-left-take-current () + "Select spatially the nearest brother of the current child in the left direction - move current focused child" + (with-move-current-focused-window () + (select-brother-spatial-move-left))) + +(defun select-brother-spatial-move-down-take-current () + "Select spatially the nearest brother of the current child in the down direction - move current focused child" + (with-move-current-focused-window () + (select-brother-spatial-move-down))) + +(defun select-brother-spatial-move-up-take-current () + "Select spatially the nearest brother of the current child in the up direction - move current focused child" + (with-move-current-focused-window () + (select-brother-spatial-move-up))) + + + diff --git a/src/clfswm-internal.lisp b/src/clfswm-internal.lisp index 8b1ec3c..f42b8a8 100644 --- a/src/clfswm-internal.lisp +++ b/src/clfswm-internal.lisp @@ -1476,6 +1476,14 @@ For window: set current child to window or its parent according to window-parent +(defun move-child-to (child frame-dest) + (when (and child (frame-p frame-dest)) + (remove-child-in-frame child (find-parent-frame child)) + (pushnew child (frame-child frame-dest) :test #'child-equal-p) + (focus-all-children child frame-dest) + (show-all-children t))) + + (defun prevent-current-*-equal-child (child) " Prevent current-root and current-child equal to child" (if (child-original-root-p child) diff --git a/src/clfswm-keys.lisp b/src/clfswm-keys.lisp index 8b65b96..465cfa1 100644 --- a/src/clfswm-keys.lisp +++ b/src/clfswm-keys.lisp @@ -151,13 +151,14 @@ (character (multiple-value-list (char->keycode key))) (number key) (string (let* ((keysym (keysym-name->keysym key)) - (ret-keycode (multiple-value-list (xlib:keysym->keycodes *display* keysym)))) + (ret-keycode (multiple-value-list + (xlib:keysym->keycodes *display* keysym)))) (let ((found nil)) (dolist (kc ret-keycode) (when (= keysym (xlib:keycode->keysym *display* kc 0)) (setf found t))) - (unless found - (setf modifiers (add-in-state modifiers :shift)))) + (unless found + (setf modifiers (add-in-state modifiers :shift)))) ret-keycode))))) (if keycode (if (consp keycode) diff --git a/src/clfswm-util.lisp b/src/clfswm-util.lisp index 425a60c..5489dc9 100644 --- a/src/clfswm-util.lisp +++ b/src/clfswm-util.lisp @@ -687,13 +687,6 @@ Write (defparameter *contrib-dir* \"/usr/local/lib/clfswm/\") in ~A.~%" ;;; Move by function -(defun move-child-to (child frame-dest) - (when (and child (frame-p frame-dest)) - (remove-child-in-frame child (find-parent-frame child)) - (pushnew child (frame-child frame-dest)) - (focus-all-children child frame-dest) - (show-all-children t))) - (defun move-current-child-by-name () "Move current child in a named frame" (move-child-to (current-child) diff --git a/src/clfswm.lisp b/src/clfswm.lisp index ec70a9a..75d8997 100644 --- a/src/clfswm.lisp +++ b/src/clfswm.lisp @@ -80,8 +80,8 @@ (is-in-current-child-p window)) (setf change (or change :moved)) (focus-window window) - (focus-all-children window (find-parent-frame window (find-current-root))) - (show-all-children)))))) + (when (focus-all-children window (find-parent-frame window (find-current-root))) + (show-all-children))))))) (unless (eq change :resized) ;; To be ICCCM compliant, send a fake configuration notify event only when ;; the window has moved and not when it has been resized or the border width has changed. @@ -109,6 +109,7 @@ (when (find-child window *root-frame*) (setf (window-state window) +withdrawn-state+) (remove-child-in-all-frames window) + (xlib:unmap-window window) (show-all-children)))) diff --git a/src/package.lisp b/src/package.lisp index e072287..b7d9970 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -119,7 +119,8 @@ It is particulary useful with CLISP/MIT-CLX.") ;;; CONFIG - Default focus policy (defconfig *default-focus-policy* :click nil - "Default mouse focus policy. One of :click, :sloppy, :sloppy-strict or :sloppy-select.") + "Default mouse focus policy. One of :click, :sloppy, :sloppy-strict, :sloppy-select or +:sloppy-select-window.") (defconfig *show-hide-policy* #'<= commit 29b3dd3e5a9b59100a89bd221162d42c1ddd5b1c Author: Philippe Brochard Date: Sun Apr 7 22:40:46 2013 +0200 Destroy window is needed in some cases diff --git a/src/clfswm.lisp b/src/clfswm.lisp index 5b32fd6..ec70a9a 100644 --- a/src/clfswm.lisp +++ b/src/clfswm.lisp @@ -117,6 +117,7 @@ (xlib:window-equal window event-window)) (when (find-child window *root-frame*) (delete-child-in-all-frames window) + (xlib:destroy-window window) (show-all-children)))) commit b5a6f441b15afa75bd6b01e64a8687b253c78d41 Author: Philippe Brochard Date: Fri Apr 5 22:35:41 2013 +0200 Change focus only on mouse move diff --git a/src/clfswm-internal.lisp b/src/clfswm-internal.lisp index 14f628c..8b1ec3c 100644 --- a/src/clfswm-internal.lisp +++ b/src/clfswm-internal.lisp @@ -1668,39 +1668,43 @@ managed." (frame-selected-pos parent) 0))) -(defun manage-focus (window root-x root-y) - (case (if (frame-p (current-child)) - (frame-focus-policy (current-child)) - *default-focus-policy*) - (:sloppy (focus-window window)) - (:sloppy-strict (when (and (frame-p (current-child)) - (child-member window (frame-child (current-child)))) - (focus-window window))) - (:sloppy-select (let* ((child (find-child-under-mouse root-x root-y)) - (parent (find-parent-frame child))) - (unless (or (child-root-p child) - (child-equal-p (typecase child - (xlib:window parent) - (t child)) - (current-child))) - (focus-all-children child parent) - (show-all-children)))) - (:sloppy-select-window (let* ((child (find-child-under-mouse root-x root-y)) - (parent (find-parent-frame child)) - (need-warp-pointer (not (or (frame-p child) - (child-equal-p child (frame-selected-child parent)))))) - (unless (child-root-p child) - (when (focus-all-children child parent) - (show-all-children) - (when (and need-warp-pointer - (not (eql (frame-data-slot (current-child) :tile-layout-keep-position) - :yes))) - (typecase child - (xlib:window (xlib:warp-pointer *root* - (truncate (+ (x-drawable-x child) - (/ (x-drawable-width child) 2))) - (truncate (+ (x-drawable-y child) - (/ (x-drawable-height child) 2))))) - (frame (xlib:warp-pointer *root* - (+ (frame-rx child) 10) - (+ (frame-ry child) 10))))))))))) \ No newline at end of file +(let ((lx -1) (ly -1)) + (defun manage-focus (window root-x root-y) + (case (if (frame-p (current-child)) + (frame-focus-policy (current-child)) + *default-focus-policy*) + (:sloppy (focus-window window)) + (:sloppy-strict (when (and (frame-p (current-child)) + (child-member window (frame-child (current-child)))) + (focus-window window))) + (:sloppy-select (let* ((child (find-child-under-mouse root-x root-y)) + (parent (find-parent-frame child))) + (unless (or (child-root-p child) + (child-equal-p (typecase child + (xlib:window parent) + (t child)) + (current-child))) + (focus-all-children child parent) + (show-all-children)))) + (:sloppy-select-window (let* ((child (find-child-under-mouse root-x root-y)) + (parent (find-parent-frame child)) + (need-warp-pointer (not (or (frame-p child) + (child-equal-p child (frame-selected-child parent)))))) + (unless (or (child-root-p child) + (= lx root-x) (= ly root-y)) + (setf lx root-x ly root-y) + (when (focus-all-children child parent) + (show-all-children) + (when (and need-warp-pointer + (not (eql (frame-data-slot (current-child) :tile-layout-keep-position) + :yes))) + (typecase child + (xlib:window (xlib:warp-pointer *root* + (truncate (+ (x-drawable-x child) + (/ (x-drawable-width child) 2))) + (truncate (+ (x-drawable-y child) + (/ (x-drawable-height child) 2))))) + (frame (xlib:warp-pointer *root* + (+ (frame-rx child) 10) + (+ (frame-ry child) 10)))))))))))) + ----------------------------------------------------------------------- Summary of changes: src/bindings-second-mode.lisp | 11 ++++++ src/bindings.lisp | 10 +++++ src/clfswm-circulate-mode.lisp | 46 ++++++++++++++++++++++ src/clfswm-internal.lisp | 84 +++++++++++++++++++++++----------------- src/clfswm-keys.lisp | 7 ++-- src/clfswm-util.lisp | 7 ---- src/clfswm.lisp | 6 ++- src/package.lisp | 3 +- 8 files changed, 125 insertions(+), 49 deletions(-) hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager From pbrochard at common-lisp.net Wed Apr 24 20:41:48 2013 From: pbrochard at common-lisp.net (Philippe Brochard) Date: Wed, 24 Apr 2013 13:41:48 -0700 (PDT) Subject: [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1212-27-gcdadcb8 Message-ID: <20130424204149.1921F35668F@mail.common-lisp.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager". The branch, master has been updated via cdadcb842a0a5aa26a818bc756df2a9429c910f4 (commit) from 4cd4754df5cf3a076db30e788f89f9709cc32360 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cdadcb842a0a5aa26a818bc756df2a9429c910f4 Author: Philippe Brochard Date: Wed Apr 24 22:41:44 2013 +0200 Add a configuration variable (steal-focus) to allow or not to steal the focus on configure request diff --git a/src/clfswm.lisp b/src/clfswm.lisp index 75d8997..42386c2 100644 --- a/src/clfswm.lisp +++ b/src/clfswm.lisp @@ -79,9 +79,10 @@ (when (or (child-equal-p window (current-child)) (is-in-current-child-p window)) (setf change (or change :moved)) - (focus-window window) - (when (focus-all-children window (find-parent-frame window (find-current-root))) - (show-all-children))))))) + (when *steal-focus* + (focus-window window) + (when (focus-all-children window (find-parent-frame window (find-current-root))) + (show-all-children)))))))) (unless (eq change :resized) ;; To be ICCCM compliant, send a fake configuration notify event only when ;; the window has moved and not when it has been resized or the border width has changed. diff --git a/src/config.lisp b/src/config.lisp index 6d0932d..19e3058 100644 --- a/src/config.lisp +++ b/src/config.lisp @@ -59,6 +59,8 @@ Example: :mod-2 for num_lock, :lock for Caps_lock...") A list of (list match-function handle-function)") +(defconfig *steal-focus* t nil + "Allow to streal the focus on configure request") (defconfig *hide-unmanaged-window* t nil "Hide or not unmanaged windows when a child is deselected.") ----------------------------------------------------------------------- Summary of changes: src/clfswm.lisp | 7 ++++--- src/config.lisp | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager From pbrochard at alpha-cl-net.common-lisp.net Mon Apr 22 19:01:34 2013 From: pbrochard at alpha-cl-net.common-lisp.net (Philippe Brochard) Date: Mon, 22 Apr 2013 12:01:34 -0700 (PDT) Subject: [clfswm-git]CLFSWM - A(nother) Common Lisp FullScreen Window Manager branch master updated. R-1212-26-g4cd4754 Message-ID: <20130422190134.A8B58356692@mail.common-lisp.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CLFSWM - A(nother) Common Lisp FullScreen Window Manager". The branch, master has been updated via 4cd4754df5cf3a076db30e788f89f9709cc32360 (commit) from 7e2726f3a0e34066352db72134c2a5d1150f47f4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4cd4754df5cf3a076db30e788f89f9709cc32360 Author: Philippe Brochard Date: Mon Apr 22 21:01:32 2013 +0200 Use with-current-window instead of with-focus-window to take current window over brothers in second mode diff --git a/src/clfswm-circulate-mode.lisp b/src/clfswm-circulate-mode.lisp index 7c52dda..720d456 100644 --- a/src/clfswm-circulate-mode.lisp +++ b/src/clfswm-circulate-mode.lisp @@ -266,12 +266,11 @@ (defmacro with-move-current-focused-window (() &body body) - (let ((window (gensym))) - `(with-focus-window (,window) - , at body - (move-child-to ,window (if (frame-p (current-child)) - (current-child) - (find-parent-frame (current-child) (find-current-root))))))) + `(with-current-window + , at body + (move-child-to window (if (frame-p (current-child)) + (current-child) + (find-parent-frame (current-child) (find-current-root)))))) diff --git a/src/clfswm-second-mode.lisp b/src/clfswm-second-mode.lisp index 50029f2..b8d4ac4 100644 --- a/src/clfswm-second-mode.lisp +++ b/src/clfswm-second-mode.lisp @@ -42,7 +42,8 @@ (truncate (/ (- *sm-width* (* (xlib:max-char-width *sm-font*) len)) 2)) (truncate (/ (+ *sm-height* (- (xlib:font-ascent *sm-font*) (xlib:font-descent *sm-font*))) 2)) text)) - (copy-pixmap-buffer *sm-window* *sm-gc*)) + (copy-pixmap-buffer *sm-window* *sm-gc*) + (no-focus)) ----------------------------------------------------------------------- Summary of changes: src/clfswm-circulate-mode.lisp | 11 +++++------ src/clfswm-second-mode.lisp | 3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) hooks/post-receive -- CLFSWM - A(nother) Common Lisp FullScreen Window Manager