From pbrochard at common-lisp.net Tue Apr 1 19:51:48 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Tue, 1 Apr 2008 14:51:48 -0500 (EST) Subject: [clfswm-cvs] r63 - in clfswm: . src Message-ID: <20080401195148.E6F0CA186@common-lisp.net> Author: pbrochard Date: Tue Apr 1 14:51:45 2008 New Revision: 63 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp clfswm/src/xlib-util.lisp Log: Stop button event only if there is a geometry change. More TODO things Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Tue Apr 1 14:51:45 2008 @@ -1,4 +1,14 @@ -2008-03-30 Philippe Brochard +2008-04-01 Philippe Brochard + + * src/clfswm-util.lisp (mouse-click-to-focus-generic): Stop button + event only if there is a geometry change. + +2008-04-01 Philippe Brochard + + * src/clfswm-internal.lisp (show-all-children): Return t if there + is a geometry change. + +2008-03-30 Philippe Brochard * src/bindings.lisp (Up/Down): Swap select previous/next level. @@ -19,12 +29,12 @@ * src/bindings-second-mode.lisp (sm-mouse-click-to-focus-generic): Create a new frame on the root window. -2008-03-29 Philippe Brochard +2008-03-29 Philippe Brochard * src/bindings-second-mode.lisp (sm-mouse-click-to-focus-generic): Focus, move and resize the current child (even if it's a window). -2008-03-28 Philippe Brochard +2008-03-28 Philippe Brochard * src/clfswm-util.lisp (mouse-click-to-focus-and-move) (mouse-click-to-focus-and-resize): New functions. @@ -34,7 +44,7 @@ * src/tools.lisp (call-hook): Move call-hook to tools.lisp. -2008-03-27 Philippe Brochard +2008-03-27 Philippe Brochard * src/clfswm-layout.lisp (no-layout): Use :first-only to raise only the first child. @@ -45,12 +55,12 @@ (show-child): Use a first-p parameter to raise windows only when they are first child. -2008-03-26 Philippe Brochard +2008-03-26 Philippe Brochard * src/clfswm-internal.lisp (select-next/previous-level): Don't use show-all-children -> less flickering. -2008-03-25 Philippe Brochard +2008-03-25 Philippe Brochard * src/clfswm-info.lisp (keys-from-list): new function. @@ -58,36 +68,36 @@ * src/*: rename 'group' in 'frame'. -2008-03-22 Philippe Brochard +2008-03-22 Philippe Brochard * src/clfswm-pack.lisp (explode-group/explode-current-group): new functions. -2008-03-21 Philippe Brochard +2008-03-21 Philippe Brochard * src/clfswm-pack.lisp: Pack, Fill, Resize functions. -2008-03-16 Philippe Brochard +2008-03-16 Philippe Brochard * src/clfswm-nw-hooks.lisp: Register system for new window hooks. Bind control+o to open the next window in a new group in the root group (as open in next window in a new workspace in 0801 version). -2008-03-15 Philippe Brochard +2008-03-15 Philippe Brochard * src/clfswm-util.lisp (show/hide-all-groups-info/key): Show/hide all groups info window. -2008-03-14 Philippe Brochard +2008-03-14 Philippe Brochard * bindings-second-mode.lisp ("ISO_Left_Tab"): Use ISO_Left_Tab instead of Tab for select-previous-child. -2008-03-13 Philippe Brochard +2008-03-13 Philippe Brochard * clfswm-util.lisp (force-window-in-group/force-window-center-in-group): new functions. -2008-03-11 Philippe Brochard +2008-03-11 Philippe Brochard * clfswm-util.lisp (identify-key): Display the documentation associated to keys when identifying a key. @@ -100,7 +110,7 @@ implementation (clisp and sbcl only), choose where to store the dumped image, where to find clfswm source. -2008-03-09 Philippe Brochard +2008-03-09 Philippe Brochard * clfswm-internal.lisp (process-new-window): Beginning of new window hook: each group have a hook to tell what he wants to do @@ -115,12 +125,12 @@ XDG_CONFIG_HOME *first*. Freedesktop.org standards should be prefered whenever possible. -2008-02-27 Philippe Brochard +2008-02-27 Philippe Brochard * clfswm-layout.lisp (*-layout): Add an optional raise-p parameter in each layout. -2008-02-26 Philippe Brochard +2008-02-26 Philippe Brochard * clfswm-util.lisp (copy/cut-current-child): Does not affect the root group. @@ -128,14 +138,14 @@ (focus-group-by-name/number): new functions (delete-group-by-name/number): new functions -2008-02-24 Philippe Brochard +2008-02-24 Philippe Brochard * ************************************************************ * *: Major update - No more reference to workspaces. The main * structure is a tree of groups or application windows. * * ************************************************************ * -2008-02-07 Philippe Brochard +2008-02-07 Philippe Brochard * clfswm.lisp (read-conf-file): Read configuration in $HOME/.clfswmrc or in /etc/clfswmrc or in @@ -143,18 +153,18 @@ (xdg-config-home): Return the content of $XDG-CONFIG-HOME (default to $HOME/.config/). -2008-01-18 Philippe Brochard +2008-01-18 Philippe Brochard * clfswm-internal.lisp (show-all-group): Use *root* and *root-gc* by default. -2008-01-03 Philippe Brochard +2008-01-03 Philippe Brochard * clfswm-internal.lisp (find-window-group): New function. * clfswm*: Change to make clfswm run with clisp/new-clx. -2008-01-01 Philippe Brochard +2008-01-01 Philippe Brochard * clfswm-util.lisp (query-show-paren): Add show parent matching in query string. @@ -171,7 +181,7 @@ * clfswm-internal.lisp (process-new-window): Adjust new window with the specified hints (max/min/base width/height). -2007-12-31 Philippe Brochard +2007-12-31 Philippe Brochard * clfswm.lisp (handle-configure-request): Send an Configuration Notify event. This solve a bug with xterm and rxvt who takes some @@ -180,7 +190,7 @@ * bindings-second-mode.lisp (define-shell): Run programs after living the second mode. -2007-12-30 Philippe Brochard +2007-12-30 Philippe Brochard * clfswm-internal.lisp (process-new-window): Do not crop transient window to group size. @@ -194,7 +204,7 @@ (handle-exposure): Remove show-all-group on exposure event -> Speed up. -2007-12-29 Philippe Brochard +2007-12-29 Philippe Brochard * clfswm-util.lisp (circulate-group-up-copy-window) (circulate-group-down-copy-window) @@ -223,13 +233,13 @@ * clfswm-internal.lisp (adapt-window-to-group): use set/= to set x, y... only when necessary. -2007-12-28 Philippe Brochard +2007-12-28 Philippe Brochard * clfswm.lisp (handle-configure-notify, *configure-notify-hook*): new function and hook: force windows to stay in its group (solve a bug with the Gimp). -2007-12-25 Philippe Brochard +2007-12-25 Philippe Brochard * bindings-second-mode.lisp (mouse-motion): use hide-group to have less flickering when moving/resizing groups. @@ -237,7 +247,7 @@ * clfswm-internal.lisp (hide-group): new function. (show-all-group): clear-all: new parameter. -2007-12-22 Philippe Brochard +2007-12-22 Philippe Brochard * clfswm-keys.lisp (define-define-key): undefine-*-multi-name: new macro. @@ -249,21 +259,21 @@ * config.lisp: new file - group all globals variables in this file. -2007-08-26 Philippe Brochard +2007-08-26 Philippe Brochard * xlib-util.lisp (hide-window): Remove structure-notivy events when hidding a window. -2007-05-16 Philippe Brochard +2007-05-16 Philippe Brochard * package.lisp (*sm-property-notify-hook*): Readded property-notify-hook in second mode. -2007-05-15 Philippe Brochard +2007-05-15 Philippe Brochard * clfswm-keys.lisp (produce-doc-html): Better clean up for strings. -2007-05-13 Philippe Brochard +2007-05-13 Philippe Brochard * clfswm-pack.lisp (tile-current-workspace-to/right/left/top/bottom): Tile the current workspace with the current window on one side and @@ -273,13 +283,13 @@ * clfswm-pager.lisp (pager-tile-current-workspace-to): idem for the pager. -2007-05-12 Philippe Brochard +2007-05-12 Philippe Brochard * clfswm-pager.lisp (pager-draw-window-in-group): Add ensure-printable to print windows name even with non-ascii characters. -2007-05-11 Philippe Brochard +2007-05-11 Philippe Brochard * clfswm-pager.lisp (pager-explode-current-group): Create a new group for each window in group. @@ -296,12 +306,12 @@ package.lisp. (query-string): idem. -2007-04-29 Philippe Brochard +2007-04-29 Philippe Brochard * netwm-util.lisp: Start of NetWM compliance. Add a Netwm client list gestion. -2007-04-28 Philippe Brochard +2007-04-28 Philippe Brochard * clfswm-internal.lisp (create-group-on-request): open a new group only when the current group is not empty. @@ -324,7 +334,7 @@ * clfswm.lisp (handle-event): Add a hook system. This hooks can be changed in the user configuration file (~/.clfswmrc) -2007-04-25 Philippe Brochard +2007-04-25 Philippe Brochard * clfswm-util.lisp (stop-all-pending-actions): new function: reset arrow action, open next window in new workspace/group. @@ -334,23 +344,23 @@ new group (only once) or open all new windows in a new group (like others windows managers). -2007-04-22 Philippe Brochard +2007-04-22 Philippe Brochard * clfswm.lisp (read-conf-file): New function to read a lisp configuration file at startup. (focus-group-under-mouse): Check if group isn't the current group ( prevent a bug with unclutter ). -2007-03-02 Philippe Brochard +2007-03-02 Philippe Brochard * bindings.lisp (run-program-from-query-string): A program can be launch from a input query window. -2007-03-01 Philippe Brochard +2007-03-01 Philippe Brochard * clfswm-info.lisp: Fix a bug with banish pointer in info mode. -2007-02-28 Philippe Brochard +2007-02-28 Philippe Brochard * clfswm.lisp (process-new-window): One can now open the next window in a workspace called by its number. @@ -359,7 +369,7 @@ capabilities. (eval-from-string): And an REPL in the window manager... :) -2007-02-26 Philippe Brochard +2007-02-26 Philippe Brochard * clfswm.lisp (process-new-window): One can now open the next window in a new workspace or a new group. @@ -373,12 +383,12 @@ * clfswm-pager.lisp (pager-mode): Hide all windows before leaving the pager mode and then redisplay only the current workspace. -2007-02-25 Philippe Brochard +2007-02-25 Philippe Brochard * clfswm.lisp (add-workspace): Workspaces are now numbered. So they can be focused with a keypress, sorted or renumbered. -2007-02-24 Philippe Brochard +2007-02-24 Philippe Brochard * clfswm-pager.lisp (pager-mode): Remove multiple silly pager-draw-display. This prevent a lot of flickering in the @@ -387,7 +397,7 @@ * clfswm.lisp: Remove all display-force-output and replace them with only one display-finish-output in the event loop. -2006-11-06 Philippe Brochard +2006-11-06 Philippe Brochard * clfswm-pager.lisp (pager-center-group): New function - center a group at the middle of the screen. @@ -399,7 +409,7 @@ (show-group): Group are showned even if fullscreened. (init-display): Add an exposure event on the root window. -2006-11-05 Philippe Brochard +2006-11-05 Philippe Brochard * package.lisp (*default-group*): Default group is the same size of a fullscreened group. @@ -413,7 +423,7 @@ * clfswm.lisp (second-key-mode): Use a single window to show the second mode. See for alternatives at the end of this file. -2006-11-03 Philippe Brochard +2006-11-03 Philippe Brochard * clfswm-keys.lisp (define-define-key/mouse): Factorisation in a macro of key and mouse definitions. @@ -422,18 +432,18 @@ * clfswm.lisp (second-key-mode): Add a colored border in second mode. -2006-11-02 Philippe Brochard +2006-11-02 Philippe Brochard * clfswm-info.lisp (info-mode): Add an info mode. -2006-11-01 Philippe Brochard +2006-11-01 Philippe Brochard * clfswm.lisp (process-new-window): Change border size for transient windows. (show-all-windows-in-workspace): Unhide all windows even when the current group is in fullscreen mode. -2006-10-26 Philippe Brochard +2006-10-26 Philippe Brochard * clfswm-util.lisp (identify-key): Add an exposure handle-event to redisplay the identify window after a terminal switch. @@ -441,7 +451,7 @@ * clfswm-pager.lisp (pager-mode): Add an exposure handle-event to redisplay the pager after a terminal switch. -2006-10-24 Philippe Brochard +2006-10-24 Philippe Brochard * clfswm-util.lisp (identify-key): Add a window to display the keys to identify on screen. @@ -454,11 +464,11 @@ (show-all-windows-in-workspace): unhide window before adapting it to group. -2006-10-23 Philippe Brochard +2006-10-23 Philippe Brochard * clfswm.lisp (handle-event): Revert to an older version. -2006-10-18 Philippe Brochard +2006-10-18 Philippe Brochard * clfswm-util.lisp (force-window-in-group) (force-window-center-in-group): New functions for transient windows. @@ -466,7 +476,7 @@ * clfswm-pager.lisp (pager-remove-current-workspace/group): bugfix: hide all windows before removing group or workspace. -2006-10-17 Philippe Brochard +2006-10-17 Philippe Brochard * bindings-pager.lisp (mouse-pager-move-selected-group) (mouse-pager-copy-selected-group) @@ -479,7 +489,7 @@ (pager-copy-group-on-next/previous-workspace) (pager-copy-window-on-next/previous-line): New functions -2006-10-15 Philippe Brochard +2006-10-15 Philippe Brochard * clfswm-pager.lisp (pager-move-window-on-next/previous-line, (pager-move-group-on-next/previous-workspace): new functions. @@ -487,22 +497,22 @@ * clfswm-pack.lisp (resize-half-x-x-current-group): resize group to its half size (new functions). -2006-10-11 Philippe Brochard +2006-10-11 Philippe Brochard * clfswm-pager.lisp: workspaces, groups and windows can now be selectionned with the keyboard or the mouse. -2006-10-09 Philippe Brochard +2006-10-09 Philippe Brochard * clfswm-pager.lisp (pager-select-workspace-right/left): workspaces can now be selectionned with the keyboard. -2006-10-08 Philippe Brochard +2006-10-08 Philippe Brochard * clfswm-keys.lisp (undefine-main-key, undefine-second-key, undefine-mouse-action): new function to remove a previous defined key or mouse combination. -2006-10-07 Philippe Brochard +2006-10-07 Philippe Brochard * clfswm.lisp (main): Check for access error in init-display. @@ -514,12 +524,12 @@ (define-shell): new macro to define shell command for the second mode. -2006-10-06 Philippe Brochard +2006-10-06 Philippe Brochard * clfswm-keys.lisp (define-ungrab/grab): use a cond instead of a boggus typecase. -2006-10-05 Philippe Brochard +2006-10-05 Philippe Brochard * bindings.lisp (accept-motion): Move group bugfix in upper mouse workspace circulation. @@ -528,19 +538,19 @@ * clfswm-keys.lisp: Keysyms support. -2006-10-02 Philippe Brochard +2006-10-02 Philippe Brochard * clfswm.lisp (show-group): Use one gc for all groups and not one per group. -2006-10-01 Philippe Brochard +2006-10-01 Philippe Brochard * bindings.lisp (define-second-key (#\l :mod-1)): fix a typo. * clfswm.lisp (adapt-window-to-group): Adapt only windows with width and height outside group. -2006-09-28 Philippe Brochard +2006-09-28 Philippe Brochard * clfswm.lisp: First public release. Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Tue Apr 1 14:51:45 2008 @@ -8,11 +8,9 @@ Should handle these soon. Rewrote all useful code present in 0801 version. -- Hide a window when its size is less than hint minimal size. [Philippe] -- Bind alt+1/2/3/4... to a particular child: [Philippe] - If bind exist -> focus this child - If not -> bind the key to the current-child - Bind alt+control+1/2/3/4... to remove binding on a child. +- Hide a window when its size is less than minimal hint size. [Philippe] +- Bind alt+1/2/3/4... to a particular child (current root and current child) [Philippe] + Open a menu: Space -> jump to child Enter -> bind current child to key - Hook to open next window in named/numbered frame [Philippe] @@ -30,7 +28,20 @@ get-frame-by-name (path): return the frame that its own frame has this name if it exists such a frame get-window-by-name (path): return the window that its own frame that its own frame has this name if it exists such a window. -- Adapt frame to window hints +- Adapt frame to window hints [Philippe] + +- Show config -> list and display documentation for all tweakable global variables. [Philippe] + +- Set Layout once [Philippe] + +- A Gimp layout example [Philippe] + +- Add a show-all-children without recomputation of geometry (ie: use real coordinates + and redisplay only the wanted child). + Split computation of geometry outside of show-all-children. [Philippe] + +- Bind Control+Alt+Mouse 1/2 to move and resize father frame in main mode [Philippe] + MAYBE @@ -60,8 +71,3 @@ - cd/pwd a la shell to navigate throu frames. [Philippe] - -NEVER -===== - -Nothing here for now. Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Tue Apr 1 14:51:45 2008 @@ -345,11 +345,15 @@ (with-xlib-protect (multiple-value-bind (nx ny nw nh raise-p) (get-father-layout window father) - (setf (xlib:drawable-x window) nx - (xlib:drawable-y window) ny - (xlib:drawable-width window) nw - (xlib:drawable-height window) nh) - raise-p))) + (let ((change (or (/= (xlib:drawable-x window) nx) + (/= (xlib:drawable-y window) ny) + (/= (xlib:drawable-width window) nw) + (/= (xlib:drawable-height window) nh)))) + (setf (xlib:drawable-x window) nx + (xlib:drawable-y window) ny + (xlib:drawable-width window) nw + (xlib:drawable-height window) nh) + (values raise-p change))))) (defmethod adapt-child-to-father ((frame frame) father) (with-xlib-protect @@ -357,11 +361,15 @@ (get-father-layout frame father) (with-slots (rx ry rw rh window) frame (setf rx nx ry ny rw nw rh nh) - (setf (xlib:drawable-x window) rx - (xlib:drawable-y window) ry - (xlib:drawable-width window) rw - (xlib:drawable-height window) rh) - raise-p)))) + (let ((change (or (/= (xlib:drawable-x window) rx) + (/= (xlib:drawable-y window) ry) + (/= (xlib:drawable-width window) rw) + (/= (xlib:drawable-height window) rh)))) + (setf (xlib:drawable-x window) rx + (xlib:drawable-y window) ry + (xlib:drawable-width window) rw + (xlib:drawable-height window) rh) + (values raise-p change)))))) @@ -377,21 +385,28 @@ (defmethod show-child ((frame frame) father first-p) (with-xlib-protect (with-slots (window) frame - (let ((raise-p (adapt-child-to-father frame father))) + (multiple-value-bind (raise-p geometry-change) + (adapt-child-to-father frame father) (when (or *show-root-frame-p* (not (equal frame *current-root*))) (setf (xlib:window-background window) (get-color "Black")) (xlib:map-window window) (raise-if-needed window raise-p first-p) - (display-frame-info frame)))))) + (display-frame-info frame)) + geometry-change)))) (defmethod show-child ((window xlib:window) father first-p) (with-xlib-protect - (let ((raise-p nil)) + (let ((raise-p nil) + (geometry-change nil)) (when (eql (window-type window) :normal) - (setf raise-p (adapt-child-to-father window father))) + (multiple-value-bind (to-raise change) + (adapt-child-to-father window father) + (setf raise-p to-raise + geometry-change change))) (xlib:map-window window) - (raise-if-needed window raise-p first-p)))) + (raise-if-needed window raise-p first-p) + geometry-change))) @@ -446,16 +461,19 @@ (defun show-all-children () "Show all children from *current-root*" - (labels ((rec (root father first-p first-father) - (show-child root father first-p) - (select-child root (if (equal root *current-child*) t - (if (and first-p first-father) :maybe nil))) - (when (frame-p root) - (let ((first-child (first (frame-child root)))) - (dolist (child (reverse (frame-child root))) - (rec child root (equal child first-child) first-p)))))) - (rec *current-root* nil t t) - (set-focus-to-current-child))) + (let ((geometry-change nil)) + (labels ((rec (root father first-p first-father) + (when (show-child root father first-p) + (setf geometry-change t)) + (select-child root (if (equal root *current-child*) t + (if (and first-p first-father) :maybe nil))) + (when (frame-p root) + (let ((first-child (first (frame-child root)))) + (dolist (child (reverse (frame-child root))) + (rec child root (equal child first-child) first-p)))))) + (rec *current-root* nil t t) + (set-focus-to-current-child) + geometry-change))) @@ -692,8 +710,6 @@ (:transient 1) (t 1))) (grab-all-buttons window) -;; (when (frame-p *current-child*) ;; PHIL: Remove this!!! -;; (setf (frame-nw-hook *current-child*) #'open-in-new-frame-nw-hook)) (unless (do-all-frames-nw-hook window) (default-frame-nw-hook nil window)) (netwm-add-in-client-list window))) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Tue Apr 1 14:51:45 2008 @@ -573,8 +573,8 @@ (when child (funcall mouse-fn child father root-x root-y))) (when (and child father (focus-all-children child father)) - (show-all-children) - (setf to-replay nil))) + (when (show-all-children) + (setf to-replay nil)))) (if to-replay (replay-button-event) (stop-button-event)))) Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Tue Apr 1 14:51:45 2008 @@ -35,8 +35,6 @@ (funcall-key-from-code *main-keys* code state)) -;; PHIL: TODO: focus-policy by frame -;; :click, :sloppy, :nofocus (defun handle-button-press (&rest event-slots &key code state window root-x root-y &allow-other-keys) (declare (ignore event-slots)) (unless (funcall-button-from-code *main-mouse* code state window root-x root-y #'first) Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Tue Apr 1 14:51:45 2008 @@ -314,7 +314,7 @@ (with-xlib-protect (raise-window window) (xlib:set-input-focus *display* window :parent)))) - ;;(xlib:set-input-focus *display* :pointer-root :pointer-root)) ;;PHIL + From pbrochard at common-lisp.net Tue Apr 1 20:14:55 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Tue, 1 Apr 2008 15:14:55 -0500 (EST) Subject: [clfswm-cvs] r64 - in clfswm: . src Message-ID: <20080401201455.E8839610B2@common-lisp.net> Author: pbrochard Date: Tue Apr 1 15:14:53 2008 New Revision: 64 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/bindings-second-mode.lisp clfswm/src/bindings.lisp clfswm/src/clfswm-util.lisp Log: Bind Alt+mouse-1/3 to move or resize a frame or the window's father. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Tue Apr 1 15:14:53 2008 @@ -1,7 +1,12 @@ -2008-04-01 Philippe Brochard +2008-04-01 Philippe Brochard + + * src/bindings.lisp: Bind Alt+mouse-1/3 to move or resize a frame + or the window's father. * src/clfswm-util.lisp (mouse-click-to-focus-generic): Stop button event only if there is a geometry change. + (mouse-focus-move/resize-generic): Generic function to move or + resize a frame or a window father frame. 2008-04-01 Philippe Brochard Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Tue Apr 1 15:14:53 2008 @@ -40,8 +40,6 @@ and redisplay only the wanted child). Split computation of geometry outside of show-all-children. [Philippe] -- Bind Control+Alt+Mouse 1/2 to move and resize father frame in main mode [Philippe] - MAYBE Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Tue Apr 1 15:14:53 2008 @@ -359,30 +359,15 @@ ;;; Mouse action -(defun sm-mouse-click-to-focus-generic (window root-x root-y mouse-fn) - (declare (ignore window)) - (let* ((child (find-child-under-mouse root-x root-y)) - (father (find-father-frame child))) - (when (equal child *current-root*) - (setf child (create-frame) - father *current-root* - mouse-fn #'resize-frame) - (place-frame child father root-x root-y 10 10) - (xlib:map-window (frame-window child)) - (pushnew child (frame-child *current-root*))) - (typecase child - (xlib:window (funcall mouse-fn father (find-father-frame father) root-x root-y)) - (frame (funcall mouse-fn child father root-x root-y))) - (focus-all-children child father nil) - (show-all-children))) - (defun sm-mouse-click-to-focus-and-move (window root-x root-y) "Move and focus the current child - Create a new frame on the root window" - (sm-mouse-click-to-focus-generic window root-x root-y #'move-frame)) + (declare (ignore window)) + (mouse-focus-move/resize-generic root-x root-y #'move-frame nil)) (defun sm-mouse-click-to-focus-and-resize (window root-x root-y) "Resize and focus the current child - Create a new frame on the root window" - (sm-mouse-click-to-focus-generic window root-x root-y #'resize-frame)) + (declare (ignore window)) + (mouse-focus-move/resize-generic root-x root-y #'resize-frame nil)) Modified: clfswm/src/bindings.lisp ============================================================================== --- clfswm/src/bindings.lisp (original) +++ clfswm/src/bindings.lisp Tue Apr 1 15:14:53 2008 @@ -79,9 +79,25 @@ ;;; Mouse actions +(defun mouse-click-to-focus-and-move-window (window root-x root-y) + "Move and focus the current child - Create a new frame on the root window" + (declare (ignore window)) + (mouse-focus-move/resize-generic root-x root-y #'move-frame t)) + +(defun mouse-click-to-focus-and-resize-window (window root-x root-y) + "Resize and focus the current child - Create a new frame on the root window" + (declare (ignore window)) + (mouse-focus-move/resize-generic root-x root-y #'resize-frame t)) + + + + (define-main-mouse (1) 'mouse-click-to-focus-and-move) (define-main-mouse (3) 'mouse-click-to-focus-and-resize) +(define-main-mouse (1 :mod-1) 'mouse-click-to-focus-and-move-window) +(define-main-mouse (3 :mod-1) 'mouse-click-to-focus-and-resize-window) + (define-main-mouse (4) 'mouse-select-next-level) (define-main-mouse (5) 'mouse-select-previous-level) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Tue Apr 1 15:14:53 2008 @@ -589,6 +589,30 @@ + +(defun mouse-focus-move/resize-generic (root-x root-y mouse-fn window-father) + "Focus the current frame or focus the current window father +mouse-fun is #'move-frame or #'resize-frame. +Focus child and its fathers - +For window: set current child to window or its father according to window-father" + (let* ((child (find-child-under-mouse root-x root-y)) + (father (find-father-frame child))) + (when (equal child *current-root*) + (setf child (create-frame) + father *current-root* + mouse-fn #'resize-frame) + (place-frame child father root-x root-y 10 10) + (xlib:map-window (frame-window child)) + (pushnew child (frame-child *current-root*))) + (typecase child + (xlib:window (funcall mouse-fn father (find-father-frame father) root-x root-y)) + (frame (funcall mouse-fn child father root-x root-y))) + (focus-all-children child father window-father) + (show-all-children))) + + + + (defun test-mouse-binding (window root-x root-y) (dbg window root-x root-y) (replay-button-event)) From pbrochard at common-lisp.net Wed Apr 2 19:15:35 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Wed, 2 Apr 2008 14:15:35 -0500 (EST) Subject: [clfswm-cvs] r65 - in clfswm: . src Message-ID: <20080402191535.3845F4E03B@common-lisp.net> Author: pbrochard Date: Wed Apr 2 14:15:33 2008 New Revision: 65 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/clfswm-internal.lisp Log: Limit minimal child size to 1x1. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Wed Apr 2 14:15:33 2008 @@ -1,3 +1,8 @@ +2008-04-02 Philippe Brochard + + * src/clfswm-internal.lisp (adapt-child-to-father): Limit minimal + child size to 1x1. + 2008-04-01 Philippe Brochard * src/bindings.lisp: Bind Alt+mouse-1/3 to move or resize a frame Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Wed Apr 2 14:15:33 2008 @@ -8,7 +8,6 @@ Should handle these soon. Rewrote all useful code present in 0801 version. -- Hide a window when its size is less than minimal hint size. [Philippe] - Bind alt+1/2/3/4... to a particular child (current root and current child) [Philippe] Open a menu: Space -> jump to child Enter -> bind current child to key Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Wed Apr 2 14:15:33 2008 @@ -339,12 +339,14 @@ (get-fullscreen-size))) + (defgeneric adapt-child-to-father (child father)) (defmethod adapt-child-to-father ((window xlib:window) father) (with-xlib-protect (multiple-value-bind (nx ny nw nh raise-p) (get-father-layout window father) + (setf nw (max nw 1) nh (max nh 1)) (let ((change (or (/= (xlib:drawable-x window) nx) (/= (xlib:drawable-y window) ny) (/= (xlib:drawable-width window) nw) @@ -360,7 +362,9 @@ (multiple-value-bind (nx ny nw nh raise-p) (get-father-layout frame father) (with-slots (rx ry rw rh window) frame - (setf rx nx ry ny rw nw rh nh) + (setf rx nx ry ny + rw (max nw 1) + rh (max nh 1)) (let ((change (or (/= (xlib:drawable-x window) rx) (/= (xlib:drawable-y window) ry) (/= (xlib:drawable-width window) rw) From pbrochard at common-lisp.net Wed Apr 2 22:06:15 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Wed, 2 Apr 2008 17:06:15 -0500 (EST) Subject: [clfswm-cvs] r66 - in clfswm: . src Message-ID: <20080402220615.5D04275138@common-lisp.net> Author: pbrochard Date: Wed Apr 2 17:06:10 2008 New Revision: 66 Modified: clfswm/ChangeLog clfswm/src/bindings-second-mode.lisp clfswm/src/bindings.lisp clfswm/src/clfswm-info.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp clfswm/src/tools.lisp clfswm/src/xlib-util.lisp Log: bind-or-jump: New (great) function. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Wed Apr 2 17:06:10 2008 @@ -1,5 +1,27 @@ +2008-04-03 Philippe Brochard + + * src/clfswm-util.lisp (bind-or-jump): New (great) function. + 2008-04-02 Philippe Brochard + * src/clfswm-internal.lisp (child-fullname): New function + + * src/clfswm-info.lisp (info-mode-menu): Add an explicit optional + docstring in info-mode-menu. An item can be + '((key function) (key function)) or with docstring + '((key function "documentation 1") (key function "bla bla") (key function)) + + * src/tools.lisp (ensure-n-elems): New function. + + * src/bindings-second-mode.lisp: Bind Alt+mouse-1/3 to move or + resize a frame or the window's father. + + * src/clfswm.lisp (init-display): Remove tile-space-layout by + default on the root frame. + + * src/clfswm-util.lisp (move/resize-frame): Add standard event + hooks handlers (map-request, configure-notify...) + * src/clfswm-internal.lisp (adapt-child-to-father): Limit minimal child size to 1x1. Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Wed Apr 2 17:06:10 2008 @@ -404,6 +404,9 @@ (define-second-mouse (1) 'sm-mouse-click-to-focus-and-move) (define-second-mouse (3) 'sm-mouse-click-to-focus-and-resize) +(define-second-mouse (1 :mod-1) 'mouse-click-to-focus-and-move-window) +(define-second-mouse (3 :mod-1) 'mouse-click-to-focus-and-resize-window) + (define-second-mouse (4) 'sm-mouse-select-next-level) (define-second-mouse (5) 'sm-mouse-select-previous-level) Modified: clfswm/src/bindings.lisp ============================================================================== --- clfswm/src/bindings.lisp (original) +++ clfswm/src/bindings.lisp Wed Apr 2 17:06:10 2008 @@ -78,6 +78,35 @@ +;;; Bind or jump functions +(define-main-key ("1" :mod-1) 'bind-or-jump-1) +(define-main-key ("2" :mod-1) 'bind-or-jump-2) +(define-main-key ("3" :mod-1) 'bind-or-jump-3) +(define-main-key ("4" :mod-1) 'bind-or-jump-4) +(define-main-key ("5" :mod-1) 'bind-or-jump-5) +(define-main-key ("6" :mod-1) 'bind-or-jump-6) +(define-main-key ("7" :mod-1) 'bind-or-jump-7) +(define-main-key ("8" :mod-1) 'bind-or-jump-8) +(define-main-key ("9" :mod-1) 'bind-or-jump-9) +(define-main-key ("0" :mod-1) 'bind-or-jump-10) + + +;; For an azery keyboard: +;;(define-main-key ("ampersand" :mod-1) 'bind-or-jump-1) +;;(define-main-key ("eacute" :mod-1) 'bind-or-jump-2) +;;(define-main-key ("quotedbl" :mod-1) 'bind-or-jump-3) +;;(define-main-key ("quoteright" :mod-1) 'bind-or-jump-4) +;;(define-main-key ("parenleft" :mod-1) 'bind-or-jump-5) +;;(define-main-key ("minus" :mod-1) 'bind-or-jump-6) +;;(define-main-key ("egrave" :mod-1) 'bind-or-jump-7) +;;(define-main-key ("underscore" :mod-1) 'bind-or-jump-8) +;;(define-main-key ("ccedilla" :mod-1) 'bind-or-jump-9) +;;(define-main-key ("agrave" :mod-1) 'bind-or-jump-10) + + + + + ;;; Mouse actions (defun mouse-click-to-focus-and-move-window (window root-x root-y) "Move and focus the current child - Create a new frame on the root window" Modified: clfswm/src/clfswm-info.lisp ============================================================================== --- clfswm/src/clfswm-info.lisp (original) +++ clfswm/src/clfswm-info.lisp Wed Apr 2 17:06:10 2008 @@ -294,12 +294,14 @@ (defun info-mode-menu (item-list &key (x 0) (y 0) (width nil) (height nil)) "Open an info help menu. Item-list is: '((key function) (key function)) +or with explicit docstring: '((key function \"documentation 1\") (key function \"bla bla\") (key function)) key is a character, a keycode or a keysym" (let ((info-list nil) (action nil)) (dolist (item item-list) - (destructuring-bind (key function) item - (push (format nil "~A: ~A" key (documentation function 'function)) + (destructuring-bind (key function explicit-doc) (ensure-n-elems item 3) + (push (format nil "~@(~A~): ~A" key (or explicit-doc + (documentation function 'function))) info-list) (define-info-key-fun (list key 0) (lambda (&optional args) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Wed Apr 2 17:06:10 2008 @@ -111,6 +111,22 @@ "???") +(defgeneric child-fullname (child)) + +(defmethod child-fullname ((child xlib:window)) + (format nil "~A (~A)" (xlib:wm-name child) (xlib:get-wm-class child))) + +(defmethod child-fullname ((child frame)) + (aif (frame-name child) + (format nil "~A (Frame ~A)" it (frame-number child)) + (format nil "Frame ~A" (frame-number child)))) + +(defmethod child-fullname (child) + (declare (ignore child)) + "???") + + + (defgeneric rename-child (child name)) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Wed Apr 2 17:06:10 2008 @@ -505,7 +505,17 @@ (handle-event (&rest event-slots &key event-key &allow-other-keys) (case event-key (:motion-notify (apply #'motion-notify event-slots)) - (:button-release (setf done t))) + (:button-release (setf done t)) + (:configure-request (call-hook *configure-request-hook* event-slots)) + (:configure-notify (call-hook *configure-notify-hook* event-slots)) + (:map-request (call-hook *map-request-hook* event-slots)) + (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) + (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) + (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) + (:property-notify (call-hook *property-notify-hook* event-slots)) + (:create-notify (call-hook *create-notify-hook* event-slots)) + (:enter-notify (call-hook *enter-notify-hook* event-slots)) + (:exposure (call-hook *exposure-hook* event-slots))) t)) (when frame (loop until done @@ -537,7 +547,17 @@ (handle-event (&rest event-slots &key event-key &allow-other-keys) (case event-key (:motion-notify (apply #'motion-notify event-slots)) - (:button-release (setf done t))) + (:button-release (setf done t)) + (:configure-request (call-hook *configure-request-hook* event-slots)) + (:configure-notify (call-hook *configure-notify-hook* event-slots)) + (:map-request (call-hook *map-request-hook* event-slots)) + (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) + (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) + (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) + (:property-notify (call-hook *property-notify-hook* event-slots)) + (:create-notify (call-hook *create-notify-hook* event-slots)) + (:enter-notify (call-hook *enter-notify-hook* event-slots)) + (:exposure (call-hook *exposure-hook* event-slots))) t)) (when frame (loop until done @@ -676,3 +696,49 @@ (produce-doc-html-in-file tempfile)) (sleep 1) (do-shell (format nil "~A ~A" browser tempfile))) + + + +;;; Bind or jump functions +(let ((key-slots (make-array 10 :initial-element nil)) + (current-slot 0)) + (defun bind-on-slot () + "Bind current child to slot" + (setf (aref key-slots current-slot) *current-child*)) + + (defun remove-binding-on-slot () + "Remove binding on slot" + (setf (aref key-slots current-slot) nil)) + + (defun jump-to-slot () + "Jump to slot" + (hide-all *current-root*) + (setf *current-root* (aref key-slots current-slot) + *current-child* *current-root*) + (focus-all-children *current-child* *current-child*) + (show-all-children)) + + (defun bind-or-jump (n) + (let ((default-bind `("Return" bind-on-slot + ,(format nil "Bind slot ~A on child: ~A" n (child-fullname *current-child*))))) + (setf current-slot (- n 1)) + (info-mode-menu (aif (aref key-slots current-slot) + `(,default-bind + ("BackSpace" remove-binding-on-slot + ,(format nil "Remove slot ~A binding on child: ~A" n (child-fullname *current-child*))) + (" - " nil " -") + ("Tab" jump-to-slot + ,(format nil "Jump to child: ~A" (aif (aref key-slots current-slot) + (child-fullname it) + "Not set - Please, bind it with Return")))) + (list default-bind)))))) + +(defmacro def-bind-or-jump () + `(progn + ,@(loop for i from 1 to 10 + collect `(defun ,(intern (format nil "BIND-OR-JUMP-~A" i)) () + ,(format nil "Bind or jump to the child on slot ~A" i) + (bind-or-jump ,i))))) + + +(def-bind-or-jump) Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Wed Apr 2 17:06:10 2008 @@ -219,10 +219,10 @@ (netwm-set-properties) (xlib:display-force-output *display*) (setf *child-selection* nil) - (setf *root-frame* (create-frame :name "Root" :number 0 :layout #'tile-space-layout) + (setf *root-frame* (create-frame :name "Root" :number 0) ;; :layout #'tile-space-layout) *current-root* *root-frame* *current-child* *current-root*) - (add-frame (create-frame :name "Default" :layout nil :x 0.1 :y 0.1 :w 0.8 :h 0.8) *root-frame*) + (add-frame (create-frame :name "Default" :layout nil :x 0.05 :y 0.05 :w 0.9 :h 0.9) *root-frame*) (setf *current-child* (first (frame-child *current-root*))) (call-hook *init-hook*) (process-existing-windows *screen*) Modified: clfswm/src/tools.lisp ============================================================================== --- clfswm/src/tools.lisp (original) +++ clfswm/src/tools.lisp Wed Apr 2 17:06:10 2008 @@ -40,6 +40,7 @@ :expand-newline :ensure-list :ensure-printable + :ensure-n-elems :find-assoc-word :print-space :escape-string @@ -200,6 +201,15 @@ (substitute-if-not new #'standard-char-p string)) +(defun ensure-n-elems (list n) + "Ensure that list has exactly n elements" + (let ((length (length list))) + (cond ((= length n) list) + ((< length n) (ensure-n-elems (append list '(nil)) n)) + ((> length n) (ensure-n-elems (butlast list) n))))) + + + (defun find-assoc-word (word line &optional (delim #\")) Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Wed Apr 2 17:06:10 2008 @@ -70,7 +70,8 @@ (progn , at body) ((or xlib:match-error xlib:window-error xlib:drawable-error) (c) - (dbg c ',body)))) + (declare (ignore c))))) + ;;(dbg c ',body)))) From pbrochard at common-lisp.net Fri Apr 4 20:54:04 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 4 Apr 2008 15:54:04 -0500 (EST) Subject: [clfswm-cvs] r67 - in clfswm: . src Message-ID: <20080404205404.2EA03751B5@common-lisp.net> Author: pbrochard Date: Fri Apr 4 15:53:59 2008 New Revision: 67 Modified: clfswm/ChangeLog clfswm/src/bindings-second-mode.lisp clfswm/src/bindings.lisp clfswm/src/clfswm-info.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-keys.lisp clfswm/src/clfswm-second-mode.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp Log: Allow additional arguments to function on key/mouse press/release. Add keys definitions to bind-or-jump in the second mode. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 4 15:53:59 2008 @@ -1,3 +1,16 @@ +2008-04-04 Philippe Brochard + + * src/bindings-second-mode.lisp: Add keys definitions to + bind-or-jump in the second mode. + + * src/clfswm-util.lisp (bind-or-jump): remove the auto-defining + macro for bind-or-jump-(1|2|3...). + + * src/clfswm-keys.lisp (define-define-key/mouse): Allow additional + arguments to function. This allow to do things like: + (define-main-key (key) 'my-function 10 20 'foo) -> 10 20 and 'foo + are passed to my-function on key press. + 2008-04-03 Philippe Brochard * src/clfswm-util.lisp (bind-or-jump): New (great) function. Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Fri Apr 4 15:53:59 2008 @@ -353,6 +353,36 @@ (define-second-key ("Menu" :control) 'toggle-show-root-frame) +;;; Bind or jump functions +(define-second-key ("1" :mod-1) 'bind-or-jump 1) +(define-second-key ("2" :mod-1) 'bind-or-jump 2) +(define-second-key ("3" :mod-1) 'bind-or-jump 3) +(define-second-key ("4" :mod-1) 'bind-or-jump 4) +(define-second-key ("5" :mod-1) 'bind-or-jump 5) +(define-second-key ("6" :mod-1) 'bind-or-jump 6) +(define-second-key ("7" :mod-1) 'bind-or-jump 7) +(define-second-key ("8" :mod-1) 'bind-or-jump 8) +(define-second-key ("9" :mod-1) 'bind-or-jump 9) +(define-second-key ("0" :mod-1) 'bind-or-jump 10) + + +;; For an azery keyboard: +;;(undefine-second-multi-keys (#\1 :mod-1) (#\2 :mod-1) (#\3 :mod-1) +;; (#\4 :mod-1) (#\5 :mod-1) (#\6 :mod-1) +;; (#\7 :mod-1) (#\8 :mod-1) (#\9 :mod-1) (#\0 :mod-1)) +;;(define-second-key ("ampersand" :mod-1) 'bind-or-jump 1) +;;(define-second-key ("eacute" :mod-1) 'bind-or-jump 2) +;;(define-second-key ("quotedbl" :mod-1) 'bind-or-jump 3) +;;(define-second-key ("quoteright" :mod-1) 'bind-or-jump 4) +;;(define-second-key ("parenleft" :mod-1) 'bind-or-jump 5) +;;(define-second-key ("minus" :mod-1) 'bind-or-jump 6) +;;(define-second-key ("egrave" :mod-1) 'bind-or-jump 7) +;;(define-second-key ("underscore" :mod-1) 'bind-or-jump 8) +;;(define-second-key ("ccedilla" :mod-1) 'bind-or-jump 9) +;;(define-second-key ("agrave" :mod-1) 'bind-or-jump 10) + + + Modified: clfswm/src/bindings.lisp ============================================================================== --- clfswm/src/bindings.lisp (original) +++ clfswm/src/bindings.lisp Fri Apr 4 15:53:59 2008 @@ -31,7 +31,6 @@ ;;;| CONFIG - Bindings main mode ;;;`----- - (define-main-key ("F1" :mod-1) 'help-on-clfswm) (defun quit-clfswm () @@ -79,29 +78,32 @@ ;;; Bind or jump functions -(define-main-key ("1" :mod-1) 'bind-or-jump-1) -(define-main-key ("2" :mod-1) 'bind-or-jump-2) -(define-main-key ("3" :mod-1) 'bind-or-jump-3) -(define-main-key ("4" :mod-1) 'bind-or-jump-4) -(define-main-key ("5" :mod-1) 'bind-or-jump-5) -(define-main-key ("6" :mod-1) 'bind-or-jump-6) -(define-main-key ("7" :mod-1) 'bind-or-jump-7) -(define-main-key ("8" :mod-1) 'bind-or-jump-8) -(define-main-key ("9" :mod-1) 'bind-or-jump-9) -(define-main-key ("0" :mod-1) 'bind-or-jump-10) +(define-main-key ("1" :mod-1) 'bind-or-jump 1) +(define-main-key ("2" :mod-1) 'bind-or-jump 2) +(define-main-key ("3" :mod-1) 'bind-or-jump 3) +(define-main-key ("4" :mod-1) 'bind-or-jump 4) +(define-main-key ("5" :mod-1) 'bind-or-jump 5) +(define-main-key ("6" :mod-1) 'bind-or-jump 6) +(define-main-key ("7" :mod-1) 'bind-or-jump 7) +(define-main-key ("8" :mod-1) 'bind-or-jump 8) +(define-main-key ("9" :mod-1) 'bind-or-jump 9) +(define-main-key ("0" :mod-1) 'bind-or-jump 10) ;; For an azery keyboard: -;;(define-main-key ("ampersand" :mod-1) 'bind-or-jump-1) -;;(define-main-key ("eacute" :mod-1) 'bind-or-jump-2) -;;(define-main-key ("quotedbl" :mod-1) 'bind-or-jump-3) -;;(define-main-key ("quoteright" :mod-1) 'bind-or-jump-4) -;;(define-main-key ("parenleft" :mod-1) 'bind-or-jump-5) -;;(define-main-key ("minus" :mod-1) 'bind-or-jump-6) -;;(define-main-key ("egrave" :mod-1) 'bind-or-jump-7) -;;(define-main-key ("underscore" :mod-1) 'bind-or-jump-8) -;;(define-main-key ("ccedilla" :mod-1) 'bind-or-jump-9) -;;(define-main-key ("agrave" :mod-1) 'bind-or-jump-10) +;;(undefine-main-multi-keys (#\1 :mod-1) (#\2 :mod-1) (#\3 :mod-1) +;; (#\4 :mod-1) (#\5 :mod-1) (#\6 :mod-1) +;; (#\7 :mod-1) (#\8 :mod-1) (#\9 :mod-1) (#\0 :mod-1)) +;;(define-main-key ("ampersand" :mod-1) 'bind-or-jump 1) +;;(define-main-key ("eacute" :mod-1) 'bind-or-jump 2) +;;(define-main-key ("quotedbl" :mod-1) 'bind-or-jump 3) +;;(define-main-key ("quoteright" :mod-1) 'bind-or-jump 4) +;;(define-main-key ("parenleft" :mod-1) 'bind-or-jump 5) +;;(define-main-key ("minus" :mod-1) 'bind-or-jump 6) +;;(define-main-key ("egrave" :mod-1) 'bind-or-jump 7) +;;(define-main-key ("underscore" :mod-1) 'bind-or-jump 8) +;;(define-main-key ("ccedilla" :mod-1) 'bind-or-jump 9) +;;(define-main-key ("agrave" :mod-1) 'bind-or-jump 10) @@ -119,8 +121,6 @@ (mouse-focus-move/resize-generic root-x root-y #'resize-frame t)) - - (define-main-mouse (1) 'mouse-click-to-focus-and-move) (define-main-mouse (3) 'mouse-click-to-focus-and-resize) Modified: clfswm/src/clfswm-info.lisp ============================================================================== --- clfswm/src/clfswm-info.lisp (original) +++ clfswm/src/clfswm-info.lisp Fri Apr 4 15:53:59 2008 @@ -237,13 +237,13 @@ (declare (ignore event-slots)) (unless (xlib:event-case (*display* :discard-p nil :peek-p t :timeout 0) (:motion-notify () t)) - (funcall-button-from-code *info-mouse* 'motion 0 window root-x root-y #'first info))) + (funcall-button-from-code *info-mouse* 'motion 0 window root-x root-y *fun-press* (list info)))) (handle-button-press (&rest event-slots &key window root-x root-y code state &allow-other-keys) (declare (ignore event-slots)) - (funcall-button-from-code *info-mouse* code state window root-x root-y #'first info)) + (funcall-button-from-code *info-mouse* code state window root-x root-y *fun-press* (list info))) (handle-button-release (&rest event-slots &key window root-x root-y code state &allow-other-keys) (declare (ignore event-slots)) - (funcall-button-from-code *info-mouse* code state window root-x root-y #'third info)) + (funcall-button-from-code *info-mouse* code state window root-x root-y *fun-release* (list info))) (info-handle-unmap-notify (&rest event-slots) (apply #'handle-unmap-notify event-slots) (draw-info-window info)) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Fri Apr 4 15:53:59 2008 @@ -238,18 +238,6 @@ - - -;;(defun get-current-child () -;; "Return the current focused child" -;; (unless (equal *current-child* *root-frame*) -;; (typecase *current-child* -;; (xlib:window *current-child*) -;; (frame (if (xlib:window-p (first (frame-child *current-child*))) -;; (first (frame-child *current-child*)) -;; *current-child*))))) - - (defun find-child (to-find root) "Find to-find in root or in its children" (with-all-children (root child) Modified: clfswm/src/clfswm-keys.lisp ============================================================================== --- clfswm/src/clfswm-keys.lisp (original) +++ clfswm/src/clfswm-keys.lisp Fri Apr 4 15:53:59 2008 @@ -25,6 +25,11 @@ (in-package :clfswm) + +(defparameter *fun-press* #'first) +(defparameter *fun-release* #'second) + + (defun define-hash-table-key-name (hash-table name) (setf (gethash 'name hash-table) name)) @@ -44,12 +49,12 @@ (undefine-name (create-symbol "undefine-" name "-key")) (undefine-multi-name (create-symbol "undefine-" name "-multi-keys"))) `(progn - (defun ,name-key-fun (key function &optional keystring) + (defun ,name-key-fun (key function &rest args) "Define a new key, a key is '(char '(modifier list))" - (setf (gethash key ,hashtable) (list function keystring))) + (setf (gethash key ,hashtable) (list function args))) - (defmacro ,name-key ((key &rest modifiers) function &optional keystring) - `(,',name-key-fun (list ,key ,(modifiers->state modifiers)) ,function ,keystring)) + (defmacro ,name-key ((key &rest modifiers) function &rest args) + `(,',name-key-fun (list ,key ,(modifiers->state modifiers)) ,function , at args)) (defmacro ,undefine-name ((key &rest modifiers)) `(remhash (list ,key ,(modifiers->state modifiers)) ,',hashtable)) @@ -65,12 +70,12 @@ (name-mouse (create-symbol "define-" name)) (undefine-name (create-symbol "undefine-" name))) `(progn - (defun ,name-mouse-fun (button function-press &optional keystring function-release) + (defun ,name-mouse-fun (button function-press &optional function-release &rest args) "Define a new mouse button action, a button is '(button number '(modifier list))" - (setf (gethash button ,hashtable) (list function-press keystring function-release))) + (setf (gethash button ,hashtable) (list function-press function-release args))) - (defmacro ,name-mouse ((button &rest modifiers) function-press &optional function-release keystring) - `(,',name-mouse-fun (list ,button ,(modifiers->state modifiers)) ,function-press ,keystring ,function-release)) + (defmacro ,name-mouse ((button &rest modifiers) function-press &optional function-release &rest args) + `(,',name-mouse-fun (list ,button ,(modifiers->state modifiers)) ,function-press ,function-release , at args)) (defmacro ,undefine-name ((key &rest modifiers)) `(remhash (list ,key ,(modifiers->state modifiers)) ,',hashtable))))) @@ -133,7 +138,7 @@ (multiple-value-bind (function foundp) (gethash (list key state) hash-table-key) (when (and foundp (first function)) - (first function)))) + function))) (from-code () (function-from code)) (from-char () @@ -152,23 +157,19 @@ (defun funcall-key-from-code (hash-table-key code state &rest args) (let ((function (find-key-from-code hash-table-key code state))) (when function - (apply function args) + (apply (first function) (append args (second function))) t))) - (defun funcall-button-from-code (hash-table-key code state window root-x root-y - &optional (action #'first) args) - "Action: first=press third=release - Return t if a function is found" + &optional (action *fun-press*) args) (let ((state (modifiers->state (set-difference (state->modifiers state) '(:button-1 :button-2 :button-3 :button-4 :button-5))))) (multiple-value-bind (function foundp) (gethash (list code state) hash-table-key) (if (and foundp (funcall action function)) (progn - (if args - (funcall (funcall action function) window root-x root-y args) - (funcall (funcall action function) window root-x root-y)) + (apply (funcall action function) `(,window ,root-x ,root-y ,@(append args (third function)))) t) nil)))) @@ -201,8 +202,7 @@ ,(clean-string (format nil "~{~@(~S ~)~}" (state->modifiers (second k))))) ("td align=\"center\" nowrap" ,(clean-string (format nil "~@(~S~)" - (or (second v) - (and (stringp (first k)) + (or (and (stringp (first k)) (intern (string-upcase (first k)))) (first k))))) ("td style=\"color:#0000FF\" nowrap" ,(documentation (or (first v) (third v)) 'function))) @@ -247,8 +247,7 @@ (when (consp k) (format stream "~&~20@<~{~@(~A~) ~}~> ~13@<~@(~A~)~> ~A~%" (state->modifiers (second k)) - (remove #\# (remove #\\ (format nil "~S" (or (second v) - (and (stringp (first k)) + (remove #\# (remove #\\ (format nil "~S" (or (and (stringp (first k)) (intern (string-upcase (first k)))) (first k))))) (documentation (or (first v) (third v)) 'function)))) Modified: clfswm/src/clfswm-second-mode.lisp ============================================================================== --- clfswm/src/clfswm-second-mode.lisp (original) +++ clfswm/src/clfswm-second-mode.lisp Fri Apr 4 15:53:59 2008 @@ -80,16 +80,16 @@ (defun sm-handle-motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) (declare (ignore event-slots)) (unless (compress-motion-notify) - (funcall-button-from-code *second-mouse* 'motion 0 root-x root-y #'first))) + (funcall-button-from-code *second-mouse* 'motion 0 root-x root-y *fun-press*))) (defun sm-handle-button-press (&rest event-slots &key window root-x root-y code state &allow-other-keys) (declare (ignore event-slots)) - (funcall-button-from-code *second-mouse* code state window root-x root-y #'first) + (funcall-button-from-code *second-mouse* code state window root-x root-y *fun-press*) (draw-second-mode-window)) (defun sm-handle-button-release (&rest event-slots &key window root-x root-y code state &allow-other-keys) (declare (ignore event-slots)) - (funcall-button-from-code *second-mouse* code state window root-x root-y #'third) + (funcall-button-from-code *second-mouse* code state window root-x root-y *fun-release*) (draw-second-mode-window)) (defun sm-handle-configure-request (&rest event-slots) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Fri Apr 4 15:53:59 2008 @@ -701,7 +701,7 @@ ;;; Bind or jump functions (let ((key-slots (make-array 10 :initial-element nil)) - (current-slot 0)) + (current-slot 1)) (defun bind-on-slot () "Bind current child to slot" (setf (aref key-slots current-slot) *current-child*)) @@ -719,6 +719,7 @@ (show-all-children)) (defun bind-or-jump (n) + "Bind or jump to a slot" (let ((default-bind `("Return" bind-on-slot ,(format nil "Bind slot ~A on child: ~A" n (child-fullname *current-child*))))) (setf current-slot (- n 1)) @@ -732,13 +733,3 @@ (child-fullname it) "Not set - Please, bind it with Return")))) (list default-bind)))))) - -(defmacro def-bind-or-jump () - `(progn - ,@(loop for i from 1 to 10 - collect `(defun ,(intern (format nil "BIND-OR-JUMP-~A" i)) () - ,(format nil "Bind or jump to the child on slot ~A" i) - (bind-or-jump ,i))))) - - -(def-bind-or-jump) Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Fri Apr 4 15:53:59 2008 @@ -37,19 +37,19 @@ (defun handle-button-press (&rest event-slots &key code state window root-x root-y &allow-other-keys) (declare (ignore event-slots)) - (unless (funcall-button-from-code *main-mouse* code state window root-x root-y #'first) + (unless (funcall-button-from-code *main-mouse* code state window root-x root-y *fun-press*) (replay-button-event))) (defun handle-button-release (&rest event-slots &key code state window root-x root-y &allow-other-keys) (declare (ignore event-slots)) - (unless (funcall-button-from-code *main-mouse* code state window root-x root-y #'third) + (unless (funcall-button-from-code *main-mouse* code state window root-x root-y *fun-release*) (replay-button-event))) (defun handle-motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) (declare (ignore event-slots)) (unless (compress-motion-notify) - (funcall-button-from-code *main-mouse* 'motion 0 root-x root-y #'first))) + (funcall-button-from-code *main-mouse* 'motion 0 root-x root-y *fun-press*))) (defun handle-configure-request (&rest event-slots &key stack-mode #|parent|# window #|above-sibling|# From pbrochard at common-lisp.net Sat Apr 5 21:23:15 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sat, 5 Apr 2008 16:23:15 -0500 (EST) Subject: [clfswm-cvs] r68 - in clfswm: . src Message-ID: <20080405212315.E551681022@common-lisp.net> Author: pbrochard Date: Sat Apr 5 16:23:14 2008 New Revision: 68 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/clfswm-nw-hooks.lisp Log: New nw-hook: Open the next window in the current frame and leave the focus to the current child. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sat Apr 5 16:23:14 2008 @@ -1,3 +1,9 @@ +2008-04-05 Philippe Brochard + + * src/clfswm-nw-hooks.lisp (leave-focus-frame-nw-hook): New + nw-hook: Open the next window in the current frame and leave the + focus to the current child. + 2008-04-04 Philippe Brochard * src/bindings-second-mode.lisp: Add keys definitions to Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Sat Apr 5 16:23:14 2008 @@ -7,9 +7,9 @@ =============== Should handle these soon. -Rewrote all useful code present in 0801 version. -- Bind alt+1/2/3/4... to a particular child (current root and current child) [Philippe] - Open a menu: Space -> jump to child Enter -> bind current child to key +- Add a show-all-children without recomputation of geometry (ie: use real coordinates + and redisplay only the wanted child). *** REALLY URGENT *** + Split computation of geometry outside of show-all-children. [Philippe] - Hook to open next window in named/numbered frame [Philippe] @@ -35,10 +35,6 @@ - A Gimp layout example [Philippe] -- Add a show-all-children without recomputation of geometry (ie: use real coordinates - and redisplay only the wanted child). - Split computation of geometry outside of show-all-children. [Philippe] - MAYBE Modified: clfswm/src/clfswm-nw-hooks.lisp ============================================================================== --- clfswm/src/clfswm-nw-hooks.lisp (original) +++ clfswm/src/clfswm-nw-hooks.lisp Sat Apr 5 16:23:14 2008 @@ -129,3 +129,23 @@ (set-nw-hook #'open-in-new-frame-in-root-frame-nw-hook)) (register-nw-hook 'set-open-in-new-frame-in-root-frame-nw-hook) + + + +;;; Open a new window but leave the focus on the current child +(defun leave-focus-frame-nw-hook (frame window) + "Open the next window in the current frame and leave the focus to the current child" + (declare (ignore frame)) + (leave-if-not-frame *current-child*) + (when (frame-p *current-child*) + (pushnew window (frame-child *current-child*)) + (when (second (frame-child *current-child*)) + (rotatef (first (frame-child *current-child*)) + (second (frame-child *current-child*))))) + (default-window-placement *current-child* window)) + +(defun set-leave-focus-frame-nw-hook () + "Open the next window in the current frame and leave the focus to the current child" + (set-nw-hook #'leave-focus-frame-nw-hook)) + +(register-nw-hook 'set-leave-focus-frame-nw-hook) From pbrochard at common-lisp.net Sun Apr 6 13:31:46 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sun, 6 Apr 2008 09:31:46 -0400 (EDT) Subject: [clfswm-cvs] r69 - clfswm/src Message-ID: <20080406133146.6F5003307F@common-lisp.net> Author: pbrochard Date: Sun Apr 6 09:31:45 2008 New Revision: 69 Modified: clfswm/src/clfswm-nw-hooks.lisp Log: test of git pack Modified: clfswm/src/clfswm-nw-hooks.lisp ============================================================================== --- clfswm/src/clfswm-nw-hooks.lisp (original) +++ clfswm/src/clfswm-nw-hooks.lisp Sun Apr 6 09:31:45 2008 @@ -134,7 +134,7 @@ ;;; Open a new window but leave the focus on the current child (defun leave-focus-frame-nw-hook (frame window) - "Open the next window in the current frame and leave the focus to the current child" + "Open the next window in the current frame and leave the focus on the current child" (declare (ignore frame)) (leave-if-not-frame *current-child*) (when (frame-p *current-child*) @@ -145,7 +145,7 @@ (default-window-placement *current-child* window)) (defun set-leave-focus-frame-nw-hook () - "Open the next window in the current frame and leave the focus to the current child" + "Open the next window in the current frame and leave the focus on the current child" (set-nw-hook #'leave-focus-frame-nw-hook)) (register-nw-hook 'set-leave-focus-frame-nw-hook) From pbrochard at common-lisp.net Mon Apr 7 21:38:40 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Mon, 7 Apr 2008 17:38:40 -0400 (EDT) Subject: [clfswm-cvs] r70 - clfswm Message-ID: <20080407213840.5A64A620A2@common-lisp.net> Author: pbrochard Date: Mon Apr 7 17:38:39 2008 New Revision: 70 Modified: clfswm/TODO Log: Test again Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Mon Apr 7 17:38:39 2008 @@ -17,7 +17,7 @@ - Ensure-unique-number/name (new function) [Philippe] -- Raise/lower frame [Philippe] +- Raise/lower frame - this can be done with children order [Philippe] - Hide/Unhide frame [Philippe] From pbrochard at common-lisp.net Mon Apr 7 21:38:44 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Mon, 7 Apr 2008 17:38:44 -0400 (EDT) Subject: [clfswm-cvs] r71 - in clfswm: . src Message-ID: <20080407213844.882E2620A4@common-lisp.net> Author: pbrochard Date: Mon Apr 7 17:38:41 2008 New Revision: 71 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-layout.lisp clfswm/src/clfswm-nw-hooks.lisp clfswm/src/clfswm.lisp Log: Set the layout only one time and revert to no-layout to freely handle frames. Apply this with open-in-new-frame-in-root-frame-nw-hook Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Mon Apr 7 17:38:41 2008 @@ -1,3 +1,17 @@ +2008-04-07 Philippe Brochard + + * src/bindings-second-mode.lisp (frame-layout-once-menu): Set the + layout only one time and revert to no-layout to freely handle + frames. + + * src/clfswm-nw-hooks.lisp + (open-in-new-frame-in-root-frame-nw-hook): Tile layout with spaces + with new created window. + + * src/clfswm-layout.lisp (register-layout): Now register + automatically a once layout to set the layout only one time and + revert to no-layout to freely handle frames. + 2008-04-05 Philippe Brochard * src/clfswm-nw-hooks.lisp (leave-focus-frame-nw-hook): New Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Mon Apr 7 17:38:41 2008 @@ -11,6 +11,8 @@ and redisplay only the wanted child). *** REALLY URGENT *** Split computation of geometry outside of show-all-children. [Philippe] +- Rethink the keysym part with shift+1/!. + - Hook to open next window in named/numbered frame [Philippe] - Undo/redo (any idea to implement this is welcome) Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Mon Apr 7 17:38:41 2008 @@ -47,6 +47,11 @@ "Frame layout menu" (info-mode-menu (keys-from-list *layout-list*))) +(defun frame-layout-once-menu () + "Frame layout menu (Set only once)" + (info-mode-menu (keys-from-list (loop :for l :in *layout-list* + :collect (create-symbol (format nil "~A" l) "-ONCE"))))) + (defun frame-nw-hook-menu () "Frame new window hook menu" (info-mode-menu (keys-from-list *nw-hook-list*))) @@ -220,6 +225,7 @@ "Frame menu" (info-mode-menu '((#\a frame-adding-menu) (#\l frame-layout-menu) + (#\o frame-layout-once-menu) (#\n frame-nw-hook-menu) (#\m frame-movement-menu) (#\r rename-current-child) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Mon Apr 7 17:38:41 2008 @@ -236,6 +236,23 @@ w (w-px->fl prw father) h (h-px->fl prh father)))) +(defun fixe-real-size (frame father) + "Fixe real (pixel) coordinates in float coordinates" + (when (frame-p frame) + (with-slots (x y w h rx ry rw rh) frame + (setf x (x-px->fl rx father) + y (y-px->fl ry father) + w (w-px->fl rw father) + h (h-px->fl rh father))))) + +(defun fixe-real-size-current-child () + "Fixe real (pixel) coordinates in float coordinates for children in the current child" + (when (frame-p *current-child*) + (dolist (child (frame-child *current-child*)) + (fixe-real-size child *current-child*)))) + + + (defun find-child (to-find root) Modified: clfswm/src/clfswm-layout.lisp ============================================================================== --- clfswm/src/clfswm-layout.lisp (original) +++ clfswm/src/clfswm-layout.lisp Mon Apr 7 17:38:41 2008 @@ -47,6 +47,11 @@ (setf (frame-layout *current-child*) layout) (leave-second-mode))) +(defun set-layout-dont-leave (layout) + "Set the layout of the current child" + (when (frame-p *current-child*) + (setf (frame-layout *current-child*) layout))) + (defun get-managed-child (father) "Return only window in normal mode who can be tiled" @@ -55,8 +60,26 @@ (and (xlib:window-p x) (not (eql (window-type x) :normal)))) (frame-child father)))) -(defun register-layout (layout) - (setf *layout-list* (append *layout-list* (list layout)))) + + + +(defmacro register-layout (layout) + `(progn + (setf *layout-list* (append *layout-list* (list ',layout))) + (defun ,(intern (format nil "~A-ONCE" layout)) () + (set-layout-dont-leave #',(intern (subseq (format nil "~A" layout) 4))) + (show-all-children) + (fixe-real-size-current-child) + (set-layout-dont-leave #'no-layout)))) + + +(defun set-layout-once-documentation () + (loop :for l :in *layout-list* + :do (setf (documentation (create-symbol (format nil "~A" l) "-ONCE") 'function) + (documentation l 'function)))) + + + (defun layout-ask-size (msg slot &optional (min 80)) (when (frame-p *current-child*) @@ -91,7 +114,7 @@ "Maximize windows in there frame - leave frame to there size (no layout)" (set-layout #'no-layout)) -(register-layout 'set-no-layout) +(register-layout set-no-layout) @@ -117,7 +140,7 @@ "Tile child in its frame" (set-layout #'tile-layout)) -(register-layout 'set-tile-layout) +(register-layout set-tile-layout) ;;; Tile Left @@ -149,7 +172,7 @@ (layout-ask-size "Tile size in percent (%)" :tile-size) (set-layout #'tile-left-layout)) -(register-layout 'set-tile-left-layout) +(register-layout set-tile-left-layout) @@ -183,7 +206,7 @@ (set-layout #'tile-right-layout)) -(register-layout 'set-tile-right-layout) +(register-layout set-tile-right-layout) @@ -217,7 +240,7 @@ (layout-ask-size "Tile size in percent (%)" :tile-size) (set-layout #'tile-top-layout)) -(register-layout 'set-tile-top-layout) +(register-layout set-tile-top-layout) @@ -252,7 +275,7 @@ (set-layout #'tile-bottom-layout)) -(register-layout 'set-tile-bottom-layout) +(register-layout set-tile-bottom-layout) @@ -278,9 +301,9 @@ (round (- dy (* dy size 2) 2)) t)))) -(defun set-space-tile-layout () +(defun set-tile-space-layout () "Tile Space: tile child in its frame leaving spaces between them" (layout-ask-size "Space size in percent (%)" :tile-space-size 10) (set-layout #'tile-space-layout)) -(register-layout 'set-space-tile-layout) +(register-layout set-tile-space-layout) Modified: clfswm/src/clfswm-nw-hooks.lisp ============================================================================== --- clfswm/src/clfswm-nw-hooks.lisp (original) +++ clfswm/src/clfswm-nw-hooks.lisp Mon Apr 7 17:38:41 2008 @@ -120,6 +120,8 @@ (pushnew new-frame (frame-child *root-frame*)) (pushnew window (frame-child new-frame)) (switch-to-root-frame) + (setf *current-child* *current-root*) + (set-tile-space-layout-once) (setf *current-child* new-frame) (default-window-placement new-frame window)) (setf (frame-nw-hook frame) nil)) Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Mon Apr 7 17:38:41 2008 @@ -217,6 +217,7 @@ :pointer-motion)) ;;(intern-atoms *display*) (netwm-set-properties) + (set-layout-once-documentation) (xlib:display-force-output *display*) (setf *child-selection* nil) (setf *root-frame* (create-frame :name "Root" :number 0) ;; :layout #'tile-space-layout) From pbrochard at common-lisp.net Wed Apr 9 06:16:45 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Wed, 9 Apr 2008 02:16:45 -0400 (EDT) Subject: [clfswm-cvs] r72 - in clfswm: . src Message-ID: <20080409061645.063B71B017@common-lisp.net> Author: pbrochard Date: Wed Apr 9 02:16:42 2008 New Revision: 72 Modified: clfswm/ChangeLog clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-nw-hooks.lisp Log: switch-to-root-frame: show later - new key parameter to have less flickering. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Wed Apr 9 02:16:42 2008 @@ -1,3 +1,8 @@ +2008-04-09 Philippe Brochard + + * src/clfswm-internal.lisp (switch-to-root-frame): show later - + new key parameter to have less flickering. + 2008-04-07 Philippe Brochard * src/bindings-second-mode.lisp (frame-layout-once-menu): Set the Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Wed Apr 9 02:16:42 2008 @@ -593,18 +593,20 @@ (show-all-children)) -(defun switch-to-root-frame () +(defun switch-to-root-frame (&key (show-later nil)) "Switch to the root frame" (hide-all *current-root*) (setf *current-root* *root-frame*) - (show-all-children)) + (unless show-later + (show-all-children))) -(defun switch-and-select-root-frame () +(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*) - (show-all-children)) + (unless show-later + (show-all-children))) (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 Wed Apr 9 02:16:42 2008 @@ -119,7 +119,7 @@ (let ((new-frame (create-frame))) (pushnew new-frame (frame-child *root-frame*)) (pushnew window (frame-child new-frame)) - (switch-to-root-frame) + (switch-to-root-frame :show-later t) (setf *current-child* *current-root*) (set-tile-space-layout-once) (setf *current-child* new-frame) From pbrochard at common-lisp.net Fri Apr 11 21:49:50 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 11 Apr 2008 17:49:50 -0400 (EDT) Subject: [clfswm-cvs] r73 - in clfswm: . src Message-ID: <20080411214950.D1C3644056@common-lisp.net> Author: pbrochard Date: Fri Apr 11 17:49:46 2008 New Revision: 73 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-keys.lisp clfswm/src/clfswm-query.lisp clfswm/src/clfswm-second-mode.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp clfswm/src/xlib-util.lisp Log: Keyboard handle strategie change: Grab all keys by default and replay just what is needed. No change for the second mode. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 11 17:49:46 2008 @@ -1,3 +1,12 @@ +2008-04-11 Philippe Brochard + + * src/clfswm.lisp (main): Keyboard handle strategie change: Grab + all keys by default and replay just what is needed. No change for + the second mode. + + * src/clfswm-keys.lisp: remove grab/ungrab main keys. + (find-key-from-code): Test for shift and not shift presence. + 2008-04-09 Philippe Brochard * src/clfswm-internal.lisp (switch-to-root-frame): show later - Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Fri Apr 11 17:49:46 2008 @@ -11,8 +11,6 @@ and redisplay only the wanted child). *** REALLY URGENT *** Split computation of geometry outside of show-all-children. [Philippe] -- Rethink the keysym part with shift+1/!. - - Hook to open next window in named/numbered frame [Philippe] - Undo/redo (any idea to implement this is welcome) Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Fri Apr 11 17:49:46 2008 @@ -253,8 +253,8 @@ (defun utility-menu () "Utility menu" (info-mode-menu '((#\i identify-key) - (#\: eval-from-query-string) - (#\! run-program-from-query-string)))) + ("colon" eval-from-query-string) + ("exclam" run-program-from-query-string)))) (defun main-menu () "Open the main menu" @@ -280,10 +280,10 @@ ;;(define-second-key (#\g :control) 'stop-all-pending-actions) -(define-second-key (#\i) 'identify-key) -(define-second-key (#\:) 'eval-from-query-string) +(define-second-key ("i") 'identify-key) +(define-second-key ("colon") 'eval-from-query-string) -(define-second-key (#\!) 'run-program-from-query-string) +(define-second-key ("exclam") 'run-program-from-query-string) (define-second-key (#\t) 'leave-second-mode) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Fri Apr 11 17:49:46 2008 @@ -737,6 +737,7 @@ (:transient 1) (t 1))) (grab-all-buttons window) + (grab-all-keys window) (unless (do-all-frames-nw-hook window) (default-frame-nw-hook nil window)) (netwm-add-in-client-list window))) Modified: clfswm/src/clfswm-keys.lisp ============================================================================== --- clfswm/src/clfswm-keys.lisp (original) +++ clfswm/src/clfswm-keys.lisp Fri Apr 11 17:49:46 2008 @@ -99,29 +99,31 @@ -(defmacro define-ungrab/grab (name function hashtable) - `(defun ,name () - (maphash #'(lambda (k v) - (declare (ignore v)) - (when (consp k) - (handler-case - (let* ((key (first k)) - (keycode (typecase key - (character (char->keycode key)) - (number key) - (string (let ((keysym (keysym-name->keysym key))) - (and keysym (xlib:keysym->keycodes *display* keysym))))))) - (if keycode - (,function *root* keycode :modifiers (second k)) - (format t "~&Grabbing error: Can't find key '~A'~%" key))) - (error (c) - ;;(declare (ignore c)) - (format t "~&Grabbing error: Can't grab key '~A' (~A)~%" k c))) - (force-output))) - ,hashtable))) - -(define-ungrab/grab grab-main-keys xlib:grab-key *main-keys*) -(define-ungrab/grab ungrab-main-keys xlib:ungrab-key *main-keys*) +;;(defmacro define-ungrab/grab (name function hashtable) +;; `(defun ,name () +;; (maphash #'(lambda (k v) +;; (declare (ignore v)) +;; (when (consp k) +;; (handler-case +;; (let* ((key (first k)) +;; (modifiers (second k)) +;; (keycode (typecase key +;; (character (char->keycode key)) +;; (number key) +;; (string (let ((keysym (keysym-name->keysym key))) +;; (when keysym +;; (xlib:keysym->keycodes *display* keysym))))))) +;; (if keycode +;; (,function *root* keycode :modifiers modifiers) +;; (format t "~&Grabbing error: Can't find key '~A'~%" key))) +;; (error (c) +;; ;;(declare (ignore c)) +;; (format t "~&Grabbing error: Can't grab key '~A' (~A)~%" k c))) +;; (force-output))) +;; ,hashtable))) +;; +;;(define-ungrab/grab grab-main-keys xlib:grab-key *main-keys*) +;;(define-ungrab/grab ungrab-main-keys xlib:ungrab-key *main-keys*) @@ -134,9 +136,9 @@ (defun find-key-from-code (hash-table-key code state) "Return the function associated to code/state" - (labels ((function-from (key) + (labels ((function-from (key &optional (new-state state)) (multiple-value-bind (function foundp) - (gethash (list key state) hash-table-key) + (gethash (list key new-state) hash-table-key) (when (and foundp (first function)) function))) (from-code () @@ -145,12 +147,18 @@ (let ((char (keycode->char code state))) (function-from char))) (from-string () - (let* ((modifiers (xlib:make-state-keys state)) + (let* ((modifiers (state->modifiers state)) + (string (keysym->keysym-name (xlib:keycode->keysym *display* code (cond ((member :shift modifiers) 1) + ((member :mod-5 modifiers) 2) + (t 0)))))) + (function-from string))) + (from-string-no-shift () + (let* ((modifiers (state->modifiers state)) (string (keysym->keysym-name (xlib:keycode->keysym *display* code (cond ((member :shift modifiers) 1) ((member :mod-5 modifiers) 2) (t 0)))))) - (function-from string)))) - (or (from-code) (from-char) (from-string)))) + (function-from string (modifiers->state (remove :shift modifiers)))))) + (or (from-code) (from-char) (from-string) (from-string-no-shift)))) Modified: clfswm/src/clfswm-query.lisp ============================================================================== --- clfswm/src/clfswm-query.lisp (original) +++ clfswm/src/clfswm-query.lisp Fri Apr 11 17:49:46 2008 @@ -112,7 +112,7 @@ (setf result-string (subseq result-string 0 pos))) (handle-query-key (&rest event-slots &key root code state &allow-other-keys) (declare (ignore event-slots root)) - (let* ((modifiers (xlib:make-state-keys state)) + (let* ((modifiers (state->modifiers state)) (keysym (xlib:keycode->keysym *display* code (cond ((member :shift modifiers) 1) ((member :mod-5 modifiers) 2) (t 0)))) Modified: clfswm/src/clfswm-second-mode.lisp ============================================================================== --- clfswm/src/clfswm-second-mode.lisp (original) +++ clfswm/src/clfswm-second-mode.lisp Fri Apr 11 17:49:46 2008 @@ -144,7 +144,7 @@ (defun sm-handle-event (&rest event-slots &key display event-key &allow-other-keys) (declare (ignore display)) - ;;(dbg event-key) + ;; (dbg event-key) (with-xlib-protect (case event-key (:button-press (call-hook *sm-button-press-hook* event-slots)) @@ -177,7 +177,7 @@ :border-width 1 :border (get-color *sm-border-color*) :colormap (xlib:screen-default-colormap *screen*) - :event-mask '(:exposure)) + :event-mask '(:exposure :key-press :key-release :button-press :button-release)) *sm-font* (xlib:open-font *display* *sm-font-string*) *sm-gc* (xlib:create-gcontext :drawable *sm-window* :foreground (get-color *sm-foreground-color*) @@ -187,7 +187,6 @@ (xlib:map-window *sm-window*) (draw-second-mode-window) (no-focus) - (ungrab-main-keys) (xgrab-keyboard *root*) (xgrab-pointer *root* 66 67) (unwind-protect @@ -202,7 +201,6 @@ (xlib:destroy-window *sm-window*) (xungrab-keyboard) (xungrab-pointer) - (grab-main-keys) (show-all-children)) (wait-no-key-or-button-press) (when *second-mode-program* Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Fri Apr 11 17:49:46 2008 @@ -236,7 +236,7 @@ (print-doc "Second mode: " *second-keys* 4 code state))) (handle-identify-key (&rest event-slots &key root code state &allow-other-keys) (declare (ignore event-slots root)) - (let* ((modifiers (xlib:make-state-keys state)) + (let* ((modifiers (state->modifiers state)) (key (keycode->char code state)) (keysym (keysym->keysym-name (xlib:keycode->keysym *display* code (cond ((member :shift modifiers) 1) ((member :mod-5 modifiers) 2) Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Fri Apr 11 17:49:46 2008 @@ -32,7 +32,9 @@ ;;; Main mode hooks (defun handle-key-press (&rest event-slots &key root code state &allow-other-keys) (declare (ignore event-slots root)) - (funcall-key-from-code *main-keys* code state)) + (if (funcall-key-from-code *main-keys* code state) + (stop-keyboard-event) ;; Maybe TODO: report this in funcall-key-from-code to allow key stop/replay on funcall + (replay-keyboard-event))) (defun handle-button-press (&rest event-slots &key code state window root-x root-y &allow-other-keys) @@ -200,18 +202,14 @@ *default-font* (xlib:open-font *display* *default-font-string*)) (xgrab-init-pointer) (xgrab-init-keyboard) - ;;(xgrab-pointer *root* 66 67 '(:enter-window :button-press :button-release) t) ;; PHIL - ;;(grab-pointer *root* '(:button-press :button-release) - ;; :owner-p t :sync-keyboard-p nil :sync-pointer-p nil) - ;;(grab-button *root* 1 nil ;;'(:button-press :button-release) - ;; :owner-p nil :sync-keyboard-p nil :sync-pointer-p nil) - ;;(xlib:grab-pointer *root* nil :owner-p nil) (xlib:map-window *no-focus-window*) (dbg *display*) (setf (xlib:window-event-mask *root*) (xlib:make-event-mask :substructure-redirect :substructure-notify :property-change :exposure + :key-press + :key-release :button-press :button-release :pointer-motion)) @@ -228,7 +226,7 @@ (call-hook *init-hook*) (process-existing-windows *screen*) (show-all-children) - (grab-main-keys) + ;;(grab-main-keys) (xlib:display-finish-output *display*)) @@ -270,7 +268,6 @@ (handler-case (init-display) (xlib:access-error (c) - (ungrab-main-keys) (xlib:destroy-window *no-focus-window*) (xlib:close-display *display*) (format t "~&~A~&Maybe another window manager is running.~%" c) @@ -279,28 +276,8 @@ (unwind-protect (catch 'exit-main-loop (main-loop)) - (ungrab-main-keys) (xlib:destroy-window *no-focus-window*) (xlib:close-display *display*))) - -;;(defun perform-click (type code state time) -;; "Send a button-{press, release} event for button-number. The type of the -;; sent event will be determined according to the type of the ev event -;; argument: if type key-press then send button-press, if key-release then -;; button-release is sent. The destination window will be retreived in the -;; ev event argument." -;; (flet ((my-query (win) (multiple-value-list (xlib:query-pointer win)))) -;; (loop with window = *root* -;; for (x y ssp child nil root-x root-y root) = (my-query window) -;; while child do (setf window child) -;; finally -;; (progn -;; (dbg window) -;; (xlib:send-event window type nil -;; :x x :y y :root-x root-x :root-y root-y -;; :state state :code code -;; :window window :event-window window :root root :child child -;; :same-screen-p ssp :time time))))) Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Fri Apr 11 17:49:46 2008 @@ -37,7 +37,11 @@ :colormap-change :focus-change :enter-window - :exposure) + :exposure + :key-press + :key-release + :button-press + :button-release) "The events to listen for on managed windows.") @@ -380,6 +384,7 @@ (defun xgrab-keyboard (root) (setf keyboard-grabbed t) (xlib:grab-keyboard root :owner-p nil :sync-keyboard-p nil :sync-pointer-p nil)) + (defun xungrab-keyboard () (setf keyboard-grabbed nil) @@ -401,6 +406,28 @@ :sync-pointer-p t :sync-keyboard-p nil)) + +(defun ungrab-all-keys (window) + (xlib:ungrab-key window :any :modifiers :any)) + +(defun grab-all-keys (window) + (ungrab-all-keys window) + (xlib:grab-key window :any + :modifiers :any + :owner-p nil + :sync-pointer-p nil + :sync-keyboard-p t)) + + + + +(defun stop-keyboard-event () + (xlib:allow-events *display* :sync-keyboard)) + +(defun replay-keyboard-event () + (xlib:allow-events *display* :replay-keyboard)) + + (defun stop-button-event () (xlib:allow-events *display* :sync-pointer)) @@ -409,6 +436,8 @@ + + (defun get-color (color) (xlib:alloc-color (xlib:screen-default-colormap *screen*) color)) From pbrochard at common-lisp.net Fri Apr 11 22:09:48 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 11 Apr 2008 18:09:48 -0400 (EDT) Subject: [clfswm-cvs] r74 - in clfswm: . src Message-ID: <20080411220948.743C075165@common-lisp.net> Author: pbrochard Date: Fri Apr 11 18:09:46 2008 New Revision: 74 Modified: clfswm/ChangeLog clfswm/src/clfswm-internal.lisp clfswm/src/clfswm.lisp Log: Add key handling on no focus window and on frame windows. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 11 18:09:46 2008 @@ -1,3 +1,8 @@ +2008-04-12 Philippe Brochard + + * src/clfswm.lisp (init-display): Add key handling on no focus + window and on frame windows. + 2008-04-11 Philippe Brochard * src/clfswm.lisp (main): Keyboard handle strategie change: Grab Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Fri Apr 11 18:09:46 2008 @@ -210,7 +210,8 @@ :colormap (xlib:screen-default-colormap *screen*) :border-width 1 :border (get-color "Red") - :event-mask '(:exposure :button-press :button-release :pointer-motion))) + :event-mask '(:exposure :key-press :key-release + :button-press :button-release :pointer-motion))) (gc (xlib:create-gcontext :drawable window :foreground (get-color "Green") :background (get-color "Black") Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Fri Apr 11 18:09:46 2008 @@ -194,7 +194,9 @@ (defun init-display () (setf *screen* (first (xlib:display-roots *display*)) *root* (xlib:screen-root *screen*) - *no-focus-window* (xlib:create-window :parent *root* :x 0 :y 0 :width 1 :height 1) + *no-focus-window* (xlib:create-window :parent *root* :x 0 :y 0 :width 1 :height 1 + :event-mask '(:key-press :key-release + :button-press :button-release :pointer-motion)) *root-gc* (xlib:create-gcontext :drawable *root* :foreground (get-color *color-unselected*) :background (get-color "Black") From pbrochard at common-lisp.net Sun Apr 13 21:43:56 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sun, 13 Apr 2008 17:43:56 -0400 (EDT) Subject: [clfswm-cvs] r75 - in clfswm: . src Message-ID: <20080413214356.BE0EA4509C@common-lisp.net> Author: pbrochard Date: Sun Apr 13 17:43:53 2008 New Revision: 75 Modified: clfswm/ChangeLog clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-keys.lisp clfswm/src/clfswm-second-mode.lisp clfswm/src/clfswm.lisp clfswm/src/xlib-util.lisp Log: Better handle of keysyms. Revert to hold grabning method for the main mode. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sun Apr 13 17:43:53 2008 @@ -1,3 +1,8 @@ +2008-04-13 Philippe Brochard + + * src/clfswm-keys.lisp (find-key-from-code): Better handle of + keysyms. Revert to hold grabning method for the main mode. + 2008-04-12 Philippe Brochard * src/clfswm.lisp (init-display): Add key handling on no focus Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Sun Apr 13 17:43:53 2008 @@ -210,8 +210,7 @@ :colormap (xlib:screen-default-colormap *screen*) :border-width 1 :border (get-color "Red") - :event-mask '(:exposure :key-press :key-release - :button-press :button-release :pointer-motion))) + :event-mask '(:exposure :button-press :button-release :pointer-motion))) (gc (xlib:create-gcontext :drawable window :foreground (get-color "Green") :background (get-color "Black") @@ -738,7 +737,6 @@ (:transient 1) (t 1))) (grab-all-buttons window) - (grab-all-keys window) (unless (do-all-frames-nw-hook window) (default-frame-nw-hook nil window)) (netwm-add-in-client-list window))) Modified: clfswm/src/clfswm-keys.lisp ============================================================================== --- clfswm/src/clfswm-keys.lisp (original) +++ clfswm/src/clfswm-keys.lisp Sun Apr 13 17:43:53 2008 @@ -99,31 +99,31 @@ -;;(defmacro define-ungrab/grab (name function hashtable) -;; `(defun ,name () -;; (maphash #'(lambda (k v) -;; (declare (ignore v)) -;; (when (consp k) -;; (handler-case -;; (let* ((key (first k)) -;; (modifiers (second k)) -;; (keycode (typecase key -;; (character (char->keycode key)) -;; (number key) -;; (string (let ((keysym (keysym-name->keysym key))) -;; (when keysym -;; (xlib:keysym->keycodes *display* keysym))))))) -;; (if keycode -;; (,function *root* keycode :modifiers modifiers) -;; (format t "~&Grabbing error: Can't find key '~A'~%" key))) -;; (error (c) -;; ;;(declare (ignore c)) -;; (format t "~&Grabbing error: Can't grab key '~A' (~A)~%" k c))) -;; (force-output))) -;; ,hashtable))) -;; -;;(define-ungrab/grab grab-main-keys xlib:grab-key *main-keys*) -;;(define-ungrab/grab ungrab-main-keys xlib:ungrab-key *main-keys*) +(defmacro define-ungrab/grab (name function hashtable) + `(defun ,name () + (maphash #'(lambda (k v) + (declare (ignore v)) + (when (consp k) + (handler-case + (let* ((key (first k)) + (modifiers (second k)) + (keycode (typecase key + (character (char->keycode key)) + (number key) + (string (let ((keysym (keysym-name->keysym key))) + (when keysym + (xlib:keysym->keycodes *display* keysym))))))) + (if keycode + (,function *root* keycode :modifiers modifiers) + (format t "~&Grabbing error: Can't find key '~A'~%" key))) + (error (c) + ;;(declare (ignore c)) + (format t "~&Grabbing error: Can't grab key '~A' (~A)~%" k c))) + (force-output))) + ,hashtable))) + +(define-ungrab/grab grab-main-keys xlib:grab-key *main-keys*) +(define-ungrab/grab ungrab-main-keys xlib:ungrab-key *main-keys*) @@ -147,6 +147,9 @@ (let ((char (keycode->char code state))) (function-from char))) (from-string () + (let ((string (keysym->keysym-name (xlib:keycode->keysym *display* code 0)))) + (function-from string))) + (from-string-shift () (let* ((modifiers (state->modifiers state)) (string (keysym->keysym-name (xlib:keycode->keysym *display* code (cond ((member :shift modifiers) 1) ((member :mod-5 modifiers) 2) @@ -158,7 +161,7 @@ ((member :mod-5 modifiers) 2) (t 0)))))) (function-from string (modifiers->state (remove :shift modifiers)))))) - (or (from-code) (from-char) (from-string) (from-string-no-shift)))) + (or (from-code) (from-char) (from-string) (from-string-shift) (from-string-no-shift)))) Modified: clfswm/src/clfswm-second-mode.lisp ============================================================================== --- clfswm/src/clfswm-second-mode.lisp (original) +++ clfswm/src/clfswm-second-mode.lisp Sun Apr 13 17:43:53 2008 @@ -177,7 +177,7 @@ :border-width 1 :border (get-color *sm-border-color*) :colormap (xlib:screen-default-colormap *screen*) - :event-mask '(:exposure :key-press :key-release :button-press :button-release)) + :event-mask '(:exposure)) *sm-font* (xlib:open-font *display* *sm-font-string*) *sm-gc* (xlib:create-gcontext :drawable *sm-window* :foreground (get-color *sm-foreground-color*) @@ -187,6 +187,7 @@ (xlib:map-window *sm-window*) (draw-second-mode-window) (no-focus) + (ungrab-main-keys) (xgrab-keyboard *root*) (xgrab-pointer *root* 66 67) (unwind-protect @@ -201,6 +202,7 @@ (xlib:destroy-window *sm-window*) (xungrab-keyboard) (xungrab-pointer) + (grab-main-keys) (show-all-children)) (wait-no-key-or-button-press) (when *second-mode-program* Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Sun Apr 13 17:43:53 2008 @@ -32,9 +32,7 @@ ;;; Main mode hooks (defun handle-key-press (&rest event-slots &key root code state &allow-other-keys) (declare (ignore event-slots root)) - (if (funcall-key-from-code *main-keys* code state) - (stop-keyboard-event) ;; Maybe TODO: report this in funcall-key-from-code to allow key stop/replay on funcall - (replay-keyboard-event))) + (funcall-key-from-code *main-keys* code state)) (defun handle-button-press (&rest event-slots &key code state window root-x root-y &allow-other-keys) @@ -194,9 +192,7 @@ (defun init-display () (setf *screen* (first (xlib:display-roots *display*)) *root* (xlib:screen-root *screen*) - *no-focus-window* (xlib:create-window :parent *root* :x 0 :y 0 :width 1 :height 1 - :event-mask '(:key-press :key-release - :button-press :button-release :pointer-motion)) + *no-focus-window* (xlib:create-window :parent *root* :x 0 :y 0 :width 1 :height 1) *root-gc* (xlib:create-gcontext :drawable *root* :foreground (get-color *color-unselected*) :background (get-color "Black") @@ -210,8 +206,6 @@ :substructure-notify :property-change :exposure - :key-press - :key-release :button-press :button-release :pointer-motion)) @@ -228,7 +222,7 @@ (call-hook *init-hook*) (process-existing-windows *screen*) (show-all-children) - ;;(grab-main-keys) + (grab-main-keys) (xlib:display-finish-output *display*)) @@ -270,6 +264,7 @@ (handler-case (init-display) (xlib:access-error (c) + (ungrab-main-keys) (xlib:destroy-window *no-focus-window*) (xlib:close-display *display*) (format t "~&~A~&Maybe another window manager is running.~%" c) @@ -278,6 +273,7 @@ (unwind-protect (catch 'exit-main-loop (main-loop)) + (ungrab-main-keys) (xlib:destroy-window *no-focus-window*) (xlib:close-display *display*))) Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Sun Apr 13 17:43:53 2008 @@ -37,11 +37,7 @@ :colormap-change :focus-change :enter-window - :exposure - :key-press - :key-release - :button-press - :button-release) + :exposure) "The events to listen for on managed windows.") @@ -410,22 +406,31 @@ (defun ungrab-all-keys (window) (xlib:ungrab-key window :any :modifiers :any)) -(defun grab-all-keys (window) - (ungrab-all-keys window) - (xlib:grab-key window :any - :modifiers :any - :owner-p nil - :sync-pointer-p nil - :sync-keyboard-p t)) +;;(defun grab-all-keys (window) +;; (ungrab-all-keys window) +;; (dolist (modifiers '(:control :mod-1 :shift)) +;; (xlib:grab-key window :any +;; :modifiers (list modifiers) +;; :owner-p nil +;; :sync-pointer-p nil +;; :sync-keyboard-p t))) + +;;(defun grab-all-keys (window) +;; (ungrab-all-keys window) +;; (xlib:grab-key window :any +;; :modifiers :any +;; :owner-p nil +;; :sync-pointer-p nil +;; :sync-keyboard-p t)) -(defun stop-keyboard-event () - (xlib:allow-events *display* :sync-keyboard)) - -(defun replay-keyboard-event () - (xlib:allow-events *display* :replay-keyboard)) +;;(defun stop-keyboard-event () +;; (xlib:allow-events *display* :sync-keyboard)) +;; +;;(defun replay-keyboard-event () +;; (xlib:allow-events *display* :replay-keyboard)) (defun stop-button-event () From pbrochard at common-lisp.net Sun Apr 13 22:08:52 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sun, 13 Apr 2008 18:08:52 -0400 (EDT) Subject: [clfswm-cvs] r76 - in clfswm: . src Message-ID: <20080413220852.159332510F@common-lisp.net> Author: pbrochard Date: Sun Apr 13 18:08:51 2008 New Revision: 76 Modified: clfswm/ChangeLog clfswm/src/clfswm-keys.lisp Log: Handle all keysyms in the main mode (for example: 1 on an azerty keyboard). Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sun Apr 13 18:08:51 2008 @@ -1,7 +1,12 @@ +2008-04-14 Philippe Brochard + + * src/clfswm-keys.lisp (define-ungrab/grab): Handle all keysyms in + the main mode (for example: "1" on an azerty keyboard). + 2008-04-13 Philippe Brochard * src/clfswm-keys.lisp (find-key-from-code): Better handle of - keysyms. Revert to hold grabning method for the main mode. + keysyms. Revert to hold grabbing method for the main mode. 2008-04-12 Philippe Brochard Modified: clfswm/src/clfswm-keys.lisp ============================================================================== --- clfswm/src/clfswm-keys.lisp (original) +++ clfswm/src/clfswm-keys.lisp Sun Apr 13 18:08:51 2008 @@ -99,6 +99,11 @@ + +(defun add-in-state (state modifier) + "Add a modifier in a state" + (modifiers->state (append (state->modifiers state) (list modifier)))) + (defmacro define-ungrab/grab (name function hashtable) `(defun ,name () (maphash #'(lambda (k v) @@ -110,9 +115,11 @@ (keycode (typecase key (character (char->keycode key)) (number key) - (string (let ((keysym (keysym-name->keysym key))) - (when keysym - (xlib:keysym->keycodes *display* keysym))))))) + (string (let* ((keysym (keysym-name->keysym key)) + (ret-keycode (xlib:keysym->keycodes *display* keysym))) + (when (/= keysym (xlib:keycode->keysym *display* ret-keycode 0)) + (setf modifiers (add-in-state modifiers :shift))) + ret-keycode))))) (if keycode (,function *root* keycode :modifiers modifiers) (format t "~&Grabbing error: Can't find key '~A'~%" key))) From pbrochard at common-lisp.net Mon Apr 14 07:02:19 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Mon, 14 Apr 2008 03:02:19 -0400 (EDT) Subject: [clfswm-cvs] r77 - in clfswm: . src Message-ID: <20080414070219.CDF8E33080@common-lisp.net> Author: pbrochard Date: Mon Apr 14 03:02:16 2008 New Revision: 77 Modified: clfswm/ChangeLog clfswm/src/clfswm.lisp clfswm/src/package.lisp Log: Move the default frame creation on the default init hook. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Mon Apr 14 03:02:16 2008 @@ -1,12 +1,15 @@ 2008-04-14 Philippe Brochard + * src/clfswm.lisp (init-display): Move the default frame creation + on the default init hook. + * src/clfswm-keys.lisp (define-ungrab/grab): Handle all keysyms in the main mode (for example: "1" on an azerty keyboard). 2008-04-13 Philippe Brochard * src/clfswm-keys.lisp (find-key-from-code): Better handle of - keysyms. Revert to hold grabbing method for the main mode. + keysyms. Revert to old grabbing method for the main mode. 2008-04-12 Philippe Brochard Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Mon Apr 14 03:02:16 2008 @@ -217,8 +217,6 @@ (setf *root-frame* (create-frame :name "Root" :number 0) ;; :layout #'tile-space-layout) *current-root* *root-frame* *current-child* *current-root*) - (add-frame (create-frame :name "Default" :layout nil :x 0.05 :y 0.05 :w 0.9 :h 0.9) *root-frame*) - (setf *current-child* (first (frame-child *current-root*))) (call-hook *init-hook*) (process-existing-windows *screen*) (show-all-children) Modified: clfswm/src/package.lisp ============================================================================== --- clfswm/src/package.lisp (original) +++ clfswm/src/package.lisp Mon Apr 14 03:02:16 2008 @@ -129,7 +129,14 @@ ;;; See clfswm.lisp for hooks examples. ;;; Init hook. This hook is run just after the first root frame is created -(defparameter *init-hook* nil) +(defun default-init-hook () + (let ((frame (add-frame (create-frame :name "Default" + :layout nil :x 0.05 :y 0.05 + :w 0.9 :h 0.9) *root-frame*))) + (setf *current-child* (first (frame-child *current-root*))))) + +(defparameter *init-hook* #'default-init-hook) + ;;; Main mode hooks (set in clfswm.lisp) (defparameter *button-press-hook* nil) From pbrochard at common-lisp.net Thu Apr 17 14:32:47 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Thu, 17 Apr 2008 10:32:47 -0400 (EDT) Subject: [clfswm-cvs] r78 - in clfswm: . src Message-ID: <20080417143247.27B1C481B0@common-lisp.net> Author: pbrochard Date: Thu Apr 17 10:32:43 2008 New Revision: 78 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-util.lisp clfswm/src/package.lisp Log: Move the size computation outside the show-child part. Redisplay only the current child when needed. More TODO things Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Thu Apr 17 10:32:43 2008 @@ -1,3 +1,20 @@ +2008-04-17 Philippe Brochard + + * src/clfswm-internal.lisp (add-frame): Add frame return the + created frame. + (show-all-children): Move the size computation outside the + show-child part. + + * src/bindings-second-mode.lisp (with-movement): Redisplay only + the current child. + + * src/clfswm-util.lisp (mouse-click-to-focus-generic): Redisplay + only the current child. + + * src/clfswm-internal.lisp (show-all-children): New display-child + parameter to display only the desired child and its children. + (select-next/previous-child): Only display the current child. + 2008-04-14 Philippe Brochard * src/clfswm.lisp (init-display): Move the default frame creation Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Thu Apr 17 10:32:43 2008 @@ -7,9 +7,9 @@ =============== Should handle these soon. -- Add a show-all-children without recomputation of geometry (ie: use real coordinates - and redisplay only the wanted child). *** REALLY URGENT *** - Split computation of geometry outside of show-all-children. [Philippe] +- Rethink the menu system to be able to change/add/remove entry. [Philippe] + +- Add a frame parameter to choose what window type to handle. [Philippe] - Hook to open next window in named/numbered frame [Philippe] Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Thu Apr 17 10:32:43 2008 @@ -99,7 +99,7 @@ (defmacro with-movement (&body body) `(when (frame-p *current-child*) , at body - (show-all-children) + (show-all-children *current-child*) (draw-second-mode-window) (frame-movement-menu))) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Thu Apr 17 10:32:43 2008 @@ -221,7 +221,8 @@ (defun add-frame (frame father) - (push frame (frame-child father))) + (push frame (frame-child father)) + frame) (defun place-frame (frame father prx pry prw prh) @@ -365,18 +366,20 @@ (defmethod adapt-child-to-father ((window xlib:window) father) (with-xlib-protect - (multiple-value-bind (nx ny nw nh raise-p) - (get-father-layout window father) - (setf nw (max nw 1) nh (max nh 1)) - (let ((change (or (/= (xlib:drawable-x window) nx) - (/= (xlib:drawable-y window) ny) - (/= (xlib:drawable-width window) nw) - (/= (xlib:drawable-height window) nh)))) - (setf (xlib:drawable-x window) nx - (xlib:drawable-y window) ny - (xlib:drawable-width window) nw - (xlib:drawable-height window) nh) - (values raise-p change))))) + (if (eql (window-type window) :normal) + (multiple-value-bind (nx ny nw nh raise-p) + (get-father-layout window father) + (setf nw (max nw 1) nh (max nh 1)) + (let ((change (or (/= (xlib:drawable-x window) nx) + (/= (xlib:drawable-y window) ny) + (/= (xlib:drawable-width window) nw) + (/= (xlib:drawable-height window) nh)))) + (setf (xlib:drawable-x window) nx + (xlib:drawable-y window) ny + (xlib:drawable-width window) nw + (xlib:drawable-height window) nh) + (values raise-p change))) + (values nil nil)))) (defmethod adapt-child-to-father ((frame frame) father) (with-xlib-protect @@ -405,34 +408,22 @@ (and (eql raise-p :first-only) first-p)) (raise-window window))) -(defgeneric show-child (child father first-p)) +(defgeneric show-child (child raise-p first-p)) -(defmethod show-child ((frame frame) father first-p) +(defmethod show-child ((frame frame) raise-p first-p) (with-xlib-protect (with-slots (window) frame - (multiple-value-bind (raise-p geometry-change) - (adapt-child-to-father frame father) (when (or *show-root-frame-p* (not (equal frame *current-root*))) (setf (xlib:window-background window) (get-color "Black")) (xlib:map-window window) (raise-if-needed window raise-p first-p) - (display-frame-info frame)) - geometry-change)))) + (display-frame-info frame))))) -(defmethod show-child ((window xlib:window) father first-p) +(defmethod show-child ((window xlib:window) raise-p first-p) (with-xlib-protect - (let ((raise-p nil) - (geometry-change nil)) - (when (eql (window-type window) :normal) - (multiple-value-bind (to-raise change) - (adapt-child-to-father window father) - (setf raise-p to-raise - geometry-change change))) (xlib:map-window window) - (raise-if-needed window raise-p first-p) - geometry-change))) - + (raise-if-needed window raise-p first-p))) (defgeneric hide-child (child)) @@ -484,19 +475,24 @@ -(defun show-all-children () - "Show all children from *current-root*" +(defun show-all-children (&optional (display-child *current-root*)) + "Show all children from *current-root*. Start the effective display +only for display-child and its children" (let ((geometry-change nil)) - (labels ((rec (root father first-p first-father) - (when (show-child root father first-p) - (setf geometry-change t)) + (labels ((rec (root father first-p first-father display-p) + (multiple-value-bind (raise-p change) + (adapt-child-to-father root father) + (when change (setf geometry-change change)) + (when display-p + (show-child root raise-p first-p))) (select-child root (if (equal root *current-child*) t (if (and first-p first-father) :maybe nil))) (when (frame-p root) (let ((first-child (first (frame-child root)))) (dolist (child (reverse (frame-child root))) - (rec child root (equal child first-child) first-p)))))) - (rec *current-root* nil t t) + (rec child root (equal child first-child) first-p + (or display-p (equal root display-child)))))))) + (rec *current-root* nil t t (equal display-child *current-root*)) (set-focus-to-current-child) geometry-change))) @@ -565,7 +561,7 @@ (when (frame-p *current-child*) (with-slots (child) *current-child* (setf child (funcall fun-rotate child))) - (show-all-children))) + (show-all-children *current-child*))) (defun select-next-child () Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Thu Apr 17 10:32:43 2008 @@ -523,8 +523,7 @@ (xlib:display-finish-output *display*) (xlib:process-event *display* :handler #'handle-event)))) (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) father) - (frame-y frame) (y-px->fl (xlib:drawable-y window) father)) - (show-all-children))))) + (frame-y frame) (y-px->fl (xlib:drawable-y window) father)))))) (defun resize-frame (frame father orig-x orig-y) @@ -565,8 +564,7 @@ (xlib:display-finish-output *display*) (xlib:process-event *display* :handler #'handle-event)))) (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) father) - (frame-h frame) (h-px->fl (xlib:drawable-height window) father)) - (show-all-children))))) + (frame-h frame) (h-px->fl (xlib:drawable-height window) father)))))) @@ -593,7 +591,7 @@ (when child (funcall mouse-fn child father root-x root-y))) (when (and child father (focus-all-children child father)) - (when (show-all-children) + (when (show-all-children *current-child*) (setf to-replay nil)))) (if to-replay (replay-button-event) Modified: clfswm/src/package.lisp ============================================================================== --- clfswm/src/package.lisp (original) +++ clfswm/src/package.lisp Thu Apr 17 10:32:43 2008 @@ -133,7 +133,7 @@ (let ((frame (add-frame (create-frame :name "Default" :layout nil :x 0.05 :y 0.05 :w 0.9 :h 0.9) *root-frame*))) - (setf *current-child* (first (frame-child *current-root*))))) + (setf *current-child* frame))) (defparameter *init-hook* #'default-init-hook) From pbrochard at common-lisp.net Fri Apr 18 20:55:29 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 18 Apr 2008 16:55:29 -0400 (EDT) Subject: [clfswm-cvs] r79 - in clfswm: . src Message-ID: <20080418205529.F1AA070F1@common-lisp.net> Author: pbrochard Date: Fri Apr 18 16:55:26 2008 New Revision: 79 Modified: clfswm/ChangeLog clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-layout.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp Log: Display-child is the first child by default -> less flickering. Solve a bug with father-p in show-all-children. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 18 16:55:26 2008 @@ -1,3 +1,8 @@ +2008-04-18 Philippe Brochard + + * src/clfswm-internal.lisp (show-all-children): Display-child is + the first child by default. Solve a bug with father-p. + 2008-04-17 Philippe Brochard * src/clfswm-internal.lisp (add-frame): Add frame return the Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Fri Apr 18 16:55:26 2008 @@ -99,7 +99,7 @@ (defmacro with-movement (&body body) `(when (frame-p *current-child*) , at body - (show-all-children *current-child*) + (show-all-children) ;; PLOP (draw-second-mode-window) (frame-movement-menu))) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Fri Apr 18 16:55:26 2008 @@ -196,7 +196,7 @@ (defun frame-find-free-number () (let ((all-numbers nil)) (with-all-frames (*root-frame* frame) - (push (frame-number frame) all-numbers)) + (pushnew (frame-number frame) all-numbers)) (find-free-number all-numbers))) @@ -461,6 +461,10 @@ (defun select-current-frame (selected) (select-child *current-child* selected)) +(defun unselect-all-frames () + (with-all-children (*current-root* child) + (select-child child nil))) + (defun set-focus-to-current-child () @@ -475,7 +479,7 @@ -(defun show-all-children (&optional (display-child *current-root*)) +(defun show-all-children (&optional (display-child *current-child*)) "Show all children from *current-root*. Start the effective display only for display-child and its children" (let ((geometry-change nil)) @@ -490,7 +494,7 @@ (when (frame-p root) (let ((first-child (first (frame-child root)))) (dolist (child (reverse (frame-child root))) - (rec child root (equal child first-child) first-p + (rec child root (equal child first-child) (and first-p first-father) (or display-p (equal root display-child)))))))) (rec *current-root* nil t t (equal display-child *current-root*)) (set-focus-to-current-child) @@ -512,6 +516,63 @@ + + +(defun focus-child (child father) + "Focus child - Return true if something has change" + (when (and (frame-p father) + (member child (frame-child father))) + (when (not (equal child (first (frame-child father)))) + (loop until (equal child (first (frame-child father))) + do (setf (frame-child father) (rotate-list (frame-child father)))) + t))) + +(defun focus-child-rec (child father) + "Focus child and its fathers - Return true if something has change" + (let ((change nil)) + (labels ((rec (child father) + (when (focus-child child father) + (setf change t)) + (when father + (rec father (find-father-frame father))))) + (rec child father)) + change)) + + +(defun set-current-child-generic (child) + (unless (equal *current-child* child) + (setf *current-child* child) + t)) + +(defgeneric set-current-child (child father window-father)) + +(defmethod set-current-child ((child xlib:window) father window-father) + (set-current-child-generic (if window-father father child))) + +(defmethod set-current-child ((child frame) father window-father) + (declare (ignore father window-father)) + (set-current-child-generic child)) + + +(defun set-current-root (father) + "Set current root if father is not in current root" + (unless (find-child father *current-root*) + (setf *current-root* father))) + + +(defun focus-all-children (child father &optional (window-father t)) + "Focus child and its fathers - +For window: set current child to window or its father according to window-father" + (let ((new-focus (focus-child-rec child father)) + (new-current-child (set-current-child child father window-father)) + (new-root (set-current-root father))) + (or new-focus new-current-child new-root))) + + + + + + (defun select-next/previous-brother (fun-rotate) "Select the next/previous brother frame" (let ((frame-is-root? (and (equal *current-root* *current-child*) @@ -526,7 +587,7 @@ (setf *current-child* (first child))))) (when frame-is-root? (setf *current-root* *current-child*)) - (show-all-children))) + (show-all-children *current-root*))) ;; PLOP (defun select-next-brother () @@ -559,9 +620,10 @@ (defun select-next/previous-child (fun-rotate) "Select the next/previous child" (when (frame-p *current-child*) + (unselect-all-frames) (with-slots (child) *current-child* (setf child (funcall fun-rotate child))) - (show-all-children *current-child*))) + (show-all-children))) ;; PLOP (defun select-next-child () @@ -578,7 +640,7 @@ "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 *current-root*)) ;; PLOP (defun leave-frame () "Leave the selected frame - ie make its father the root frame" @@ -586,7 +648,7 @@ (awhen (find-father-frame *current-root*) (when (frame-p it) (setf *current-root* it))) - (show-all-children)) + (show-all-children *current-root*)) ;; PLOP (defun switch-to-root-frame (&key (show-later nil)) @@ -594,7 +656,7 @@ (hide-all *current-root*) (setf *current-root* *root-frame*) (unless show-later - (show-all-children))) + (show-all-children *current-root*))) ;; PLOP (defun switch-and-select-root-frame (&key (show-later nil)) "Switch and select the root frame" @@ -602,66 +664,14 @@ (setf *current-root* *root-frame*) (setf *current-child* *current-root*) (unless show-later - (show-all-children))) + (show-all-children *current-root*))) ;; PLOP (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)) - - -(defun focus-child (child father) - "Focus child - Return true if something has change" - (when (and (frame-p father) - (member child (frame-child father))) - (when (not (equal child (first (frame-child father)))) - (loop until (equal child (first (frame-child father))) - do (setf (frame-child father) (rotate-list (frame-child father)))) - t))) - -(defun focus-child-rec (child father) - "Focus child and its fathers - Return true if something has change" - (let ((change nil)) - (labels ((rec (child father) - (when (focus-child child father) - (setf change t)) - (when father - (rec father (find-father-frame father))))) - (rec child father)) - change)) - - -(defun set-current-child-generic (child) - (unless (equal *current-child* child) - (setf *current-child* child) - t)) - -(defgeneric set-current-child (child father window-father)) - -(defmethod set-current-child ((child xlib:window) father window-father) - (set-current-child-generic (if window-father father child))) - -(defmethod set-current-child ((child frame) father window-father) - (declare (ignore father window-father)) - (set-current-child-generic child)) - - -(defun set-current-root (father) - "Set current root if father is not in current root" - (unless (find-child father *current-root*) - (setf *current-root* father))) - - -(defun focus-all-children (child father &optional (window-father t)) - "Focus child and its fathers - -For window: set current child to window or its father according to window-father" - (let ((new-focus (focus-child-rec child father)) - (new-current-child (set-current-child child father window-father)) - (new-root (set-current-root father))) - (or new-focus new-current-child new-root))) - + (show-all-children *current-root*)) ;; PLOP (defun remove-child-in-frame (child frame) Modified: clfswm/src/clfswm-layout.lisp ============================================================================== --- clfswm/src/clfswm-layout.lisp (original) +++ clfswm/src/clfswm-layout.lisp Fri Apr 18 16:55:26 2008 @@ -68,7 +68,7 @@ (setf *layout-list* (append *layout-list* (list ',layout))) (defun ,(intern (format nil "~A-ONCE" layout)) () (set-layout-dont-leave #',(intern (subseq (format nil "~A" layout) 4))) - (show-all-children) + (show-all-children *current-root*) (fixe-real-size-current-child) (set-layout-dont-leave #'no-layout)))) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Fri Apr 18 16:55:26 2008 @@ -591,7 +591,7 @@ (when child (funcall mouse-fn child father root-x root-y))) (when (and child father (focus-all-children child father)) - (when (show-all-children *current-child*) + (when (show-all-children) ;; PLOP (setf to-replay nil)))) (if to-replay (replay-button-event) @@ -714,7 +714,7 @@ (setf *current-root* (aref key-slots current-slot) *current-child* *current-root*) (focus-all-children *current-child* *current-child*) - (show-all-children)) + (show-all-children *current-root*)) ;; PLOP (defun bind-or-jump (n) "Bind or jump to a slot" Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Fri Apr 18 16:55:26 2008 @@ -219,7 +219,7 @@ *current-child* *current-root*) (call-hook *init-hook*) (process-existing-windows *screen*) - (show-all-children) + (show-all-children *current-root*) (grab-main-keys) (xlib:display-finish-output *display*)) From pbrochard at common-lisp.net Mon Apr 21 22:10:10 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Mon, 21 Apr 2008 18:10:10 -0400 (EDT) Subject: [clfswm-cvs] r80 - in clfswm: . src Message-ID: <20080421221010.47779601A7@common-lisp.net> Author: pbrochard Date: Mon Apr 21 18:10:05 2008 New Revision: 80 Added: clfswm/src/clfswm-menu.lisp Modified: clfswm/ChangeLog clfswm/TODO clfswm/clfswm.asd clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-info.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-util.lisp Log: New menu system that let user change keys or functions associated to keys. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Mon Apr 21 18:10:05 2008 @@ -1,3 +1,8 @@ +2008-04-22 Philippe Brochard + + * src/clfswm-menu.lisp: New menu system that let user change keys + or functions associated to keys. + 2008-04-18 Philippe Brochard * src/clfswm-internal.lisp (show-all-children): Display-child is Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Mon Apr 21 18:10:05 2008 @@ -7,8 +7,6 @@ =============== Should handle these soon. -- Rethink the menu system to be able to change/add/remove entry. [Philippe] - - Add a frame parameter to choose what window type to handle. [Philippe] - Hook to open next window in named/numbered frame [Philippe] @@ -19,22 +17,13 @@ - Raise/lower frame - this can be done with children order [Philippe] -- Hide/Unhide frame [Philippe] - -- Add boundaries in the info window [Philippe] - -- get-frame-by-name (path) [Philippe] - get-frame-by-name (path): return the frame that its own frame has this name if it exists such a frame - get-window-by-name (path): return the window that its own frame that its own frame has this name if it exists such a window. - - Adapt frame to window hints [Philippe] - Show config -> list and display documentation for all tweakable global variables. [Philippe] -- Set Layout once [Philippe] - - A Gimp layout example [Philippe] +- Add boundaries in the info window [Philippe] MAYBE @@ -64,3 +53,4 @@ - cd/pwd a la shell to navigate throu frames. [Philippe] +- Hide/Unhide frame [Philippe] Modified: clfswm/clfswm.asd ============================================================================== --- clfswm/clfswm.asd (original) +++ clfswm/clfswm.asd Mon Apr 21 18:10:05 2008 @@ -48,10 +48,12 @@ :depends-on ("clfswm" "clfswm-util" "clfswm-second-mode")) (:file "clfswm-nw-hooks" :depends-on ("package" "clfswm-util" "clfswm-info")) + (:file "clfswm-menu" + :depends-on ("package" "clfswm-info")) (:file "bindings" :depends-on ("clfswm" "clfswm-internal" "clfswm-util")) (:file "bindings-second-mode" - :depends-on ("clfswm" "clfswm-util" "clfswm-query" "bindings" "clfswm-pack")))))) + :depends-on ("clfswm" "clfswm-util" "clfswm-query" "bindings" "clfswm-pack" "clfswm-menu")))))) Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Mon Apr 21 18:10:05 2008 @@ -34,74 +34,39 @@ ;;;`----- +(define-second-key ("F1" :mod-1) 'help-on-second-mode) -;;;;;;;;;;;;;;; -;; Menu entry -;;;;;;;;;;;;;;; -(defun frame-adding-menu () - "Adding frame menu" - (info-mode-menu '((#\a add-default-frame) - (#\p add-placed-frame)))) +;;;;;;;;;;;;;;;;; +;;;; Menu entry +;;;;;;;;;;;;;;;;; -(defun frame-layout-menu () - "Frame layout menu" - (info-mode-menu (keys-from-list *layout-list*))) +;;; Here is a small example of menu manipulation: -(defun frame-layout-once-menu () - "Frame layout menu (Set only once)" - (info-mode-menu (keys-from-list (loop :for l :in *layout-list* - :collect (create-symbol (format nil "~A" l) "-ONCE"))))) +;;(add-menu-key 'main "a" 'help-on-second-mode) +;;(add-menu-key 'main "c" 'help-on-clfswm) +;; +;;(add-sub-menu 'main "p" 'plop "A sub menu") +;; +;;(add-menu-key 'plop "a" 'help-on-clfswm) +;;(add-menu-key 'plop "b" 'help-on-second-mode) +;;(add-menu-key 'plop "d" 'help-on-second-mode) -(defun frame-nw-hook-menu () - "Frame new window hook menu" - (info-mode-menu (keys-from-list *nw-hook-list*))) +;;(del-menu-key 'main "p") +;;(del-menu-value 'plop 'help-on-main-mode) +;;(del-sub-menu 'main 'plop) + +;;(define-second-key ("a") 'open-menu) - -(defun frame-pack-menu () - "Frame pack menu" - (info-mode-menu '(("Up" current-frame-pack-up) - ("Down" current-frame-pack-down) - ("Left" current-frame-pack-left) - ("Right" current-frame-pack-right)))) - - -(defun frame-fill-menu () - "Frame fill menu" - (info-mode-menu '(("Up" current-frame-fill-up) - ("Down" current-frame-fill-down) - ("Left" current-frame-fill-left) - ("Right" current-frame-fill-right) - (#\a current-frame-fill-all-dir) - (#\v current-frame-fill-vertical) - (#\h current-frame-fill-horizontal)))) - -(defun frame-resize-menu () - "Frame resize menu" - (info-mode-menu '(("Up" current-frame-resize-up) - ("Down" current-frame-resize-down) - ("Left" current-frame-resize-left) - ("Right" current-frame-resize-right) - (#\d current-frame-resize-all-dir) - (#\a current-frame-resize-all-dir-minimal)))) - - -(defun frame-movement-menu () - "Frame movement menu" - (info-mode-menu '((#\p frame-pack-menu) - (#\f frame-fill-menu) - (#\r frame-resize-menu) - (#\c center-current-frame))) - (leave-second-mode)) (defmacro with-movement (&body body) `(when (frame-p *current-child*) , at body - (show-all-children) ;; PLOP + (show-all-children) (draw-second-mode-window) - (frame-movement-menu))) + (open-menu (find-menu 'frame-movement-menu)))) ;;; Pack @@ -195,87 +160,127 @@ +(defun frame-layout-menu () + "< Frame layout menu >" + (info-mode-menu (keys-from-list *layout-list*))) + +(defun frame-layout-once-menu () + "< Frame layout menu (Set only once) >" + (info-mode-menu (keys-from-list (loop :for l :in *layout-list* + :collect (create-symbol (format nil "~A" l) "-ONCE"))))) + +(defun frame-nw-hook-menu () + "< Frame new window hook menu >" + (info-mode-menu (keys-from-list *nw-hook-list*))) -(defun action-by-name-menu () - "Actions by name menu" - (info-mode-menu '((#\f focus-frame-by-name) - (#\o open-frame-by-name) - (#\d delete-frame-by-name) - (#\m move-current-child-by-name) - (#\c copy-current-child-by-name)))) - -(defun action-by-number-menu () - "Actions by number menu" - (info-mode-menu '((#\f focus-frame-by-number) - (#\o open-frame-by-number) - (#\d delete-frame-by-number) - (#\m move-current-child-by-number) - (#\c copy-current-child-by-number)))) - - -(defun frame-info-menu () - "Frame information menu" - (info-mode-menu '((#\s show-all-frames-info) - (#\h hide-all-frames-info)))) - - -(defun frame-menu () - "Frame menu" - (info-mode-menu '((#\a frame-adding-menu) - (#\l frame-layout-menu) - (#\o frame-layout-once-menu) - (#\n frame-nw-hook-menu) - (#\m frame-movement-menu) - (#\r rename-current-child) - (#\u renumber-current-frame) - (#\i frame-info-menu) - (#\x explode-current-frame)))) - -(defun window-menu () - "Window menu" - (info-mode-menu '((#\i force-window-in-frame) - (#\c force-window-center-in-frame)))) - - - -(defun selection-menu () - "Selection menu" - (info-mode-menu '((#\x cut-current-child) - (#\c copy-current-child) - (#\v paste-selection) - (#\p paste-selection-no-clear) - ("Delete" remove-current-child) - (#\z clear-selection)))) - - -(defun utility-menu () - "Utility menu" - (info-mode-menu '((#\i identify-key) - ("colon" eval-from-query-string) - ("exclam" run-program-from-query-string)))) - -(defun main-menu () - "Open the main menu" - (info-mode-menu '((#\f frame-menu) - (#\w window-menu) - (#\s selection-menu) - (#\n action-by-name-menu) - (#\u action-by-number-menu) - (#\y utility-menu)))) +(add-sub-menu 'main "f" 'frame-menu "Frame menu") +(add-sub-menu 'main "w" 'window-menu "Window menu") +(add-sub-menu 'main "s" 'selection-menu "Selection menu") +(add-sub-menu 'main "n" 'action-by-name-menu "Action by name menu") +(add-sub-menu 'main "u" 'action-by-number-menu "Action by number menu") +(add-sub-menu 'main "y" 'utility-menu "Utility menu") +(add-sub-menu 'frame-menu "a" 'frame-adding-menu "Adding frame menu") +(add-menu-key 'frame-menu "l" 'frame-layout-menu) +(add-menu-key 'frame-menu "o" 'frame-layout-once-menu) +(add-menu-key 'frame-menu "n" 'frame-nw-hook-menu) +(add-sub-menu 'frame-menu "m" 'frame-movement-menu "Frame movement menu") +(add-sub-menu 'frame-menu "i" 'frame-info-menu "Frame info menu") +(add-menu-key 'frame-menu "r" 'rename-current-child) +(add-menu-key 'frame-menu "u" 'renumber-current-frame) +(add-menu-key 'frame-menu "x" 'explode-current-frame) +(add-menu-key 'frame-adding-menu "a" 'add-default-frame) +(add-menu-key 'frame-adding-menu "p" 'add-placed-frame) -(define-second-key ("F1" :mod-1) 'help-on-second-mode) -(define-second-key ("m") 'main-menu) -(define-second-key ("f") 'frame-menu) -(define-second-key ("n") 'action-by-name-menu) -(define-second-key ("u") 'action-by-number-menu) +(add-sub-menu 'frame-movement-menu "p" 'frame-pack-menu "Frame pack menu") +(add-sub-menu 'frame-movement-menu "f" 'frame-fill-menu "Frame fill menu") +(add-sub-menu 'frame-movement-menu "r" 'frame-resize-menu "Frame resize menu") +(add-menu-key 'frame-movement-menu "c" 'center-current-frame) + + +(add-menu-key 'frame-pack-menu "Up" 'current-frame-pack-up) +(add-menu-key 'frame-pack-menu "Down" 'current-frame-pack-down) +(add-menu-key 'frame-pack-menu "Left" 'current-frame-pack-left) +(add-menu-key 'frame-pack-menu "Right" 'current-frame-pack-right) + + +(add-menu-key 'frame-fill-menu "Up" 'current-frame-fill-up) +(add-menu-key 'frame-fill-menu "Down" 'current-frame-fill-down) +(add-menu-key 'frame-fill-menu "Left" 'current-frame-fill-left) +(add-menu-key 'frame-fill-menu "Right" 'current-frame-fill-right) +(add-menu-key 'frame-fill-menu #\a 'current-frame-fill-all-dir) +(add-menu-key 'frame-fill-menu #\v 'current-frame-fill-vertical) +(add-menu-key 'frame-fill-menu #\h 'current-frame-fill-horizontal) + +(add-menu-key 'frame-resize-menu "Up" 'current-frame-resize-up) +(add-menu-key 'frame-resize-menu "Down" 'current-frame-resize-down) +(add-menu-key 'frame-resize-menu "Left" 'current-frame-resize-left) +(add-menu-key 'frame-resize-menu "Right" 'current-frame-resize-right) +(add-menu-key 'frame-resize-menu #\d 'current-frame-resize-all-dir) +(add-menu-key 'frame-resize-menu #\a 'current-frame-resize-all-dir-minimal) + + +(add-menu-key 'frame-info-menu "s" 'show-all-frames-info) +(add-menu-key 'frame-info-menu "h" 'hide-all-frames-info) + + +(add-menu-key 'window-menu "i" 'force-window-in-frame) +(add-menu-key 'window-menu "c" 'force-window-center-in-frame) + + +(add-menu-key 'selection-menu "x" 'cut-current-child) +(add-menu-key 'selection-menu "c" 'copy-current-child) +(add-menu-key 'selection-menu "v" 'paste-selection) +(add-menu-key 'selection-menu "p" 'paste-selection-no-clear) +(add-menu-key 'selection-menu "Delete" 'remove-current-child) +(add-menu-key 'selection-menu "z" 'clear-selection) + + + +(add-menu-key 'action-by-name-menu "f" 'focus-frame-by-name) +(add-menu-key 'action-by-name-menu "o" 'open-frame-by-name) +(add-menu-key 'action-by-name-menu "d" 'delete-frame-by-name) +(add-menu-key 'action-by-name-menu "m" 'move-current-child-by-name) +(add-menu-key 'action-by-name-menu "c" 'copy-current-child-by-name) + +(add-menu-key 'action-by-number-menu "f" 'focus-frame-by-number) +(add-menu-key 'action-by-number-menu "o" 'open-frame-by-number) +(add-menu-key 'action-by-number-menu "d" 'delete-frame-by-number) +(add-menu-key 'action-by-number-menu "m" 'move-current-child-by-number) +(add-menu-key 'action-by-number-menu "c" 'copy-current-child-by-number) + + +(add-menu-key 'utility-menu "i" 'identify-key) +(add-menu-key 'utility-menu "colon" 'eval-from-query-string) +(add-menu-key 'utility-menu "exclam" 'run-program-from-query-string) + + + + +(defun open-frame-menu () + "Open the frame menu" + (open-menu (find-menu 'frame-menu))) + +(defun open-action-by-name-menu () + "Open the action by name menu" + (open-menu (find-menu 'action-by-name-menu))) + +(defun open-action-by-number-menu () + "Open the action by number menu" + (open-menu (find-menu 'action-by-number-menu))) + + +(define-second-key ("m") 'open-menu) +(define-second-key ("f") 'open-frame-menu) +(define-second-key ("n") 'open-action-by-name-menu) +(define-second-key ("u") 'open-action-by-number-menu) ;;(define-second-key (#\g :control) 'stop-all-pending-actions) @@ -389,11 +394,6 @@ - - - - - ;;; Mouse action (defun sm-mouse-click-to-focus-and-move (window root-x root-y) "Move and focus the current child - Create a new frame on the root window" Modified: clfswm/src/clfswm-info.lisp ============================================================================== --- clfswm/src/clfswm-info.lisp (original) +++ clfswm/src/clfswm-info.lisp Mon Apr 21 18:10:05 2008 @@ -431,7 +431,7 @@ (defun help-on-second-mode () - "Open the help and info window" + "Open the help and info window for the second mode" (info-mode-menu '((#\h show-global-key-binding) (#\b show-second-mode-key-binding) (#\t show-date) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Mon Apr 21 18:10:05 2008 @@ -587,7 +587,7 @@ (setf *current-child* (first child))))) (when frame-is-root? (setf *current-root* *current-child*)) - (show-all-children *current-root*))) ;; PLOP + (show-all-children *current-root*))) (defun select-next-brother () @@ -623,7 +623,7 @@ (unselect-all-frames) (with-slots (child) *current-child* (setf child (funcall fun-rotate child))) - (show-all-children))) ;; PLOP + (show-all-children))) (defun select-next-child () @@ -640,7 +640,7 @@ "Enter in the selected frame - ie make it the root frame" (hide-all *current-root*) (setf *current-root* *current-child*) - (show-all-children *current-root*)) ;; PLOP + (show-all-children *current-root*)) (defun leave-frame () "Leave the selected frame - ie make its father the root frame" @@ -648,7 +648,7 @@ (awhen (find-father-frame *current-root*) (when (frame-p it) (setf *current-root* it))) - (show-all-children *current-root*)) ;; PLOP + (show-all-children *current-root*)) (defun switch-to-root-frame (&key (show-later nil)) @@ -656,7 +656,7 @@ (hide-all *current-root*) (setf *current-root* *root-frame*) (unless show-later - (show-all-children *current-root*))) ;; PLOP + (show-all-children *current-root*))) (defun switch-and-select-root-frame (&key (show-later nil)) "Switch and select the root frame" @@ -664,14 +664,14 @@ (setf *current-root* *root-frame*) (setf *current-child* *current-root*) (unless show-later - (show-all-children *current-root*))) ;; PLOP + (show-all-children *current-root*))) (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 *current-root*)) ;; PLOP + (show-all-children *current-root*)) (defun remove-child-in-frame (child frame) Added: clfswm/src/clfswm-menu.lisp ============================================================================== --- (empty file) +++ clfswm/src/clfswm-menu.lisp Mon Apr 21 18:10:05 2008 @@ -0,0 +1,129 @@ +;;; -------------------------------------------------------------------------- +;;; CLFSWM - FullScreen Window Manager +;;; +;;; -------------------------------------------------------------------------- +;;; Documentation: Menu functions +;;; -------------------------------------------------------------------------- +;;; +;;; (C) 2005 Philippe Brochard +;;; +;;; This program is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program; if not, write to the Free Software +;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +;;; +;;; -------------------------------------------------------------------------- + +(in-package :clfswm) + + +(defstruct menu name item doc) +(defstruct menu-item key value) + + +(defvar *menu* (make-menu :name 'main)) + + +(defmacro with-all-menu ((menu item) &body body) + (let ((rec (gensym)) + (subm (gensym))) + `(labels ((,rec (,item) + , at body + (when (menu-p ,item) + (dolist (,subm (menu-item ,item)) + (,rec ,subm))) + (when (and (menu-item-p ,item) (menu-p (menu-item-value ,item))) + (,rec (menu-item-value ,item))))) + (,rec ,menu)))) + +(defun add-item (item &optional (menu *menu*)) + (setf (menu-item menu) (nconc (menu-item menu) (list item)))) + +(defun del-item (item &optional (menu *menu*)) + (setf (menu-item menu) (remove item (menu-item menu)))) + + + +;;; Finding functions +(defun find-menu (name &optional (root *menu*)) + (with-all-menu (root item) + (when (and (menu-p item) + (equal name (menu-name item))) + (return-from find-menu item)))) + + +(defun find-item-by-key (key &optional (root *menu*)) + (with-all-menu (root item) + (when (and (menu-item-p item) + (equal (menu-item-key item) key)) + (return-from find-item-by-key item)))) + +(defun find-item-by-value (value &optional (root *menu*)) + (with-all-menu (root item) + (when (and (menu-item-p item) + (equal (menu-item-value item) value)) + (return-from find-item-by-value item)))) + + +(defun del-item-by-key (key &optional (menu *menu*)) + (del-item (find-item-by-key key menu) menu)) + +(defun del-item-by-value (value &optional (menu *menu*)) + (del-item (find-item-by-value value menu) menu)) + + + +;;; Convenient functions +(defun add-menu-key (menu-name key value) + (add-item (make-menu-item :key key :value value) (find-menu menu-name))) + +(defun add-sub-menu (menu-name key sub-menu-name &optional (doc "Sub menu")) + (add-item (make-menu-item :key key :value (make-menu :name sub-menu-name :doc doc)) (find-menu menu-name))) + + +(defun del-menu-key (menu-name key) + (del-item-by-key key (find-menu menu-name))) + +(defun del-menu-value (menu-name value) + (del-item-by-value value (find-menu menu-name))) + +(defun del-sub-menu (menu-name sub-menu-name) + (del-item-by-value (find-menu sub-menu-name) (find-menu menu-name))) + + + + +;;; Display menu functions +(defun open-menu (&optional (menu *menu*)) + "Open the main menu" + (let ((info-list nil) + (action nil)) + (dolist (item (menu-item menu)) + (let ((value (menu-item-value item))) + (push (format nil "~A: ~A" (menu-item-key item) (typecase value + (menu (format nil "< ~A >" (menu-doc value))) + (t (documentation value 'function)))) + info-list) + (define-info-key-fun (list (menu-item-key item) 0) + (lambda (&optional args) + (declare (ignore args)) + (setf action value) + (throw 'exit-info-loop nil))))) + (info-mode (nreverse info-list)) + (dolist (item (menu-item menu)) + (undefine-info-key-fun (list (menu-item-key item) 0))) + (typecase action + (menu (open-menu action)) + (t (when (fboundp action) + (funcall action)))))) + + \ No newline at end of file Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Mon Apr 21 18:10:05 2008 @@ -336,7 +336,8 @@ (hide-all *current-root*) (focus-all-children frame (or (find-father-frame frame *current-root*) (find-father-frame frame) - *root-frame*)))) + *root-frame*)) + (show-all-children *current-root*))) (defun focus-frame-by-name () @@ -353,7 +354,8 @@ ;;; Open by functions (defun open-frame-by (frame) (when (frame-p frame) - (push (create-frame :name (query-string "Frame name")) (frame-child frame)))) + (push (create-frame :name (query-string "Frame name")) (frame-child frame)) + (show-all-children *current-root*))) @@ -364,7 +366,7 @@ (defun open-frame-by-number () "Open a new frame in a numbered frame" - (open-frame-by (find-frame-by-name (ask-frame-name "Open a new frame in the grou numbered:"))) + (open-frame-by (find-frame-by-number (query-number "Open a new frame in the group numbered:"))) (leave-second-mode)) @@ -376,7 +378,8 @@ (setf *current-root* *root-frame*)) (when (equal frame *current-child*) (setf *current-child* *current-root*)) - (remove-child-in-frame frame (find-father-frame frame)))) + (remove-child-in-frame frame (find-father-frame frame))) + (show-all-children *current-root*)) (defun delete-frame-by-name () @@ -396,7 +399,8 @@ (hide-all *current-root*) (remove-child-in-frame child (find-father-frame child)) (pushnew child (frame-child frame-dest)) - (focus-all-children child frame-dest))) + (focus-all-children child frame-dest) + (show-all-children *current-root*))) (defun move-current-child-by-name () "Move current child in a named frame" @@ -418,7 +422,8 @@ (when (and child (frame-p frame-dest)) (hide-all *current-root*) (pushnew child (frame-child frame-dest)) - (focus-all-children child frame-dest))) + (focus-all-children child frame-dest) + (show-all-children *current-root*))) (defun copy-current-child-by-name () "Copy current child in a named frame" @@ -591,7 +596,7 @@ (when child (funcall mouse-fn child father root-x root-y))) (when (and child father (focus-all-children child father)) - (when (show-all-children) ;; PLOP + (when (show-all-children) (setf to-replay nil)))) (if to-replay (replay-button-event) @@ -714,7 +719,7 @@ (setf *current-root* (aref key-slots current-slot) *current-child* *current-root*) (focus-all-children *current-child* *current-child*) - (show-all-children *current-root*)) ;; PLOP + (show-all-children *current-root*)) (defun bind-or-jump (n) "Bind or jump to a slot" From pbrochard at common-lisp.net Tue Apr 22 19:11:40 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Tue, 22 Apr 2008 15:11:40 -0400 (EDT) Subject: [clfswm-cvs] r81 - in clfswm: . src Message-ID: <20080422191140.68CEB5202E@common-lisp.net> Author: pbrochard Date: Tue Apr 22 15:11:38 2008 New Revision: 81 Modified: clfswm/ChangeLog clfswm/src/clfswm-util.lisp Log: Show the documentation for the function bound on a key. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Tue Apr 22 15:11:38 2008 @@ -1,5 +1,8 @@ 2008-04-22 Philippe Brochard + * src/clfswm-util.lisp (identify-key): Show the documentation for + the function bound on a key. + * src/clfswm-menu.lisp: New menu system that let user change keys or functions associated to keys. Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Tue Apr 22 15:11:38 2008 @@ -220,9 +220,9 @@ :line-style :solid))) (labels ((print-doc (msg hash-table-key pos code state) (let ((function (find-key-from-code hash-table-key code state))) - (when function + (when (and function (fboundp (first function))) (xlib:draw-image-glyphs window gc 10 (+ (* pos (+ (xlib:max-char-ascent font) (xlib:max-char-descent font))) 5) - (format nil "~A ~A" msg (documentation function 'function)))))) + (format nil "~A ~A" msg (documentation (first function) 'function)))))) (print-key (code state keysym key modifiers) (xlib:clear-area window) (setf (xlib:gcontext-foreground gc) (get-color *identify-foreground*)) From pbrochard at common-lisp.net Tue Apr 22 19:42:17 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Tue, 22 Apr 2008 15:42:17 -0400 (EDT) Subject: [clfswm-cvs] r82 - in clfswm: . src Message-ID: <20080422194217.C954E2E2CC@common-lisp.net> Author: pbrochard Date: Tue Apr 22 15:42:15 2008 New Revision: 82 Modified: clfswm/ChangeLog clfswm/clfswm.asd clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-second-mode.lisp clfswm/src/clfswm-util.lisp Log: Move with-movement, current-frame-fill/pack/resize-* from bindings-second-mode.lisp to clfswm-util.lisp. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Tue Apr 22 15:42:15 2008 @@ -2,6 +2,9 @@ * src/clfswm-util.lisp (identify-key): Show the documentation for the function bound on a key. + (with-movement): Move with-movement, + current-frame-fill/pack/resize-* from bindings-second-mode.lisp + to clfswm-util.lisp. * src/clfswm-menu.lisp: New menu system that let user change keys or functions associated to keys. Modified: clfswm/clfswm.asd ============================================================================== --- clfswm/clfswm.asd (original) +++ clfswm/clfswm.asd Tue Apr 22 15:42:15 2008 @@ -38,8 +38,10 @@ :depends-on ("package" "clfswm-internal")) (:file "clfswm-info" :depends-on ("package" "version" "xlib-util" "config" "clfswm-keys" "clfswm" "clfswm-internal")) + (:file "clfswm-menu" + :depends-on ("package" "clfswm-info")) (:file "clfswm-util" - :depends-on ("clfswm" "keysyms" "clfswm-info" "clfswm-second-mode" "clfswm-query")) + :depends-on ("clfswm" "keysyms" "clfswm-info" "clfswm-second-mode" "clfswm-query" "clfswm-menu")) (:file "clfswm-query" :depends-on ("package" "config")) (:file "clfswm-layout" @@ -48,8 +50,6 @@ :depends-on ("clfswm" "clfswm-util" "clfswm-second-mode")) (:file "clfswm-nw-hooks" :depends-on ("package" "clfswm-util" "clfswm-info")) - (:file "clfswm-menu" - :depends-on ("package" "clfswm-info")) (:file "bindings" :depends-on ("clfswm" "clfswm-internal" "clfswm-util")) (:file "bindings-second-mode" Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Tue Apr 22 15:42:15 2008 @@ -60,106 +60,6 @@ - -(defmacro with-movement (&body body) - `(when (frame-p *current-child*) - , at body - (show-all-children) - (draw-second-mode-window) - (open-menu (find-menu 'frame-movement-menu)))) - - -;;; Pack -(defun current-frame-pack-up () - "Pack the current frame up" - (with-movement (pack-frame-up *current-child* (find-father-frame *current-child* *current-root*)))) - -(defun current-frame-pack-down () - "Pack the current frame down" - (with-movement (pack-frame-down *current-child* (find-father-frame *current-child* *current-root*)))) - -(defun current-frame-pack-left () - "Pack the current frame left" - (with-movement (pack-frame-left *current-child* (find-father-frame *current-child* *current-root*)))) - -(defun current-frame-pack-right () - "Pack the current frame right" - (with-movement (pack-frame-right *current-child* (find-father-frame *current-child* *current-root*)))) - -;;; Center -(defun center-current-frame () - "Center the current frame" - (with-movement (center-frame *current-child*))) - -;;; Fill -(defun current-frame-fill-up () - "Fill the current frame up" - (with-movement (fill-frame-up *current-child* (find-father-frame *current-child* *current-root*)))) - -(defun current-frame-fill-down () - "Fill the current frame down" - (with-movement (fill-frame-down *current-child* (find-father-frame *current-child* *current-root*)))) - -(defun current-frame-fill-left () - "Fill the current frame left" - (with-movement (fill-frame-left *current-child* (find-father-frame *current-child* *current-root*)))) - -(defun current-frame-fill-right () - "Fill the current frame right" - (with-movement (fill-frame-right *current-child* (find-father-frame *current-child* *current-root*)))) - -(defun current-frame-fill-all-dir () - "Fill the current frame in all directions" - (with-movement - (let ((father (find-father-frame *current-child* *current-root*))) - (fill-frame-up *current-child* father) - (fill-frame-down *current-child* father) - (fill-frame-left *current-child* father) - (fill-frame-right *current-child* father)))) - -(defun current-frame-fill-vertical () - "Fill the current frame vertically" - (with-movement - (let ((father (find-father-frame *current-child* *current-root*))) - (fill-frame-up *current-child* father) - (fill-frame-down *current-child* father)))) - -(defun current-frame-fill-horizontal () - "Fill the current frame horizontally" - (with-movement - (let ((father (find-father-frame *current-child* *current-root*))) - (fill-frame-left *current-child* father) - (fill-frame-right *current-child* father)))) - - -;;; Resize -(defun current-frame-resize-up () - "Resize the current frame up to its half height" - (with-movement (resize-half-height-up *current-child*))) - -(defun current-frame-resize-down () - "Resize the current frame down to its half height" - (with-movement (resize-half-height-down *current-child*))) - -(defun current-frame-resize-left () - "Resize the current frame left to its half width" - (with-movement (resize-half-width-left *current-child*))) - -(defun current-frame-resize-right () - "Resize the current frame right to its half width" - (with-movement (resize-half-width-right *current-child*))) - -(defun current-frame-resize-all-dir () - "Resize down the current frame" - (with-movement (resize-frame-down *current-child*))) - -(defun current-frame-resize-all-dir-minimal () - "Resize down the current frame to its minimal size" - (with-movement (resize-minimal-frame *current-child*))) - - - - (defun frame-layout-menu () "< Frame layout menu >" (info-mode-menu (keys-from-list *layout-list*))) Modified: clfswm/src/clfswm-second-mode.lisp ============================================================================== --- clfswm/src/clfswm-second-mode.lisp (original) +++ clfswm/src/clfswm-second-mode.lisp Tue Apr 22 15:42:15 2008 @@ -215,7 +215,3 @@ "Leave second mode" (banish-pointer) (throw 'exit-second-loop nil)) - - - - Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Tue Apr 22 15:42:15 2008 @@ -736,3 +736,104 @@ (child-fullname it) "Not set - Please, bind it with Return")))) (list default-bind)))))) + + + + +;;; Useful function for the second mode + +(defmacro with-movement (&body body) + `(when (frame-p *current-child*) + , at body + (show-all-children) + (draw-second-mode-window) + (open-menu (find-menu 'frame-movement-menu)))) + + +;;; Pack +(defun current-frame-pack-up () + "Pack the current frame up" + (with-movement (pack-frame-up *current-child* (find-father-frame *current-child* *current-root*)))) + +(defun current-frame-pack-down () + "Pack the current frame down" + (with-movement (pack-frame-down *current-child* (find-father-frame *current-child* *current-root*)))) + +(defun current-frame-pack-left () + "Pack the current frame left" + (with-movement (pack-frame-left *current-child* (find-father-frame *current-child* *current-root*)))) + +(defun current-frame-pack-right () + "Pack the current frame right" + (with-movement (pack-frame-right *current-child* (find-father-frame *current-child* *current-root*)))) + +;;; Center +(defun center-current-frame () + "Center the current frame" + (with-movement (center-frame *current-child*))) + +;;; Fill +(defun current-frame-fill-up () + "Fill the current frame up" + (with-movement (fill-frame-up *current-child* (find-father-frame *current-child* *current-root*)))) + +(defun current-frame-fill-down () + "Fill the current frame down" + (with-movement (fill-frame-down *current-child* (find-father-frame *current-child* *current-root*)))) + +(defun current-frame-fill-left () + "Fill the current frame left" + (with-movement (fill-frame-left *current-child* (find-father-frame *current-child* *current-root*)))) + +(defun current-frame-fill-right () + "Fill the current frame right" + (with-movement (fill-frame-right *current-child* (find-father-frame *current-child* *current-root*)))) + +(defun current-frame-fill-all-dir () + "Fill the current frame in all directions" + (with-movement + (let ((father (find-father-frame *current-child* *current-root*))) + (fill-frame-up *current-child* father) + (fill-frame-down *current-child* father) + (fill-frame-left *current-child* father) + (fill-frame-right *current-child* father)))) + +(defun current-frame-fill-vertical () + "Fill the current frame vertically" + (with-movement + (let ((father (find-father-frame *current-child* *current-root*))) + (fill-frame-up *current-child* father) + (fill-frame-down *current-child* father)))) + +(defun current-frame-fill-horizontal () + "Fill the current frame horizontally" + (with-movement + (let ((father (find-father-frame *current-child* *current-root*))) + (fill-frame-left *current-child* father) + (fill-frame-right *current-child* father)))) + + +;;; Resize +(defun current-frame-resize-up () + "Resize the current frame up to its half height" + (with-movement (resize-half-height-up *current-child*))) + +(defun current-frame-resize-down () + "Resize the current frame down to its half height" + (with-movement (resize-half-height-down *current-child*))) + +(defun current-frame-resize-left () + "Resize the current frame left to its half width" + (with-movement (resize-half-width-left *current-child*))) + +(defun current-frame-resize-right () + "Resize the current frame right to its half width" + (with-movement (resize-half-width-right *current-child*))) + +(defun current-frame-resize-all-dir () + "Resize down the current frame" + (with-movement (resize-frame-down *current-child*))) + +(defun current-frame-resize-all-dir-minimal () + "Resize down the current frame to its minimal size" + (with-movement (resize-minimal-frame *current-child*))) From pbrochard at common-lisp.net Tue Apr 22 19:47:54 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Tue, 22 Apr 2008 15:47:54 -0400 (EDT) Subject: [clfswm-cvs] r83 - clfswm Message-ID: <20080422194754.200393203C@common-lisp.net> Author: pbrochard Date: Tue Apr 22 15:47:53 2008 New Revision: 83 Modified: clfswm/ChangeLog clfswm/clfswm.asd Log: clfswm.asd: Add a dependency from clfswm-second-mode.lisp to clfswm.lisp. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Tue Apr 22 15:47:53 2008 @@ -1,5 +1,8 @@ 2008-04-22 Philippe Brochard + * clfswm.asd (clfswm): Add a dependency from + clfswm-second-mode.lisp to clfswm.lisp. + * src/clfswm-util.lisp (identify-key): Show the documentation for the function bound on a key. (with-movement): Move with-movement, Modified: clfswm/clfswm.asd ============================================================================== --- clfswm/clfswm.asd (original) +++ clfswm/clfswm.asd Tue Apr 22 15:47:53 2008 @@ -35,7 +35,7 @@ (:file "version" :depends-on ("tools")) (:file "clfswm-second-mode" - :depends-on ("package" "clfswm-internal")) + :depends-on ("package" "clfswm" "clfswm-internal")) (:file "clfswm-info" :depends-on ("package" "version" "xlib-util" "config" "clfswm-keys" "clfswm" "clfswm-internal")) (:file "clfswm-menu" From pbrochard at common-lisp.net Fri Apr 25 15:27:27 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 11:27:27 -0400 (EDT) Subject: [clfswm-cvs] r84 - in clfswm: . src Message-ID: <20080425152727.5A77E1127@common-lisp.net> Author: pbrochard Date: Fri Apr 25 11:27:20 2008 New Revision: 84 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-nw-hooks.lisp clfswm/src/clfswm-util.lisp clfswm/src/config.lisp clfswm/src/package.lisp clfswm/src/tools.lisp Log: open-in-new-frame-in-parent-frame-nw-hook: New new window hook. adapt-current-frame-to-window-hints: New function. ensure-printable: Return always a string even with a null string. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 11:27:20 2008 @@ -1,3 +1,19 @@ +2008-04-25 Philippe Brochard + + * src/clfswm-nw-hooks.lisp + (open-in-new-frame-in-parent-frame-nw-hook): New new window hook. + + * src/clfswm-util.lisp (adapt-current-frame-to-window-hints): New + function. + + * src/tools.lisp (ensure-printable): Return always a string even + with a null string. + +2008-04-24 Philippe Brochard + + * src/config.lisp (*default-nw-hook*): New variable to change the + default new window hook. + 2008-04-22 Philippe Brochard * clfswm.asd (clfswm): Add a dependency from Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Fri Apr 25 11:27:20 2008 @@ -9,22 +9,23 @@ - Add a frame parameter to choose what window type to handle. [Philippe] -- Hook to open next window in named/numbered frame [Philippe] +- Move the autodoc in its own file (clfswm-autodoc.lisp) and make the autodoc + for the menu system. -- Undo/redo (any idea to implement this is welcome) +- Hook to open next window in named/numbered frame [Philippe] - Ensure-unique-number/name (new function) [Philippe] - Raise/lower frame - this can be done with children order [Philippe] -- Adapt frame to window hints [Philippe] - - Show config -> list and display documentation for all tweakable global variables. [Philippe] - A Gimp layout example [Philippe] - Add boundaries in the info window [Philippe] +- Allow to move/resize transient windows [Philippe] + MAYBE ===== @@ -54,3 +55,5 @@ - cd/pwd a la shell to navigate throu frames. [Philippe] - Hide/Unhide frame [Philippe] + +- Undo/redo (any idea to implement this is welcome) Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Fri Apr 25 11:27:20 2008 @@ -133,6 +133,9 @@ (add-menu-key 'window-menu "i" 'force-window-in-frame) (add-menu-key 'window-menu "c" 'force-window-center-in-frame) +(add-menu-key 'window-menu "a" 'adapt-current-frame-to-window-hints) +(add-menu-key 'window-menu "w" 'adapt-current-frame-to-window-width-hint) +(add-menu-key 'window-menu "h" 'adapt-current-frame-to-window-height-hint) (add-menu-key 'selection-menu "x" 'cut-current-child) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Fri Apr 25 11:27:20 2008 @@ -744,7 +744,7 @@ (t 1))) (grab-all-buttons window) (unless (do-all-frames-nw-hook window) - (default-frame-nw-hook nil window)) + (call-hook *default-nw-hook* (list *root-frame* window))) (netwm-add-in-client-list window))) Modified: clfswm/src/clfswm-nw-hooks.lisp ============================================================================== --- clfswm/src/clfswm-nw-hooks.lisp (original) +++ clfswm/src/clfswm-nw-hooks.lisp Fri Apr 25 11:27:20 2008 @@ -133,6 +133,28 @@ (register-nw-hook 'set-open-in-new-frame-in-root-frame-nw-hook) +;;; Open new window in a new frame in the parent frame hook +(defun open-in-new-frame-in-parent-frame-nw-hook (frame window) + "Open the next window in a new frame in the parent frame" + (let ((new-frame (create-frame)) + (parent (find-father-frame frame))) + (when parent + (pushnew new-frame (frame-child parent)) + (pushnew window (frame-child new-frame)) + (hide-all *current-root*) + (setf *current-root* parent) + (setf *current-child* new-frame) + (default-window-placement new-frame window) + (show-all-children *current-root*))) + (setf (frame-nw-hook frame) nil)) + +(defun set-open-in-new-frame-in-parent-frame-nw-hook () + "Open the next window in a new frame in the parent frame" + (set-nw-hook #'open-in-new-frame-in-parent-frame-nw-hook)) + +(register-nw-hook 'set-open-in-new-frame-in-parent-frame-nw-hook) + + ;;; Open a new window but leave the focus on the current child (defun leave-focus-frame-nw-hook (frame window) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Fri Apr 25 11:27:20 2008 @@ -40,6 +40,7 @@ (let ((name (query-string (format nil "New child name: (last: ~A)" (child-name *current-child*)) (child-name *current-child*)))) (rename-child *current-child* name) + (display-frame-info *current-child*) (leave-second-mode))) @@ -739,9 +740,9 @@ - -;;; Useful function for the second mode - +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Useful function for the second mode ;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defmacro with-movement (&body body) `(when (frame-p *current-child*) , at body @@ -837,3 +838,33 @@ (defun current-frame-resize-all-dir-minimal () "Resize down the current frame to its minimal size" (with-movement (resize-minimal-frame *current-child*))) + + + +;;; Adapt frame functions +(defun adapt-current-frame-to-window-hints-generic (width-p height-p) + "Adapt the current frame to the current window minimal size hints" + (when (frame-p *current-child*) + (let ((window (first (frame-child *current-child*)))) + (when (xlib:window-p window) + (let* ((hints (xlib:wm-normal-hints window)) + (min-width (and hints (xlib:wm-size-hints-min-width hints))) + (min-height (and hints (xlib:wm-size-hints-min-height hints)))) + (when (and width-p min-width) + (setf (frame-rw *current-child*) min-width)) + (when (and height-p min-height) + (setf (frame-rh *current-child*) min-height)) + (fixe-real-size *current-child* (find-father-frame *current-child*)) + (leave-second-mode)))))) + +(defun adapt-current-frame-to-window-hints () + "Adapt the current frame to the current window minimal size hints" + (adapt-current-frame-to-window-hints-generic t t)) + +(defun adapt-current-frame-to-window-width-hint () + "Adapt the current frame to the current window minimal width hint" + (adapt-current-frame-to-window-hints-generic t nil)) + +(defun adapt-current-frame-to-window-height-hint () + "Adapt the current frame to the current window minimal height hint" + (adapt-current-frame-to-window-hints-generic nil t)) Modified: clfswm/src/config.lisp ============================================================================== --- clfswm/src/config.lisp (original) +++ clfswm/src/config.lisp Fri Apr 25 11:27:20 2008 @@ -47,10 +47,35 @@ ;; (values 100 100 800 600)) +;;; Hook definitions +;;; +;;; A hook is a function, a symbol or a list of functions with a rest +;;; arguments. +;;; +;;; This hooks are set in clfswm.lisp, you can overwrite them or extend +;;; them with a hook list. +;;; +;;; See clfswm.lisp for hooks examples. + +(defun default-init-hook () + (let ((frame (add-frame (create-frame :name "Default" + :layout nil :x 0.05 :y 0.05 + :w 0.9 :h 0.9) *root-frame*))) + (setf *current-child* frame))) + +(defparameter *init-hook* 'default-init-hook + "Init hook. This hook is run just after the first root frame is created") + +(defparameter *default-nw-hook* 'default-frame-nw-hook + "Default action to do on newly created windows") + + + + ;;; CONFIG (defparameter *create-frame-on-root* nil "Set this variable to true if you want to allow to create a new frame -on root window in the main mode") +on the root window in the main mode with the mouse") ;;; CONFIG: Main mode colors Modified: clfswm/src/package.lisp ============================================================================== --- clfswm/src/package.lisp (original) +++ clfswm/src/package.lisp Fri Apr 25 11:27:20 2008 @@ -117,27 +117,6 @@ "Arrow action in the second mode") - -;;; Hook definitions -;;; -;;; A hook is a function, a symbol or a list of functions with a rest -;;; arguments. -;;; -;;; This hooks are set in clfswm.lisp, you can overwrite them or extend -;;; them with a hook list. -;;; -;;; See clfswm.lisp for hooks examples. - -;;; Init hook. This hook is run just after the first root frame is created -(defun default-init-hook () - (let ((frame (add-frame (create-frame :name "Default" - :layout nil :x 0.05 :y 0.05 - :w 0.9 :h 0.9) *root-frame*))) - (setf *current-child* frame))) - -(defparameter *init-hook* #'default-init-hook) - - ;;; Main mode hooks (set in clfswm.lisp) (defparameter *button-press-hook* nil) (defparameter *button-release-hook* nil) Modified: clfswm/src/tools.lisp ============================================================================== --- clfswm/src/tools.lisp (original) +++ clfswm/src/tools.lisp Fri Apr 25 11:27:20 2008 @@ -198,7 +198,7 @@ (defun ensure-printable (string &optional (new #\?)) "Ensure a string is printable in ascii" - (substitute-if-not new #'standard-char-p string)) + (or (substitute-if-not new #'standard-char-p (or string "")) "")) (defun ensure-n-elems (list n) From pbrochard at common-lisp.net Fri Apr 25 19:28:57 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 15:28:57 -0400 (EDT) Subject: [clfswm-cvs] r85 - in clfswm: . src Message-ID: <20080425192857.42DFA3D005@common-lisp.net> Author: pbrochard Date: Fri Apr 25 15:28:53 2008 New Revision: 85 Modified: clfswm/ChangeLog clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-layout.lisp clfswm/src/clfswm-nw-hooks.lisp clfswm/src/clfswm-pack.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp Log: src/*.lisp: Rename all 'father' occurrences to 'parent'. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 15:28:53 2008 @@ -1,5 +1,7 @@ 2008-04-25 Philippe Brochard + * src/*.lisp: Rename all 'father' occurrences to 'parent'. + * src/clfswm-nw-hooks.lisp (open-in-new-frame-in-parent-frame-nw-hook): New new window hook. Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Fri Apr 25 15:28:53 2008 @@ -333,7 +333,7 @@ (defun sm-mouse-leave-frame (window root-x root-y) - "Leave the selected frame - ie make its father the root frame" + "Leave the selected frame - ie make its parent the root frame" (declare (ignore window root-x root-y)) (leave-frame)) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Fri Apr 25 15:28:53 2008 @@ -28,38 +28,38 @@ ;;; Conversion functions ;;; Float -> Pixel conversion -(defun x-fl->px (x father) +(defun x-fl->px (x parent) "Convert float X coordinate to pixel" - (round (+ (* x (frame-rw father)) (frame-rx father)))) + (round (+ (* x (frame-rw parent)) (frame-rx parent)))) -(defun y-fl->px (y father) +(defun y-fl->px (y parent) "Convert float Y coordinate to pixel" - (round (+ (* y (frame-rh father)) (frame-ry father)))) + (round (+ (* y (frame-rh parent)) (frame-ry parent)))) -(defun w-fl->px (w father) +(defun w-fl->px (w parent) "Convert float Width coordinate to pixel" - (round (* w (frame-rw father)))) + (round (* w (frame-rw parent)))) -(defun h-fl->px (h father) +(defun h-fl->px (h parent) "Convert float Height coordinate to pixel" - (round (* h (frame-rh father)))) + (round (* h (frame-rh parent)))) ;;; Pixel -> Float conversion -(defun x-px->fl (x father) +(defun x-px->fl (x parent) "Convert pixel X coordinate to float" - (/ (- x (frame-rx father)) (frame-rw father))) + (/ (- x (frame-rx parent)) (frame-rw parent))) -(defun y-px->fl (y father) +(defun y-px->fl (y parent) "Convert pixel Y coordinate to float" - (/ (- y (frame-ry father)) (frame-rh father))) + (/ (- y (frame-ry parent)) (frame-rh parent))) -(defun w-px->fl (w father) +(defun w-px->fl (w parent) "Convert pixel Width coordinate to float" - (/ w (frame-rw father))) + (/ w (frame-rw parent))) -(defun h-px->fl (h father) +(defun h-px->fl (h parent) "Convert pixel Height coordinate to float" - (/ h (frame-rh father))) + (/ h (frame-rh parent))) @@ -220,31 +220,31 @@ -(defun add-frame (frame father) - (push frame (frame-child father)) +(defun add-frame (frame parent) + (push frame (frame-child parent)) frame) -(defun place-frame (frame father prx pry prw prh) +(defun place-frame (frame parent prx pry prw prh) "Place a frame from real (pixel) coordinates" (with-slots (window x y w h) frame (setf (xlib:drawable-x window) prx (xlib:drawable-y window) pry (xlib:drawable-width window) prw (xlib:drawable-height window) prh - x (x-px->fl prx father) - y (y-px->fl pry father) - w (w-px->fl prw father) - h (h-px->fl prh father)))) + x (x-px->fl prx parent) + y (y-px->fl pry parent) + w (w-px->fl prw parent) + h (h-px->fl prh parent)))) -(defun fixe-real-size (frame father) +(defun fixe-real-size (frame parent) "Fixe real (pixel) coordinates in float coordinates" (when (frame-p frame) (with-slots (x y w h rx ry rw rh) frame - (setf x (x-px->fl rx father) - y (y-px->fl ry father) - w (w-px->fl rw father) - h (h-px->fl rh father))))) + (setf x (x-px->fl rx parent) + y (y-px->fl ry parent) + w (w-px->fl rw parent) + h (h-px->fl rh parent))))) (defun fixe-real-size-current-child () "Fixe real (pixel) coordinates in float coordinates for children in the current child" @@ -264,11 +264,11 @@ -(defun find-father-frame (to-find &optional (root *root-frame*)) - "Return the father frame of to-find" +(defun find-parent-frame (to-find &optional (root *root-frame*)) + "Return the parent frame of to-find" (with-all-frames (root frame) (when (member to-find (frame-child frame)) - (return-from find-father-frame frame)))) + (return-from find-parent-frame frame)))) @@ -353,22 +353,22 @@ -(defun get-father-layout (child father) - (if (frame-p father) - (aif (frame-layout father) - (funcall it child father) - (no-layout child father)) +(defun get-parent-layout (child parent) + (if (frame-p parent) + (aif (frame-layout parent) + (funcall it child parent) + (no-layout child parent)) (get-fullscreen-size))) -(defgeneric adapt-child-to-father (child father)) +(defgeneric adapt-child-to-parent (child parent)) -(defmethod adapt-child-to-father ((window xlib:window) father) +(defmethod adapt-child-to-parent ((window xlib:window) parent) (with-xlib-protect (if (eql (window-type window) :normal) (multiple-value-bind (nx ny nw nh raise-p) - (get-father-layout window father) + (get-parent-layout window parent) (setf nw (max nw 1) nh (max nh 1)) (let ((change (or (/= (xlib:drawable-x window) nx) (/= (xlib:drawable-y window) ny) @@ -381,23 +381,23 @@ (values raise-p change))) (values nil nil)))) -(defmethod adapt-child-to-father ((frame frame) father) +(defmethod adapt-child-to-parent ((frame frame) parent) (with-xlib-protect - (multiple-value-bind (nx ny nw nh raise-p) - (get-father-layout frame father) - (with-slots (rx ry rw rh window) frame - (setf rx nx ry ny - rw (max nw 1) - rh (max nh 1)) - (let ((change (or (/= (xlib:drawable-x window) rx) - (/= (xlib:drawable-y window) ry) - (/= (xlib:drawable-width window) rw) - (/= (xlib:drawable-height window) rh)))) - (setf (xlib:drawable-x window) rx - (xlib:drawable-y window) ry - (xlib:drawable-width window) rw - (xlib:drawable-height window) rh) - (values raise-p change)))))) + (multiple-value-bind (nx ny nw nh raise-p) + (get-parent-layout frame parent) + (with-slots (rx ry rw rh window) frame + (setf rx nx ry ny + rw (max nw 1) + rh (max nh 1)) + (let ((change (or (/= (xlib:drawable-x window) rx) + (/= (xlib:drawable-y window) ry) + (/= (xlib:drawable-width window) rw) + (/= (xlib:drawable-height window) rh)))) + (setf (xlib:drawable-x window) rx + (xlib:drawable-y window) ry + (xlib:drawable-width window) rw + (xlib:drawable-height window) rh) + (values raise-p change)))))) @@ -412,26 +412,26 @@ (defmethod show-child ((frame frame) raise-p first-p) (with-xlib-protect - (with-slots (window) frame - (when (or *show-root-frame-p* (not (equal frame *current-root*))) - (setf (xlib:window-background window) (get-color "Black")) - (xlib:map-window window) - (raise-if-needed window raise-p first-p) - (display-frame-info frame))))) + (with-slots (window) frame + (when (or *show-root-frame-p* (not (equal frame *current-root*))) + (setf (xlib:window-background window) (get-color "Black")) + (xlib:map-window window) + (raise-if-needed window raise-p first-p) + (display-frame-info frame))))) (defmethod show-child ((window xlib:window) raise-p first-p) (with-xlib-protect - (xlib:map-window window) - (raise-if-needed window raise-p first-p))) + (xlib:map-window window) + (raise-if-needed window raise-p first-p))) (defgeneric hide-child (child)) (defmethod hide-child ((frame frame)) (with-xlib-protect - (with-slots (window) frame - (xlib:unmap-window window)))) + (with-slots (window) frame + (xlib:unmap-window window)))) (defmethod hide-child ((window xlib:window)) (hide-window window)) @@ -445,18 +445,18 @@ (defmethod select-child ((frame frame) selected) (with-xlib-protect - (when (and (frame-p frame) (frame-window frame)) - (setf (xlib:window-border (frame-window frame)) - (get-color (cond ((equal selected :maybe) *color-maybe-selected*) - ((equal selected nil) *color-unselected*) - (selected *color-selected*))))))) + (when (and (frame-p frame) (frame-window frame)) + (setf (xlib:window-border (frame-window frame)) + (get-color (cond ((equal selected :maybe) *color-maybe-selected*) + ((equal selected nil) *color-unselected*) + (selected *color-selected*))))))) (defmethod select-child ((window xlib:window) selected) (with-xlib-protect - (setf (xlib:window-border window) - (get-color (cond ((equal selected :maybe) *color-maybe-selected*) - ((equal selected nil) *color-unselected*) - (selected *color-selected*)))))) + (setf (xlib:window-border window) + (get-color (cond ((equal selected :maybe) *color-maybe-selected*) + ((equal selected nil) *color-unselected*) + (selected *color-selected*)))))) (defun select-current-frame (selected) (select-child *current-child* selected)) @@ -483,18 +483,18 @@ "Show all children from *current-root*. Start the effective display only for display-child and its children" (let ((geometry-change nil)) - (labels ((rec (root father first-p first-father display-p) + (labels ((rec (root parent first-p first-parent display-p) (multiple-value-bind (raise-p change) - (adapt-child-to-father root father) + (adapt-child-to-parent root parent) (when change (setf geometry-change change)) (when display-p (show-child root raise-p first-p))) (select-child root (if (equal root *current-child*) t - (if (and first-p first-father) :maybe nil))) + (if (and first-p first-parent) :maybe nil))) (when (frame-p root) (let ((first-child (first (frame-child root)))) (dolist (child (reverse (frame-child root))) - (rec child root (equal child first-child) (and first-p first-father) + (rec child root (equal child first-child) (and first-p first-parent) (or display-p (equal root display-child)))))))) (rec *current-root* nil t t (equal display-child *current-root*)) (set-focus-to-current-child) @@ -518,24 +518,24 @@ -(defun focus-child (child father) +(defun focus-child (child parent) "Focus child - Return true if something has change" - (when (and (frame-p father) - (member child (frame-child father))) - (when (not (equal child (first (frame-child father)))) - (loop until (equal child (first (frame-child father))) - do (setf (frame-child father) (rotate-list (frame-child father)))) + (when (and (frame-p parent) + (member child (frame-child parent))) + (when (not (equal child (first (frame-child parent)))) + (loop until (equal child (first (frame-child parent))) + do (setf (frame-child parent) (rotate-list (frame-child parent)))) t))) -(defun focus-child-rec (child father) - "Focus child and its fathers - Return true if something has change" +(defun focus-child-rec (child parent) + "Focus child and its parents - Return true if something has change" (let ((change nil)) - (labels ((rec (child father) - (when (focus-child child father) + (labels ((rec (child parent) + (when (focus-child child parent) (setf change t)) - (when father - (rec father (find-father-frame father))))) - (rec child father)) + (when parent + (rec parent (find-parent-frame parent))))) + (rec child parent)) change)) @@ -544,28 +544,28 @@ (setf *current-child* child) t)) -(defgeneric set-current-child (child father window-father)) +(defgeneric set-current-child (child parent window-parent)) -(defmethod set-current-child ((child xlib:window) father window-father) - (set-current-child-generic (if window-father father child))) +(defmethod set-current-child ((child xlib:window) parent window-parent) + (set-current-child-generic (if window-parent parent child))) -(defmethod set-current-child ((child frame) father window-father) - (declare (ignore father window-father)) +(defmethod set-current-child ((child frame) parent window-parent) + (declare (ignore parent window-parent)) (set-current-child-generic child)) -(defun set-current-root (father) - "Set current root if father is not in current root" - (unless (find-child father *current-root*) - (setf *current-root* father))) +(defun set-current-root (parent) + "Set current root if parent is not in current root" + (unless (find-child parent *current-root*) + (setf *current-root* parent))) -(defun focus-all-children (child father &optional (window-father t)) - "Focus child and its fathers - -For window: set current child to window or its father according to window-father" - (let ((new-focus (focus-child-rec child father)) - (new-current-child (set-current-child child father window-father)) - (new-root (set-current-root father))) +(defun focus-all-children (child parent &optional (window-parent t)) + "Focus child and its parents - +For window: set current child to window or its parent according to window-parent" + (let ((new-focus (focus-child-rec child parent)) + (new-current-child (set-current-child child parent window-parent)) + (new-root (set-current-root parent))) (or new-focus new-current-child new-root))) @@ -580,9 +580,9 @@ (if frame-is-root? (hide-all *current-root*) (select-current-frame nil)) - (let ((father (find-father-frame *current-child*))) - (when (frame-p father) - (with-slots (child) father + (let ((parent (find-parent-frame *current-child*))) + (when (frame-p parent) + (with-slots (child) parent (setf child (funcall fun-rotate child)) (setf *current-child* (first child))))) (when frame-is-root? @@ -604,15 +604,15 @@ (select-current-frame :maybe) (when (frame-p *current-child*) (awhen (first (frame-child *current-child*)) - (setf *current-child* it))) + (setf *current-child* it))) (select-current-frame t)) (defun select-previous-level () "Select the previous level in frame" (unless (equal *current-child* *current-root*) (select-current-frame :maybe) - (awhen (find-father-frame *current-child*) - (setf *current-child* it)) + (awhen (find-parent-frame *current-child*) + (setf *current-child* it)) (select-current-frame t))) @@ -643,11 +643,11 @@ (show-all-children *current-root*)) (defun leave-frame () - "Leave the selected frame - ie make its father the root frame" + "Leave the selected frame - ie make its parent the root frame" (hide-all *current-root*) - (awhen (find-father-frame *current-root*) - (when (frame-p it) - (setf *current-root* it))) + (awhen (find-parent-frame *current-root*) + (when (frame-p it) + (setf *current-root* it))) (show-all-children *current-root*)) @@ -691,7 +691,7 @@ (defun remove-child-in-all-frames (child) "Remove child in all frames from *root-frame*" (when (equal child *current-root*) - (setf *current-root* (find-father-frame child))) + (setf *current-root* (find-parent-frame child))) (when (equal child *current-child*) (setf *current-child* *current-root*)) (remove-child-in-frames child *root-frame*)) Modified: clfswm/src/clfswm-layout.lisp ============================================================================== --- clfswm/src/clfswm-layout.lisp (original) +++ clfswm/src/clfswm-layout.lisp Fri Apr 25 15:28:53 2008 @@ -53,12 +53,12 @@ (setf (frame-layout *current-child*) layout))) -(defun get-managed-child (father) +(defun get-managed-child (parent) "Return only window in normal mode who can be tiled" - (when (frame-p father) + (when (frame-p parent) (remove-if #'(lambda (x) (and (xlib:window-p x) (not (eql (window-type x) :normal)))) - (frame-child father)))) + (frame-child parent)))) @@ -90,22 +90,22 @@ ;;; No layout -(defgeneric no-layout (child father) +(defgeneric no-layout (child parent) (:documentation "Maximize windows in there frame - leave frame to there size (no layout)")) -(defmethod no-layout ((child xlib:window) father) - (with-slots (rx ry rw rh) father +(defmethod no-layout ((child xlib:window) parent) + (with-slots (rx ry rw rh) parent (values (1+ rx) (1+ ry) (- rw 2) (- rh 2) :first-only))) -(defmethod no-layout ((child frame) father) - (values (x-fl->px (frame-x child) father) - (y-fl->px (frame-y child) father) - (w-fl->px (frame-w child) father) - (h-fl->px (frame-h child) father) +(defmethod no-layout ((child frame) parent) + (values (x-fl->px (frame-x child) parent) + (y-fl->px (frame-y child) parent) + (w-fl->px (frame-w child) parent) + (h-fl->px (frame-h child) parent) t)) @@ -120,18 +120,18 @@ ;;; Tile layout -(defgeneric tile-layout (child father) +(defgeneric tile-layout (child parent) (:documentation "Tile child in its frame")) -(defmethod tile-layout (child father) - (let* ((managed-children (get-managed-child father)) +(defmethod tile-layout (child parent) + (let* ((managed-children (get-managed-child parent)) (pos (position child managed-children)) (len (length managed-children)) (n (ceiling (sqrt len))) - (dx (/ (frame-rw father) n)) - (dy (/ (frame-rh father) (ceiling (/ len n))))) - (values (round (+ (frame-rx father) (truncate (* (mod pos n) dx)) 1)) - (round (+ (frame-ry father) (truncate (* (truncate (/ pos n)) dy)) 1)) + (dx (/ (frame-rw parent) n)) + (dy (/ (frame-rh parent) (ceiling (/ len n))))) + (values (round (+ (frame-rx parent) (truncate (* (mod pos n) dx)) 1)) + (round (+ (frame-ry parent) (truncate (* (truncate (/ pos n)) dy)) 1)) (round (- dx 2)) (round (- dy 2)) t))) @@ -144,27 +144,27 @@ ;;; Tile Left -(defgeneric tile-left-layout (child father) +(defgeneric tile-left-layout (child parent) (:documentation "Tile Left: main child on left and others on right")) -(defmethod tile-left-layout (child father) - (with-slots (rx ry rw rh) father - (let* ((managed-children (get-managed-child father)) +(defmethod tile-left-layout (child parent) + (with-slots (rx ry rw rh) parent + (let* ((managed-children (get-managed-child parent)) (pos (position child managed-children)) (len (max (1- (length managed-children)) 1)) (dy (/ rh len)) - (size (or (frame-data-slot father :tile-size) 0.8))) - (if (= pos 0) - (values (1+ rx) - (1+ ry) - (- (round (* rw size)) 2) - (- rh 2) - t) - (values (1+ (round (+ rx (* rw size)))) - (1+ (round (+ ry (* dy (1- pos))))) - (- (round (* rw (- 1 size))) 2) - (- (round dy) 2) - t))))) + (size (or (frame-data-slot parent :tile-size) 0.8))) + (if (= pos 0) + (values (1+ rx) + (1+ ry) + (- (round (* rw size)) 2) + (- rh 2) + t) + (values (1+ (round (+ rx (* rw size)))) + (1+ (round (+ ry (* dy (1- pos))))) + (- (round (* rw (- 1 size))) 2) + (- (round dy) 2) + t))))) (defun set-tile-left-layout () @@ -177,16 +177,16 @@ ;;; Tile right -(defgeneric tile-right-layout (child father) +(defgeneric tile-right-layout (child parent) (:documentation "Tile Right: main child on right and others on left")) -(defmethod tile-right-layout (child father) - (with-slots (rx ry rw rh) father - (let* ((managed-children (get-managed-child father)) +(defmethod tile-right-layout (child parent) + (with-slots (rx ry rw rh) parent + (let* ((managed-children (get-managed-child parent)) (pos (position child managed-children)) (len (max (1- (length managed-children)) 1)) (dy (/ rh len)) - (size (or (frame-data-slot father :tile-size) 0.8))) + (size (or (frame-data-slot parent :tile-size) 0.8))) (if (= pos 0) (values (1+ (round (+ rx (* rw (- 1 size))))) (1+ ry) @@ -212,27 +212,27 @@ ;;; Tile Top -(defgeneric tile-top-layout (child father) +(defgeneric tile-top-layout (child parent) (:documentation "Tile Top: main child on top and others on bottom")) -(defmethod tile-top-layout (child father) - (with-slots (rx ry rw rh) father - (let* ((managed-children (get-managed-child father)) +(defmethod tile-top-layout (child parent) + (with-slots (rx ry rw rh) parent + (let* ((managed-children (get-managed-child parent)) (pos (position child managed-children)) (len (max (1- (length managed-children)) 1)) (dx (/ rw len)) - (size (or (frame-data-slot father :tile-size) 0.8))) - (if (= pos 0) - (values (1+ rx) - (1+ ry) - (- rw 2) - (- (round (* rh size)) 2) - t) - (values (1+ (round (+ rx (* dx (1- pos))))) - (1+ (round (+ ry (* rh size)))) - (- (round dx) 2) - (- (round (* rh (- 1 size))) 2) - t))))) + (size (or (frame-data-slot parent :tile-size) 0.8))) + (if (= pos 0) + (values (1+ rx) + (1+ ry) + (- rw 2) + (- (round (* rh size)) 2) + t) + (values (1+ (round (+ rx (* dx (1- pos))))) + (1+ (round (+ ry (* rh size)))) + (- (round dx) 2) + (- (round (* rh (- 1 size))) 2) + t))))) (defun set-tile-top-layout () @@ -245,16 +245,16 @@ ;;; Tile Bottom -(defgeneric tile-bottom-layout (child father) +(defgeneric tile-bottom-layout (child parent) (:documentation "Tile Bottom: main child on bottom and others on top")) -(defmethod tile-bottom-layout (child father) - (with-slots (rx ry rw rh) father - (let* ((managed-children (get-managed-child father)) +(defmethod tile-bottom-layout (child parent) + (with-slots (rx ry rw rh) parent + (let* ((managed-children (get-managed-child parent)) (pos (position child managed-children)) (len (max (1- (length managed-children)) 1)) (dx (/ rw len)) - (size (or (frame-data-slot father :tile-size) 0.8))) + (size (or (frame-data-slot parent :tile-size) 0.8))) (if (= pos 0) (values (1+ rx) (1+ (round (+ ry (* rh (- 1 size))))) @@ -282,18 +282,18 @@ ;;; Space layout -(defgeneric tile-space-layout (child father) +(defgeneric tile-space-layout (child parent) (:documentation "Tile Space: tile child in its frame leaving spaces between them")) -(defmethod tile-space-layout (child father) - (with-slots (rx ry rw rh) father - (let* ((managed-children (get-managed-child father)) +(defmethod tile-space-layout (child parent) + (with-slots (rx ry rw rh) parent + (let* ((managed-children (get-managed-child parent)) (pos (position child managed-children)) (len (length managed-children)) (n (ceiling (sqrt len))) (dx (/ rw n)) (dy (/ rh (ceiling (/ len n)))) - (size (or (frame-data-slot father :tile-space-size) 0.1))) + (size (or (frame-data-slot parent :tile-space-size) 0.1))) (when (> size 0.5) (setf size 0.45)) (values (round (+ rx (truncate (* (mod pos n) dx)) (* dx size) 1)) (round (+ ry (truncate (* (truncate (/ pos n)) dy)) (* dy size) 1)) Modified: clfswm/src/clfswm-nw-hooks.lisp ============================================================================== --- clfswm/src/clfswm-nw-hooks.lisp (original) +++ clfswm/src/clfswm-nw-hooks.lisp Fri Apr 25 15:28:53 2008 @@ -41,7 +41,7 @@ (defun set-nw-hook (hook) "Set the hook of the current child" (let ((frame (if (xlib:window-p *current-child*) - (find-father-frame *current-child*) + (find-parent-frame *current-child*) *current-child*))) (setf (frame-nw-hook frame) hook) (leave-second-mode))) @@ -52,7 +52,7 @@ (defun default-window-placement (frame window) (case (window-type window) - (:normal (adapt-child-to-father window frame)) + (:normal (adapt-child-to-parent window frame)) (t (place-window-from-hints window)))) (defun leave-if-not-frame (child) @@ -137,7 +137,7 @@ (defun open-in-new-frame-in-parent-frame-nw-hook (frame window) "Open the next window in a new frame in the parent frame" (let ((new-frame (create-frame)) - (parent (find-father-frame frame))) + (parent (find-parent-frame frame))) (when parent (pushnew new-frame (frame-child parent)) (pushnew window (frame-child new-frame)) Modified: clfswm/src/clfswm-pack.lisp ============================================================================== --- clfswm/src/clfswm-pack.lisp (original) +++ clfswm/src/clfswm-pack.lisp Fri Apr 25 15:28:53 2008 @@ -35,9 +35,9 @@ (+ (frame-y frame) (frame-h frame))) -(defun find-edge-up (current-frame father) +(defun find-edge-up (current-frame parent) (let ((y-found 0)) - (dolist (frame (frame-child father)) + (dolist (frame (frame-child parent)) (when (and (frame-p frame) (not (equal frame current-frame)) (<= (frame-y2 frame) (frame-y current-frame)) @@ -46,9 +46,9 @@ (setf y-found (max y-found (frame-y2 frame))))) y-found)) -(defun find-edge-down (current-frame father) +(defun find-edge-down (current-frame parent) (let ((y-found 1)) - (dolist (frame (frame-child father)) + (dolist (frame (frame-child parent)) (when (and (frame-p frame) (not (equal frame current-frame)) (>= (frame-y frame) (frame-y2 current-frame)) @@ -57,9 +57,9 @@ (setf y-found (min y-found (frame-y frame))))) y-found)) -(defun find-edge-right (current-frame father) +(defun find-edge-right (current-frame parent) (let ((x-found 1)) - (dolist (frame (frame-child father)) + (dolist (frame (frame-child parent)) (when (and (frame-p frame) (not (equal frame current-frame)) (>= (frame-x frame) (frame-x2 current-frame)) @@ -69,9 +69,9 @@ x-found)) -(defun find-edge-left (current-frame father) +(defun find-edge-left (current-frame parent) (let ((x-found 0)) - (dolist (frame (frame-child father)) + (dolist (frame (frame-child parent)) (when (and (frame-p frame) (not (equal frame current-frame)) (<= (frame-x2 frame) (frame-x current-frame)) @@ -85,26 +85,26 @@ ;;;,----- ;;;| Pack functions ;;;`----- -(defun pack-frame-up (frame father) +(defun pack-frame-up (frame parent) "Pack frame to up" - (let ((y-found (find-edge-up frame father))) + (let ((y-found (find-edge-up frame parent))) (setf (frame-y frame) y-found))) -(defun pack-frame-down (frame father) +(defun pack-frame-down (frame parent) "Pack frame to down" - (let ((y-found (find-edge-down frame father))) + (let ((y-found (find-edge-down frame parent))) (setf (frame-y frame) (- y-found (frame-h frame))))) -(defun pack-frame-right (frame father) +(defun pack-frame-right (frame parent) "Pack frame to right" - (let ((x-found (find-edge-right frame father))) + (let ((x-found (find-edge-right frame parent))) (setf (frame-x frame) (- x-found (frame-w frame))))) -(defun pack-frame-left (frame father) +(defun pack-frame-left (frame parent) "Pack frame to left" - (let ((x-found (find-edge-left frame father))) + (let ((x-found (find-edge-left frame parent))) (setf (frame-x frame) x-found))) @@ -117,30 +117,30 @@ ;;;,----- ;;;| Fill functions ;;;`----- -(defun fill-frame-up (frame father) +(defun fill-frame-up (frame parent) "Fill a frame up" - (let* ((y-found (find-edge-up frame father)) + (let* ((y-found (find-edge-up frame parent)) (dy (- (frame-y frame) y-found))) (setf (frame-y frame) y-found (frame-h frame) (+ (frame-h frame) dy)))) -(defun fill-frame-down (frame father) +(defun fill-frame-down (frame parent) "Fill a frame down" - (let* ((y-found (find-edge-down frame father)) + (let* ((y-found (find-edge-down frame parent)) (dy (- y-found (frame-y2 frame)))) (setf (frame-h frame) (+ (frame-h frame) dy)))) -(defun fill-frame-left (frame father) +(defun fill-frame-left (frame parent) "Fill a frame left" - (let* ((x-found (find-edge-left frame father)) + (let* ((x-found (find-edge-left frame parent)) (dx (- (frame-x frame) x-found))) (setf (frame-x frame) x-found (frame-w frame) (+ (frame-w frame) dx)))) -(defun fill-frame-right (frame father) +(defun fill-frame-right (frame parent) "Fill a frame rigth" - (let* ((x-found (find-edge-right frame father)) + (let* ((x-found (find-edge-right frame parent)) (dx (- x-found (frame-x2 frame)))) (setf (frame-w frame) (+ (frame-w frame) dx)))) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Fri Apr 25 15:28:53 2008 @@ -102,7 +102,7 @@ (when (and window (not (xlib:window-equal window *no-focus-window*))) (setf *current-child* *current-root*) (hide-child window) - (remove-child-in-frame window (find-father-frame window)) + (remove-child-in-frame window (find-parent-frame window)) (show-all-children)))) @@ -166,14 +166,14 @@ "Cut the current child to the selection" (copy-current-child) (hide-all *current-child*) - (remove-child-in-frame *current-child* (find-father-frame *current-child* *current-root*)) + (remove-child-in-frame *current-child* (find-parent-frame *current-child* *current-root*)) (setf *current-child* *current-root*) (show-all-children)) (defun remove-current-child () - "Remove the current child from its father frame" + "Remove the current child from its parent frame" (hide-all *current-child*) - (remove-child-in-frame *current-child* (find-father-frame *current-child* *current-root*)) + (remove-child-in-frame *current-child* (find-parent-frame *current-child* *current-root*)) (setf *current-child* *current-root*) (leave-second-mode)) @@ -181,7 +181,7 @@ (defun paste-selection-no-clear () "Paste the selection in the current frame - Do not clear the selection after paste" (let ((frame-dest (typecase *current-child* - (xlib:window (find-father-frame *current-child* *current-root*)) + (xlib:window (find-parent-frame *current-child* *current-root*)) (frame *current-child*)))) (when frame-dest (dolist (child *child-selection*) @@ -335,9 +335,9 @@ (defun focus-frame-by (frame) (when (frame-p frame) (hide-all *current-root*) - (focus-all-children frame (or (find-father-frame frame *current-root*) - (find-father-frame frame) - *root-frame*)) + (focus-all-children frame (or (find-parent-frame frame *current-root*) + (find-parent-frame frame) + *root-frame*)) (show-all-children *current-root*))) @@ -379,7 +379,7 @@ (setf *current-root* *root-frame*)) (when (equal frame *current-child*) (setf *current-child* *current-root*)) - (remove-child-in-frame frame (find-father-frame frame))) + (remove-child-in-frame frame (find-parent-frame frame))) (show-all-children *current-root*)) @@ -398,7 +398,7 @@ (defun move-current-child-by (child frame-dest) (when (and child (frame-p frame-dest)) (hide-all *current-root*) - (remove-child-in-frame child (find-father-frame child)) + (remove-child-in-frame child (find-parent-frame child)) (pushnew child (frame-child frame-dest)) (focus-all-children child frame-dest) (show-all-children *current-root*))) @@ -448,22 +448,22 @@ (defun force-window-in-frame () "Force the current window to move in the frame (Useful only for transient windows)" (when (xlib:window-p *current-child*) - (let ((father (find-father-frame *current-child*))) + (let ((parent (find-parent-frame *current-child*))) (with-xlib-protect - (setf (xlib:drawable-x *current-child*) (frame-rx father) - (xlib:drawable-y *current-child*) (frame-ry father))))) + (setf (xlib:drawable-x *current-child*) (frame-rx parent) + (xlib:drawable-y *current-child*) (frame-ry parent))))) (leave-second-mode)) (defun force-window-center-in-frame () "Force the current window to move in the center of the frame (Useful only for transient windows)" (when (xlib:window-p *current-child*) - (let ((father (find-father-frame *current-child*))) + (let ((parent (find-parent-frame *current-child*))) (with-xlib-protect - (setf (xlib:drawable-x *current-child*) (truncate (+ (frame-rx father) - (/ (- (frame-rw father) + (setf (xlib:drawable-x *current-child*) (truncate (+ (frame-rx parent) + (/ (- (frame-rw parent) (xlib:drawable-width *current-child*)) 2))) - (xlib:drawable-y *current-child*) (truncate (+ (frame-ry father) - (/ (- (frame-rh father) + (xlib:drawable-y *current-child*) (truncate (+ (frame-ry parent) + (/ (- (frame-rh parent) (xlib:drawable-height *current-child*)) 2))))))) (leave-second-mode)) @@ -496,7 +496,7 @@ ;;; Mouse utilities -(defun move-frame (frame father orig-x orig-y) +(defun move-frame (frame parent orig-x orig-y) (hide-all-children frame) (with-slots (window) frame (raise-window window) @@ -528,11 +528,11 @@ do (with-xlib-protect (xlib:display-finish-output *display*) (xlib:process-event *display* :handler #'handle-event)))) - (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) father) - (frame-y frame) (y-px->fl (xlib:drawable-y window) father)))))) + (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) + (frame-y frame) (y-px->fl (xlib:drawable-y window) parent)))))) -(defun resize-frame (frame father orig-x orig-y) +(defun resize-frame (frame parent orig-x orig-y) (hide-all-children frame) (with-slots (window) frame (raise-window window) @@ -569,34 +569,34 @@ do (with-xlib-protect (xlib:display-finish-output *display*) (xlib:process-event *display* :handler #'handle-event)))) - (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) father) - (frame-h frame) (h-px->fl (xlib:drawable-height window) father)))))) + (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) parent) + (frame-h frame) (h-px->fl (xlib:drawable-height window) parent)))))) (defun mouse-click-to-focus-generic (window root-x root-y mouse-fn) - "Focus the current frame or focus the current window father + "Focus the current frame or focus the current window parent mouse-fun is #'move-frame or #'resize-frame" (let ((to-replay t) (child window) - (father (find-father-frame window *current-root*)) + (parent (find-parent-frame window *current-root*)) (root-p (or (equal window *root*) (equal window (frame-window *current-root*))))) (when (or (not root-p) *create-frame-on-root*) - (unless father + (unless parent (if root-p (progn (setf child (create-frame) - father *current-root* + parent *current-root* mouse-fn #'resize-frame) - (place-frame child father root-x root-y 10 10) + (place-frame child parent root-x root-y 10 10) (xlib:map-window (frame-window child)) (pushnew child (frame-child *current-root*))) (setf child (find-frame-window window *current-root*) - father (find-father-frame child *current-root*))) + parent (find-parent-frame child *current-root*))) (when child - (funcall mouse-fn child father root-x root-y))) - (when (and child father (focus-all-children child father)) + (funcall mouse-fn child parent root-x root-y))) + (when (and child parent (focus-all-children child parent)) (when (show-all-children) (setf to-replay nil)))) (if to-replay @@ -604,34 +604,34 @@ (stop-button-event)))) (defun mouse-click-to-focus-and-move (window root-x root-y) - "Move and focus the current frame or focus the current window father" + "Move and focus the current frame or focus the current window parent" (mouse-click-to-focus-generic window root-x root-y #'move-frame)) (defun mouse-click-to-focus-and-resize (window root-x root-y) - "Resize and focus the current frame or focus the current window father" + "Resize and focus the current frame or focus the current window parent" (mouse-click-to-focus-generic window root-x root-y #'resize-frame)) -(defun mouse-focus-move/resize-generic (root-x root-y mouse-fn window-father) - "Focus the current frame or focus the current window father +(defun mouse-focus-move/resize-generic (root-x root-y mouse-fn window-parent) + "Focus the current frame or focus the current window parent mouse-fun is #'move-frame or #'resize-frame. -Focus child and its fathers - -For window: set current child to window or its father according to window-father" +Focus child and its parents - +For window: set current child to window or its parent according to window-parent" (let* ((child (find-child-under-mouse root-x root-y)) - (father (find-father-frame child))) + (parent (find-parent-frame child))) (when (equal child *current-root*) (setf child (create-frame) - father *current-root* + parent *current-root* mouse-fn #'resize-frame) - (place-frame child father root-x root-y 10 10) - (xlib:map-window (frame-window child)) - (pushnew child (frame-child *current-root*))) + (place-frame child parent root-x root-y 10 10) + (xlib:map-window (frame-window child)) + (pushnew child (frame-child *current-root*))) (typecase child - (xlib:window (funcall mouse-fn father (find-father-frame father) root-x root-y)) - (frame (funcall mouse-fn child father root-x root-y))) - (focus-all-children child father window-father) + (xlib:window (funcall mouse-fn parent (find-parent-frame parent) root-x root-y)) + (frame (funcall mouse-fn child parent root-x root-y))) + (focus-all-children child parent window-parent) (show-all-children))) @@ -674,7 +674,7 @@ (defun mouse-leave-frame (window root-x root-y) - "Leave the selected frame - ie make its father the root frame" + "Leave the selected frame - ie make its parent the root frame" (declare (ignore root-x root-y)) (let ((frame (find-frame-window window))) (when (or frame (xlib:window-equal window *root*)) @@ -732,10 +732,10 @@ ("BackSpace" remove-binding-on-slot ,(format nil "Remove slot ~A binding on child: ~A" n (child-fullname *current-child*))) (" - " nil " -") - ("Tab" jump-to-slot - ,(format nil "Jump to child: ~A" (aif (aref key-slots current-slot) - (child-fullname it) - "Not set - Please, bind it with Return")))) + ("Tab" jump-to-slot + ,(format nil "Jump to child: ~A" (aif (aref key-slots current-slot) + (child-fullname it) + "Not set - Please, bind it with Return")))) (list default-bind)))))) @@ -754,19 +754,19 @@ ;;; Pack (defun current-frame-pack-up () "Pack the current frame up" - (with-movement (pack-frame-up *current-child* (find-father-frame *current-child* *current-root*)))) + (with-movement (pack-frame-up *current-child* (find-parent-frame *current-child* *current-root*)))) (defun current-frame-pack-down () "Pack the current frame down" - (with-movement (pack-frame-down *current-child* (find-father-frame *current-child* *current-root*)))) + (with-movement (pack-frame-down *current-child* (find-parent-frame *current-child* *current-root*)))) (defun current-frame-pack-left () "Pack the current frame left" - (with-movement (pack-frame-left *current-child* (find-father-frame *current-child* *current-root*)))) + (with-movement (pack-frame-left *current-child* (find-parent-frame *current-child* *current-root*)))) (defun current-frame-pack-right () "Pack the current frame right" - (with-movement (pack-frame-right *current-child* (find-father-frame *current-child* *current-root*)))) + (with-movement (pack-frame-right *current-child* (find-parent-frame *current-child* *current-root*)))) ;;; Center (defun center-current-frame () @@ -776,42 +776,42 @@ ;;; Fill (defun current-frame-fill-up () "Fill the current frame up" - (with-movement (fill-frame-up *current-child* (find-father-frame *current-child* *current-root*)))) + (with-movement (fill-frame-up *current-child* (find-parent-frame *current-child* *current-root*)))) (defun current-frame-fill-down () "Fill the current frame down" - (with-movement (fill-frame-down *current-child* (find-father-frame *current-child* *current-root*)))) + (with-movement (fill-frame-down *current-child* (find-parent-frame *current-child* *current-root*)))) (defun current-frame-fill-left () "Fill the current frame left" - (with-movement (fill-frame-left *current-child* (find-father-frame *current-child* *current-root*)))) + (with-movement (fill-frame-left *current-child* (find-parent-frame *current-child* *current-root*)))) (defun current-frame-fill-right () "Fill the current frame right" - (with-movement (fill-frame-right *current-child* (find-father-frame *current-child* *current-root*)))) + (with-movement (fill-frame-right *current-child* (find-parent-frame *current-child* *current-root*)))) (defun current-frame-fill-all-dir () "Fill the current frame in all directions" (with-movement - (let ((father (find-father-frame *current-child* *current-root*))) - (fill-frame-up *current-child* father) - (fill-frame-down *current-child* father) - (fill-frame-left *current-child* father) - (fill-frame-right *current-child* father)))) + (let ((parent (find-parent-frame *current-child* *current-root*))) + (fill-frame-up *current-child* parent) + (fill-frame-down *current-child* parent) + (fill-frame-left *current-child* parent) + (fill-frame-right *current-child* parent)))) (defun current-frame-fill-vertical () "Fill the current frame vertically" (with-movement - (let ((father (find-father-frame *current-child* *current-root*))) - (fill-frame-up *current-child* father) - (fill-frame-down *current-child* father)))) + (let ((parent (find-parent-frame *current-child* *current-root*))) + (fill-frame-up *current-child* parent) + (fill-frame-down *current-child* parent)))) (defun current-frame-fill-horizontal () "Fill the current frame horizontally" (with-movement - (let ((father (find-father-frame *current-child* *current-root*))) - (fill-frame-left *current-child* father) - (fill-frame-right *current-child* father)))) + (let ((parent (find-parent-frame *current-child* *current-root*))) + (fill-frame-left *current-child* parent) + (fill-frame-right *current-child* parent)))) ;;; Resize @@ -854,7 +854,7 @@ (setf (frame-rw *current-child*) min-width)) (when (and height-p min-height) (setf (frame-rh *current-child*) min-height)) - (fixe-real-size *current-child* (find-father-frame *current-child*)) + (fixe-real-size *current-child* (find-parent-frame *current-child*)) (leave-second-mode)))))) (defun adapt-current-frame-to-window-hints () Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Fri Apr 25 15:28:53 2008 @@ -67,18 +67,18 @@ (when (has-h value-mask) (setf (xlib:drawable-height window) height)) (when (has-w value-mask) (setf (xlib:drawable-width window) width)))) (with-xlib-protect - (xlib:with-state (window) - (when (has-bw value-mask) - (setf (xlib:drawable-border-width window) border-width)) - (if (find-child window *current-root*) - (case (window-type window) - (:normal (adapt-child-to-father window (find-father-frame window *current-root*)) - (send-configuration-notify window)) - (t (adjust-from-request))) - (adjust-from-request)) - (when (has-stackmode value-mask) - (case stack-mode - (:above (raise-window window)))))))) + (xlib:with-state (window) + (when (has-bw value-mask) + (setf (xlib:drawable-border-width window) border-width)) + (if (find-child window *current-root*) + (case (window-type window) + (:normal (adapt-child-to-parent window (find-parent-frame window *current-root*)) + (send-configuration-notify window)) + (t (adjust-from-request))) + (adjust-from-request)) + (when (has-stackmode value-mask) + (case stack-mode + (:above (raise-window window)))))))) @@ -156,21 +156,21 @@ (declare (ignore display)) ;;(dbg event-key) (with-xlib-protect - (case event-key - (:button-press (call-hook *button-press-hook* event-slots)) - (:button-release (call-hook *button-release-hook* event-slots)) - (:motion-notify (call-hook *motion-notify-hook* event-slots)) - (:key-press (call-hook *key-press-hook* event-slots)) - (:configure-request (call-hook *configure-request-hook* event-slots)) - (:configure-notify (call-hook *configure-notify-hook* event-slots)) - (:map-request (call-hook *map-request-hook* event-slots)) - (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) - (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) - (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) - (:property-notify (call-hook *property-notify-hook* event-slots)) - (:create-notify (call-hook *create-notify-hook* event-slots)) - (:enter-notify (call-hook *enter-notify-hook* event-slots)) - (:exposure (call-hook *exposure-hook* event-slots)))) + (case event-key + (:button-press (call-hook *button-press-hook* event-slots)) + (:button-release (call-hook *button-release-hook* event-slots)) + (:motion-notify (call-hook *motion-notify-hook* event-slots)) + (:key-press (call-hook *key-press-hook* event-slots)) + (:configure-request (call-hook *configure-request-hook* event-slots)) + (:configure-notify (call-hook *configure-notify-hook* event-slots)) + (:map-request (call-hook *map-request-hook* event-slots)) + (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) + (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) + (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) + (:property-notify (call-hook *property-notify-hook* event-slots)) + (:create-notify (call-hook *create-notify-hook* event-slots)) + (:enter-notify (call-hook *enter-notify-hook* event-slots)) + (:exposure (call-hook *exposure-hook* event-slots)))) t) From pbrochard at common-lisp.net Fri Apr 25 21:45:06 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 17:45:06 -0400 (EDT) Subject: [clfswm-cvs] r86 - in clfswm: . src Message-ID: <20080425214506.9B89647001@common-lisp.net> Author: pbrochard Date: Fri Apr 25 17:45:03 2008 New Revision: 86 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-layout.lisp clfswm/src/clfswm-nw-hooks.lisp clfswm/src/clfswm-util.lisp clfswm/src/clfswm.lisp clfswm/src/config.lisp clfswm/src/package.lisp Log: Managed type: new frame parameter. This allow to choose what window type a frame must handle. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 17:45:03 2008 @@ -1,5 +1,18 @@ 2008-04-25 Philippe Brochard + * src/clfswm-util.lisp (current-frame-manage-window-type): Let the + user choose what window type the current frame must handle. + (display-current-window-info): New function. + (current-frame-manage-all-window-type) + (current-frame-manage-only-normal-window-type) + (current-frame-manage-no-window-type): New functions. + + * src/clfswm-internal.lisp (managed-window-p): New function. + + * src/package.lisp (frame): Managed type: new frame + parameter. This allow to choose what window type a frame must + handle. + * src/*.lisp: Rename all 'father' occurrences to 'parent'. * src/clfswm-nw-hooks.lisp Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Fri Apr 25 17:45:03 2008 @@ -7,7 +7,7 @@ =============== Should handle these soon. -- Add a frame parameter to choose what window type to handle. [Philippe] +- Allow to move/resize unmanaged windows [Philippe] - Move the autodoc in its own file (clfswm-autodoc.lisp) and make the autodoc for the menu system. @@ -24,8 +24,6 @@ - Add boundaries in the info window [Philippe] -- Allow to move/resize transient windows [Philippe] - MAYBE ===== Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Fri Apr 25 17:45:03 2008 @@ -89,6 +89,7 @@ (add-menu-key 'frame-menu "o" 'frame-layout-once-menu) (add-menu-key 'frame-menu "n" 'frame-nw-hook-menu) (add-sub-menu 'frame-menu "m" 'frame-movement-menu "Frame movement menu") +(add-sub-menu 'frame-menu "w" 'managed-window-menu "Managed window type menu") (add-sub-menu 'frame-menu "i" 'frame-info-menu "Frame info menu") (add-menu-key 'frame-menu "r" 'rename-current-child) (add-menu-key 'frame-menu "u" 'renumber-current-frame) @@ -127,17 +128,25 @@ (add-menu-key 'frame-resize-menu #\a 'current-frame-resize-all-dir-minimal) +(add-menu-key 'managed-window-menu "m" 'current-frame-manage-window-type) +(add-menu-key 'managed-window-menu "a" 'current-frame-manage-all-window-type) +(add-menu-key 'managed-window-menu "n" 'current-frame-manage-only-normal-window-type) +(add-menu-key 'managed-window-menu "u" 'current-frame-manage-no-window-type) + + (add-menu-key 'frame-info-menu "s" 'show-all-frames-info) (add-menu-key 'frame-info-menu "h" 'hide-all-frames-info) -(add-menu-key 'window-menu "i" 'force-window-in-frame) +(add-menu-key 'window-menu "i" 'display-current-window-info) +(add-menu-key 'window-menu "f" 'force-window-in-frame) (add-menu-key 'window-menu "c" 'force-window-center-in-frame) (add-menu-key 'window-menu "a" 'adapt-current-frame-to-window-hints) (add-menu-key 'window-menu "w" 'adapt-current-frame-to-window-width-hint) (add-menu-key 'window-menu "h" 'adapt-current-frame-to-window-height-hint) + (add-menu-key 'selection-menu "x" 'cut-current-child) (add-menu-key 'selection-menu "c" 'copy-current-child) (add-menu-key 'selection-menu "v" 'paste-selection) @@ -171,6 +180,10 @@ "Open the frame menu" (open-menu (find-menu 'frame-menu))) +(defun open-window-menu () + "Open the window menu" + (open-menu (find-menu 'window-menu))) + (defun open-action-by-name-menu () "Open the action by name menu" (open-menu (find-menu 'action-by-name-menu))) @@ -182,6 +195,7 @@ (define-second-key ("m") 'open-menu) (define-second-key ("f") 'open-frame-menu) +(define-second-key ("w") 'open-window-menu) (define-second-key ("n") 'open-action-by-name-menu) (define-second-key ("u") 'open-action-by-number-menu) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Fri Apr 25 17:45:03 2008 @@ -94,6 +94,11 @@ (defsetf frame-data-slot set-frame-data-slot) +(defun managed-window-p (window frame) + "Return t only if window is managed by frame" + (or (member :all (frame-managed-type frame)) + (member (window-type window) (frame-managed-type frame)))) + @@ -366,7 +371,7 @@ (defmethod adapt-child-to-parent ((window xlib:window) parent) (with-xlib-protect - (if (eql (window-type window) :normal) + (if (managed-window-p window parent) (multiple-value-bind (nx ny nw nh raise-p) (get-parent-layout window parent) (setf nw (max nw 1) nh (max nh 1)) @@ -767,7 +772,7 @@ (eql win *no-focus-window*)) (when (or (eql map-state :viewable) (eql wm-state +iconic-state+)) - (format t "Processing ~S: type=~A ~S~%" (xlib:wm-name win) (window-type win)win) + (format t "Processing ~S: type=~A ~S~%" (xlib:wm-name win) (window-type win) win) (unhide-window win) (process-new-window win) (xlib:map-window win) Modified: clfswm/src/clfswm-layout.lisp ============================================================================== --- clfswm/src/clfswm-layout.lisp (original) +++ clfswm/src/clfswm-layout.lisp Fri Apr 25 17:45:03 2008 @@ -54,10 +54,10 @@ (defun get-managed-child (parent) - "Return only window in normal mode who can be tiled" + "Return only the windows that are managed for tiling" (when (frame-p parent) (remove-if #'(lambda (x) - (and (xlib:window-p x) (not (eql (window-type x) :normal)))) + (and (xlib:window-p x) (not (managed-window-p x parent)))) (frame-child parent)))) Modified: clfswm/src/clfswm-nw-hooks.lisp ============================================================================== --- clfswm/src/clfswm-nw-hooks.lisp (original) +++ clfswm/src/clfswm-nw-hooks.lisp Fri Apr 25 17:45:03 2008 @@ -51,9 +51,9 @@ (defun default-window-placement (frame window) - (case (window-type window) - (:normal (adapt-child-to-parent window frame)) - (t (place-window-from-hints window)))) + (if (managed-window-p window frame) + (adapt-child-to-parent window frame) + (place-window-from-hints window))) (defun leave-if-not-frame (child) "Leave the child if it's not a frame" Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Fri Apr 25 17:45:03 2008 @@ -868,3 +868,51 @@ (defun adapt-current-frame-to-window-height-hint () "Adapt the current frame to the current window minimal height hint" (adapt-current-frame-to-window-hints-generic nil t)) + + + + +;;; Managed window type functions +(defun current-frame-manage-window-type () + "Change window types to be managed by a frame" + (when (frame-p *current-child*) + (let* ((type-str (query-string "Managed window type: (all, normal, transient, maxsize, desktop, dock, toolbar, menu, utility, splash, dialog)" + (format nil "~{~:(~A~)~}" (frame-managed-type *current-child*)))) + (type-list (loop :for type :in (split-string type-str) + :collect (intern (string-upcase type) :keyword)))) + (setf (frame-managed-type *current-child*) type-list))) + (leave-second-mode)) + + +(defun current-frame-manage-window-type-generic (type-list) + (when (frame-p *current-child*) + (setf (frame-managed-type *current-child*) type-list)) + (leave-second-mode)) + +(defun current-frame-manage-all-window-type () + "Manage all window type" + (current-frame-manage-window-type-generic '(:all))) + +(defun current-frame-manage-only-normal-window-type () + "Manage only normal window type" + (current-frame-manage-window-type-generic '(:normal))) + +(defun current-frame-manage-no-window-type () + "Do not manage any window type" + (current-frame-manage-window-type-generic nil)) + + + + +(defun display-current-window-info () + "Display information on the current window" + (let ((window (typecase *current-child* + (xlib:window *current-child*) + (frame (first (frame-child *current-child*)))))) + (when window + (info-mode (list (format nil "Window: ~A" window) + (format nil "Window name: ~A" (xlib:wm-name window)) + (format nil "Window class: ~A" (xlib:get-wm-class window)) + (format nil "Window type: ~:(~A~)" (window-type window)))))) + (leave-second-mode)) + Modified: clfswm/src/clfswm.lisp ============================================================================== --- clfswm/src/clfswm.lisp (original) +++ clfswm/src/clfswm.lisp Fri Apr 25 17:45:03 2008 @@ -71,10 +71,12 @@ (when (has-bw value-mask) (setf (xlib:drawable-border-width window) border-width)) (if (find-child window *current-root*) - (case (window-type window) - (:normal (adapt-child-to-parent window (find-parent-frame window *current-root*)) - (send-configuration-notify window)) - (t (adjust-from-request))) + (let ((parent (find-parent-frame window *current-root*))) + (if (and parent (managed-window-p window parent)) + (progn + (adapt-child-to-parent window parent) + (send-configuration-notify window)) + (adjust-from-request))) (adjust-from-request)) (when (has-stackmode value-mask) (case stack-mode Modified: clfswm/src/config.lisp ============================================================================== --- clfswm/src/config.lisp (original) +++ clfswm/src/config.lisp Fri Apr 25 17:45:03 2008 @@ -47,6 +47,7 @@ ;; (values 100 100 800 600)) + ;;; Hook definitions ;;; ;;; A hook is a function, a symbol or a list of functions with a rest Modified: clfswm/src/package.lisp ============================================================================== --- clfswm/src/package.lisp (original) +++ clfswm/src/package.lisp Fri Apr 25 17:45:03 2008 @@ -60,6 +60,15 @@ (defparameter *default-frame-data* (list '(:tile-size 0.8) '(:tile-space-size 0.1))) + +;;; CONFIG - Default managed window type for a frame +;;; type can be :all, :normal, :transient, :maxsize, :desktop, :dock, :toolbar, :menu, :utility, :splash, :dialog +(defparameter *default-managed-type* '(:normal)) +;;(defparameter *default-managed-type* '(:normal :maxsize :transient)) +;;(defparameter *default-managed-type* '(:normal :transient :maxsize :desktop :dock :toolbar :menu :utility :splash :dialog)) +;;(defparameter *default-managed-type* '()) +;;(defparameter *default-managed-type* '(:all)) + (defclass frame () ((name :initarg :name :accessor frame-name :initform nil) (number :initarg :number :accessor frame-number :initform 0) @@ -74,9 +83,13 @@ (ry :initarg :ry :accessor frame-ry :initform 0) (rw :initarg :rw :accessor frame-rw :initform 800) (rh :initarg :rh :accessor frame-rh :initform 600) - (layout :initarg :layout :accessor frame-layout :initform nil) + (layout :initarg :layout :accessor frame-layout :initform nil + :documentation "Layout to display windows on a frame") (nw-hook :initarg :nw-hook :accessor frame-nw-hook :initform nil - :documentation "Hook done by the frame when a new window is mapped") + :documentation "Hook done by the frame when a new window is mapped") + (managed-type :initarg :managed-type :accessor frame-managed-type + :initform *default-managed-type* + :documentation "Managed window type") (window :initarg :window :accessor frame-window :initform nil) (gc :initarg :gc :accessor frame-gc :initform nil) (child :initarg :child :accessor frame-child :initform nil) From pbrochard at common-lisp.net Fri Apr 25 22:46:22 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 18:46:22 -0400 (EDT) Subject: [clfswm-cvs] r87 - clfswm Message-ID: <20080425224622.7C14512063@common-lisp.net> Author: pbrochard Date: Fri Apr 25 18:46:21 2008 New Revision: 87 Modified: clfswm/TODO Log: A git test Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Fri Apr 25 18:46:21 2008 @@ -1,3 +1,5 @@ +A git test + This file contains suggestions for further work. Feel free to edit the wiki at http://trac.common-lisp.net/clfswm/wiki if you want something in clfswm. From pbrochard at common-lisp.net Fri Apr 25 22:49:51 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 18:49:51 -0400 (EDT) Subject: [clfswm-cvs] r88 - clfswm Message-ID: <20080425224951.B9343330E2@common-lisp.net> Author: pbrochard Date: Fri Apr 25 18:49:51 2008 New Revision: 88 Modified: clfswm/TODO Log: Another git test Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Fri Apr 25 18:49:51 2008 @@ -1,5 +1,3 @@ -A git test - This file contains suggestions for further work. Feel free to edit the wiki at http://trac.common-lisp.net/clfswm/wiki if you want something in clfswm. From pbrochard at common-lisp.net Fri Apr 25 22:55:44 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 18:55:44 -0400 (EDT) Subject: [clfswm-cvs] r89 - clfswm Message-ID: <20080425225544.7EC703A005@common-lisp.net> Author: pbrochard Date: Fri Apr 25 18:55:44 2008 New Revision: 89 Modified: clfswm/ChangeLog Log: Another test Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 18:55:44 2008 @@ -1,3 +1,5 @@ +A git test + 2008-04-25 Philippe Brochard * src/clfswm-util.lisp (current-frame-manage-window-type): Let the From pbrochard at common-lisp.net Fri Apr 25 22:57:08 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 18:57:08 -0400 (EDT) Subject: [clfswm-cvs] r90 - clfswm Message-ID: <20080425225708.CFCD03A005@common-lisp.net> Author: pbrochard Date: Fri Apr 25 18:57:08 2008 New Revision: 90 Modified: clfswm/ChangeLog Log: Another test... Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 18:57:08 2008 @@ -1,5 +1,3 @@ -A git test - 2008-04-25 Philippe Brochard * src/clfswm-util.lisp (current-frame-manage-window-type): Let the From pbrochard at common-lisp.net Fri Apr 25 23:15:27 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 19:15:27 -0400 (EDT) Subject: [clfswm-cvs] r91 - clfswm Message-ID: <20080425231527.DCB036F0DB@common-lisp.net> Author: pbrochard Date: Fri Apr 25 19:15:27 2008 New Revision: 91 Modified: clfswm/ChangeLog Log: And another git test Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 19:15:27 2008 @@ -1,3 +1,5 @@ +Another test + 2008-04-25 Philippe Brochard * src/clfswm-util.lisp (current-frame-manage-window-type): Let the From pbrochard at common-lisp.net Fri Apr 25 23:16:50 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 19:16:50 -0400 (EDT) Subject: [clfswm-cvs] r92 - clfswm Message-ID: <20080425231650.2AD856F0DB@common-lisp.net> Author: pbrochard Date: Fri Apr 25 19:16:49 2008 New Revision: 92 Modified: clfswm/ChangeLog Log: Another test.. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 19:16:49 2008 @@ -1,5 +1,3 @@ -Another test - 2008-04-25 Philippe Brochard * src/clfswm-util.lisp (current-frame-manage-window-type): Let the From pbrochard at common-lisp.net Fri Apr 25 23:24:07 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 19:24:07 -0400 (EDT) Subject: [clfswm-cvs] r93 - clfswm Message-ID: <20080425232407.8316270315@common-lisp.net> Author: pbrochard Date: Fri Apr 25 19:24:07 2008 New Revision: 93 Modified: clfswm/ChangeLog Log: A test of svn Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 19:24:07 2008 @@ -1,3 +1,5 @@ +A test + 2008-04-25 Philippe Brochard * src/clfswm-util.lisp (current-frame-manage-window-type): Let the From pbrochard at common-lisp.net Fri Apr 25 23:24:57 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Fri, 25 Apr 2008 19:24:57 -0400 (EDT) Subject: [clfswm-cvs] r94 - clfswm Message-ID: <20080425232457.BABD370315@common-lisp.net> Author: pbrochard Date: Fri Apr 25 19:24:57 2008 New Revision: 94 Modified: clfswm/ChangeLog Log: Final git/svn test? Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Fri Apr 25 19:24:57 2008 @@ -1,5 +1,3 @@ -A test - 2008-04-25 Philippe Brochard * src/clfswm-util.lisp (current-frame-manage-window-type): Let the From pbrochard at common-lisp.net Sun Apr 27 09:18:14 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sun, 27 Apr 2008 05:18:14 -0400 (EDT) Subject: [clfswm-cvs] r95 - clfswm Message-ID: <20080427091814.724E27E0AB@common-lisp.net> Author: pbrochard Date: Sun Apr 27 05:18:12 2008 New Revision: 95 Modified: clfswm/TODO Log: New TODO things Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Sun Apr 27 05:18:12 2008 @@ -7,7 +7,15 @@ =============== Should handle these soon. -- Allow to move/resize unmanaged windows [Philippe] +- Allow to move/resize unmanaged windows (Alt+button 1/3) [Philippe] + +- forced-managed-window/forced-unmanaged-window: new frame parameter [Philippe] + +- Move window over frame (Alt+Control+B1) [Philippe] + + +LESS URGENT TODO +================ - Move the autodoc in its own file (clfswm-autodoc.lisp) and make the autodoc for the menu system. From pbrochard at common-lisp.net Sun Apr 27 11:34:37 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sun, 27 Apr 2008 07:34:37 -0400 (EDT) Subject: [clfswm-cvs] r96 - clfswm Message-ID: <20080427113437.40DFD81000@common-lisp.net> Author: pbrochard Date: Sun Apr 27 07:34:36 2008 New Revision: 96 Modified: clfswm/TODO Log: test of svn and git Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Sun Apr 27 07:34:36 2008 @@ -1,3 +1,5 @@ +Tis is another test of svn and git + This file contains suggestions for further work. Feel free to edit the wiki at http://trac.common-lisp.net/clfswm/wiki if you want something in clfswm. From pbrochard at common-lisp.net Sun Apr 27 11:36:50 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sun, 27 Apr 2008 07:36:50 -0400 (EDT) Subject: [clfswm-cvs] r97 - clfswm Message-ID: <20080427113650.CCAC23154@common-lisp.net> Author: pbrochard Date: Sun Apr 27 07:36:50 2008 New Revision: 97 Modified: clfswm/TODO Log: test of svn and git Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Sun Apr 27 07:36:50 2008 @@ -1,5 +1,3 @@ -Tis is another test of svn and git - This file contains suggestions for further work. Feel free to edit the wiki at http://trac.common-lisp.net/clfswm/wiki if you want something in clfswm. From pbrochard at common-lisp.net Sun Apr 27 21:30:09 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sun, 27 Apr 2008 17:30:09 -0400 (EDT) Subject: [clfswm-cvs] r98 - in clfswm: . src Message-ID: <20080427213009.35B8B13064@common-lisp.net> Author: pbrochard Date: Sun Apr 27 17:30:08 2008 New Revision: 98 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/clfswm-util.lisp clfswm/src/xlib-util.lisp Log: Unmanaged windows are now allowed to be moved or resized. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sun Apr 27 17:30:08 2008 @@ -1,3 +1,10 @@ +2008-04-27 Philippe Brochard + + * src/clfswm-util.lisp (mouse-focus-move/resize-generic): Allow to + move/resize unmanaged windows. + + * src/xlib-util.lisp (move-window, resize-window): New functions. + 2008-04-25 Philippe Brochard * src/clfswm-util.lisp (current-frame-manage-window-type): Let the Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Sun Apr 27 17:30:08 2008 @@ -7,13 +7,10 @@ =============== Should handle these soon. -- Allow to move/resize unmanaged windows (Alt+button 1/3) [Philippe] - - forced-managed-window/forced-unmanaged-window: new frame parameter [Philippe] - Move window over frame (Alt+Control+B1) [Philippe] - LESS URGENT TODO ================ @@ -32,6 +29,7 @@ - Add boundaries in the info window [Philippe] +- Show unmanaged windows only for *current-child* [Philippe] MAYBE ===== Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Sun Apr 27 17:30:08 2008 @@ -497,80 +497,21 @@ ;;; Mouse utilities (defun move-frame (frame parent orig-x orig-y) - (hide-all-children frame) - (with-slots (window) frame - (raise-window window) - (let ((done nil) - (dx (- (xlib:drawable-x window) orig-x)) - (dy (- (xlib:drawable-y window) orig-y))) - (labels ((motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) - (declare (ignore event-slots)) - (setf (xlib:drawable-x window) (+ root-x dx) - (xlib:drawable-y window) (+ root-y dy)) - (display-frame-info frame)) - (handle-event (&rest event-slots &key event-key &allow-other-keys) - (case event-key - (:motion-notify (apply #'motion-notify event-slots)) - (:button-release (setf done t)) - (:configure-request (call-hook *configure-request-hook* event-slots)) - (:configure-notify (call-hook *configure-notify-hook* event-slots)) - (:map-request (call-hook *map-request-hook* event-slots)) - (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) - (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) - (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) - (:property-notify (call-hook *property-notify-hook* event-slots)) - (:create-notify (call-hook *create-notify-hook* event-slots)) - (:enter-notify (call-hook *enter-notify-hook* event-slots)) - (:exposure (call-hook *exposure-hook* event-slots))) - t)) - (when frame - (loop until done - do (with-xlib-protect - (xlib:display-finish-output *display*) - (xlib:process-event *display* :handler #'handle-event)))) - (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent)))))) + (when frame + (hide-all-children frame) + (with-slots (window) frame + (move-window window orig-x orig-y #'display-frame-info (list frame)) + (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) + (frame-y frame) (y-px->fl (xlib:drawable-y window) parent))))) (defun resize-frame (frame parent orig-x orig-y) - (hide-all-children frame) - (with-slots (window) frame - (raise-window window) - (let ((done nil) - (dx (- (xlib:drawable-x window) orig-x)) - (dy (- (xlib:drawable-y window) orig-y)) - (lx orig-x) - (ly orig-y)) - (labels ((motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) - (declare (ignore event-slots)) - (setf (xlib:drawable-width window) (max (+ (xlib:drawable-width window) (- root-x lx)) 10) - (xlib:drawable-height window) (max (+ (xlib:drawable-height window) (- root-y ly)) 10) - dx (- dx (- root-x lx)) - dy (- dy (- root-y ly)) - lx root-x ly root-y) - (display-frame-info frame)) - (handle-event (&rest event-slots &key event-key &allow-other-keys) - (case event-key - (:motion-notify (apply #'motion-notify event-slots)) - (:button-release (setf done t)) - (:configure-request (call-hook *configure-request-hook* event-slots)) - (:configure-notify (call-hook *configure-notify-hook* event-slots)) - (:map-request (call-hook *map-request-hook* event-slots)) - (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) - (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) - (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) - (:property-notify (call-hook *property-notify-hook* event-slots)) - (:create-notify (call-hook *create-notify-hook* event-slots)) - (:enter-notify (call-hook *enter-notify-hook* event-slots)) - (:exposure (call-hook *exposure-hook* event-slots))) - t)) - (when frame - (loop until done - do (with-xlib-protect - (xlib:display-finish-output *display*) - (xlib:process-event *display* :handler #'handle-event)))) - (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) parent) - (frame-h frame) (h-px->fl (xlib:drawable-height window) parent)))))) + (when frame + (hide-all-children frame) + (with-slots (window) frame + (resize-window window orig-x orig-y #'display-frame-info (list frame)) + (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) parent) + (frame-h frame) (h-px->fl (xlib:drawable-height window) parent))))) @@ -629,7 +570,12 @@ (xlib:map-window (frame-window child)) (pushnew child (frame-child *current-root*))) (typecase child - (xlib:window (funcall mouse-fn parent (find-parent-frame parent) root-x root-y)) + (xlib:window + (if (managed-window-p child parent) + (funcall mouse-fn parent (find-parent-frame parent) root-x root-y) + (funcall(cond ((eql mouse-fn #'move-frame) #'move-window) + ((eql mouse-fn #'resize-frame) #'resize-window)) + child root-x root-y))) (frame (funcall mouse-fn child parent root-x root-y))) (focus-all-children child parent window-parent) (show-all-children))) Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Sun Apr 27 17:30:08 2008 @@ -353,13 +353,15 @@ (setf pointer-grabbed t) (let* ((white (xlib:make-color :red 1.0 :green 1.0 :blue 1.0)) (black (xlib:make-color :red 0.0 :green 0.0 :blue 0.0))) - (setf cursor-font (xlib:open-font *display* "cursor") - cursor (xlib:create-glyph-cursor :source-font cursor-font - :source-char cursor-char - :mask-font cursor-font - :mask-char cursor-mask-char - :foreground black - :background white)) + (if cursor-char + (setf cursor-font (xlib:open-font *display* "cursor") + cursor (xlib:create-glyph-cursor :source-font cursor-font + :source-char cursor-char + :mask-font cursor-font + :mask-char cursor-mask-char + :foreground black + :background white)) + (setf cursor nil)) (xlib:grab-pointer root pointer-mask :owner-p owner-p :sync-keyboard-p nil :sync-pointer-p nil :cursor cursor))) @@ -443,6 +445,92 @@ + + +;;; Mouse action on window +(defun move-window (window orig-x orig-y &optional additional-fn additional-arg) + (raise-window window) + (let ((done nil) + (dx (- (xlib:drawable-x window) orig-x)) + (dy (- (xlib:drawable-y window) orig-y)) + (pointer-grabbed-p (xgrab-pointer-p))) + (labels ((motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) + (declare (ignore event-slots)) + (setf (xlib:drawable-x window) (+ root-x dx) + (xlib:drawable-y window) (+ root-y dy)) + (when additional-fn + (apply additional-fn additional-arg))) + (my-handle-event (&rest event-slots &key event-key &allow-other-keys) + (case event-key + (:motion-notify (apply #'motion-notify event-slots)) + (:button-release (setf done t)) + (:configure-request (call-hook *configure-request-hook* event-slots)) + (:configure-notify (call-hook *configure-notify-hook* event-slots)) + (:map-request (call-hook *map-request-hook* event-slots)) + (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) + (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) + (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) + (:property-notify (call-hook *property-notify-hook* event-slots)) + (:create-notify (call-hook *create-notify-hook* event-slots)) + (:enter-notify (call-hook *enter-notify-hook* event-slots)) + (:exposure (call-hook *exposure-hook* event-slots))) + t)) + (unless pointer-grabbed-p + (xgrab-pointer *root* nil nil)) + (loop until done + do (with-xlib-protect + (xlib:display-finish-output *display*) + (xlib:process-event *display* :handler #'my-handle-event))) + (unless pointer-grabbed-p + (xungrab-pointer))))) + + +(defun resize-window (window orig-x orig-y &optional additional-fn additional-arg) + (raise-window window) + (let ((done nil) + (dx (- (xlib:drawable-x window) orig-x)) + (dy (- (xlib:drawable-y window) orig-y)) + (lx orig-x) + (ly orig-y) + (pointer-grabbed-p (xgrab-pointer-p))) + (labels ((motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) + (declare (ignore event-slots)) + (setf (xlib:drawable-width window) (max (+ (xlib:drawable-width window) (- root-x lx)) 10) + (xlib:drawable-height window) (max (+ (xlib:drawable-height window) (- root-y ly)) 10) + dx (- dx (- root-x lx)) + dy (- dy (- root-y ly)) + lx root-x ly root-y) + (when additional-fn + (apply additional-fn additional-arg))) + (handle-event (&rest event-slots &key event-key &allow-other-keys) + (case event-key + (:motion-notify (apply #'motion-notify event-slots)) + (:button-release (setf done t)) + (:configure-request (call-hook *configure-request-hook* event-slots)) + (:configure-notify (call-hook *configure-notify-hook* event-slots)) + (:map-request (call-hook *map-request-hook* event-slots)) + (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) + (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) + (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) + (:property-notify (call-hook *property-notify-hook* event-slots)) + (:create-notify (call-hook *create-notify-hook* event-slots)) + (:enter-notify (call-hook *enter-notify-hook* event-slots)) + (:exposure (call-hook *exposure-hook* event-slots))) + t)) + (unless pointer-grabbed-p + (xgrab-pointer *root* nil nil)) + (loop until done + do (with-xlib-protect + (xlib:display-finish-output *display*) + (xlib:process-event *display* :handler #'handle-event))) + (unless pointer-grabbed-p + (xungrab-pointer))))) + + + + + + (defun get-color (color) (xlib:alloc-color (xlib:screen-default-colormap *screen*) color)) From pbrochard at common-lisp.net Sun Apr 27 21:43:59 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Sun, 27 Apr 2008 17:43:59 -0400 (EDT) Subject: [clfswm-cvs] r99 - in clfswm: . src Message-ID: <20080427214359.E796624168@common-lisp.net> Author: pbrochard Date: Sun Apr 27 17:43:59 2008 New Revision: 99 Modified: clfswm/ChangeLog clfswm/src/xlib-util.lisp Log: resize-window: Take care of window size hints. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Sun Apr 27 17:43:59 2008 @@ -1,5 +1,8 @@ 2008-04-27 Philippe Brochard + * src/xlib-util.lisp (resize-window): Take care of window size + hints. + * src/clfswm-util.lisp (mouse-focus-move/resize-generic): Allow to move/resize unmanaged windows. Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Sun Apr 27 17:43:59 2008 @@ -487,16 +487,21 @@ (defun resize-window (window orig-x orig-y &optional additional-fn additional-arg) (raise-window window) - (let ((done nil) - (dx (- (xlib:drawable-x window) orig-x)) - (dy (- (xlib:drawable-y window) orig-y)) - (lx orig-x) - (ly orig-y) - (pointer-grabbed-p (xgrab-pointer-p))) + (let* ((done nil) + (dx (- (xlib:drawable-x window) orig-x)) + (dy (- (xlib:drawable-y window) orig-y)) + (lx orig-x) + (ly orig-y) + (pointer-grabbed-p (xgrab-pointer-p)) + (hints (xlib:wm-normal-hints window)) + (min-width (or (and hints (xlib:wm-size-hints-min-width hints)) 0)) + (min-height (or (and hints (xlib:wm-size-hints-min-height hints)) 0)) + (max-width (or (and hints (xlib:wm-size-hints-max-width hints)) most-positive-fixnum)) + (max-height (or (and hints (xlib:wm-size-hints-max-height hints)) most-positive-fixnum))) (labels ((motion-notify (&rest event-slots &key root-x root-y &allow-other-keys) (declare (ignore event-slots)) - (setf (xlib:drawable-width window) (max (+ (xlib:drawable-width window) (- root-x lx)) 10) - (xlib:drawable-height window) (max (+ (xlib:drawable-height window) (- root-y ly)) 10) + (setf (xlib:drawable-width window) (min (max (+ (xlib:drawable-width window) (- root-x lx)) 10 min-width) max-width) + (xlib:drawable-height window) (min (max (+ (xlib:drawable-height window) (- root-y ly)) 10 min-height) max-height) dx (- dx (- root-x lx)) dy (- dy (- root-y ly)) lx root-x ly root-y) From pbrochard at common-lisp.net Mon Apr 28 21:14:49 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Mon, 28 Apr 2008 17:14:49 -0400 (EDT) Subject: [clfswm-cvs] r100 - in clfswm: . src Message-ID: <20080428211449.04E0A4084@common-lisp.net> Author: pbrochard Date: Mon Apr 28 17:14:48 2008 New Revision: 100 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-util.lisp clfswm/src/package.lisp clfswm/src/tools.lisp clfswm/src/xlib-util.lisp Log: manage-current-window, unmanage-current-window: New functions: Allow to force to manage or unmanage a window by its parent frame. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Mon Apr 28 17:14:48 2008 @@ -1,3 +1,21 @@ +2008-04-28 Philippe Brochard + + * src/clfswm-util.lisp (manage-current-window) + (unmanage-current-window): New functions: Allow to force to manage + or unmanage a window by its parent frame. + + * src/bindings-second-mode.lisp (#\o): binded to + set-open-in-new-frame-in-parent-frame-nw-hook and + (#\o :control) to set-open-in-new-frame-in-root-frame-nw-hook + + * src/clfswm-util.lisp (with-current-window): New macro. + + * src/xlib-util.lisp (move-window, resize-window): Remove uneeded + exposure and enter-window handle event. + + * src/clfswm-util.lisp (move-frame, resize-frame): Show all + children for the current child after the move/resize. + 2008-04-27 Philippe Brochard * src/xlib-util.lisp (resize-window): Take care of window size Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Mon Apr 28 17:14:48 2008 @@ -61,3 +61,5 @@ - Hide/Unhide frame [Philippe] - Undo/redo (any idea to implement this is welcome) + +- Double buffering for all text windows. Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Mon Apr 28 17:14:48 2008 @@ -141,6 +141,8 @@ (add-menu-key 'window-menu "i" 'display-current-window-info) (add-menu-key 'window-menu "f" 'force-window-in-frame) (add-menu-key 'window-menu "c" 'force-window-center-in-frame) +(add-menu-key 'window-menu "m" 'manage-current-window) +(add-menu-key 'window-menu "u" 'unmanage-current-window) (add-menu-key 'window-menu "a" 'adapt-current-frame-to-window-hints) (add-menu-key 'window-menu "w" 'adapt-current-frame-to-window-width-hint) (add-menu-key 'window-menu "h" 'adapt-current-frame-to-window-height-hint) @@ -239,7 +241,8 @@ (define-second-key (#\b :mod-1) 'banish-pointer) -(define-second-key (#\o) 'set-open-in-new-frame-in-root-frame-nw-hook) +(define-second-key (#\o) 'set-open-in-new-frame-in-parent-frame-nw-hook) +(define-second-key (#\o :control) 'set-open-in-new-frame-in-root-frame-nw-hook) ;;;; Escape Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Mon Apr 28 17:14:48 2008 @@ -96,8 +96,14 @@ (defun managed-window-p (window frame) "Return t only if window is managed by frame" - (or (member :all (frame-managed-type frame)) - (member (window-type window) (frame-managed-type frame)))) + (with-slots ((managed forced-managed-window) + (unmanaged forced-unmanaged-window)) frame + (and (not (member window unmanaged)) + (not (member (xlib:wm-name window) unmanaged :test #'string-equal-p)) + (or (member :all (frame-managed-type frame)) + (member (window-type window) (frame-managed-type frame)) + (member window managed) + (member (xlib:wm-name window) managed :test #'string-equal-p))))) @@ -319,22 +325,22 @@ +;;; TODO: Double buffering for frame window (defun display-frame-info (frame) (let ((dy (+ (xlib:max-char-ascent *default-font*) (xlib:max-char-descent *default-font*)))) (with-slots (name number gc window child) frame - (when (equal frame *current-root*) - (xlib:clear-area window)) + (xlib:clear-area window) (setf (xlib:gcontext-foreground gc) (get-color (if (and (equal frame *current-root*) (equal frame *current-child*)) "Red" "Green"))) (xlib:draw-image-glyphs window gc 5 dy - (format nil "Frame: ~A~A " + (format nil "Frame: ~A~A" number (if name (format nil " - ~A" name) ""))) (let ((pos dy)) (when (equal frame *current-root*) (xlib:draw-image-glyphs window gc 5 (incf pos dy) - (format nil "~A hidden windows " (length (get-hidden-windows)))) + (format nil "~A hidden windows" (length (get-hidden-windows)))) (when *child-selection* (xlib:draw-image-glyphs window gc 5 (incf pos dy) (with-output-to-string (str) @@ -343,8 +349,7 @@ (typecase child (xlib:window (format str "~A " (xlib:wm-name child))) (frame (format str "frame:~A[~A] " (frame-number child) - (aif (frame-name child) it ""))))) - (format str " "))))) + (aif (frame-name child) it ""))))))))) (dolist (ch child) (when (xlib:window-p ch) (xlib:draw-glyphs window gc 5 (incf pos dy) (ensure-printable (xlib:wm-name ch))))))))) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Mon Apr 28 17:14:48 2008 @@ -443,32 +443,6 @@ - -;;; Force window functions -(defun force-window-in-frame () - "Force the current window to move in the frame (Useful only for transient windows)" - (when (xlib:window-p *current-child*) - (let ((parent (find-parent-frame *current-child*))) - (with-xlib-protect - (setf (xlib:drawable-x *current-child*) (frame-rx parent) - (xlib:drawable-y *current-child*) (frame-ry parent))))) - (leave-second-mode)) - -(defun force-window-center-in-frame () - "Force the current window to move in the center of the frame (Useful only for transient windows)" - (when (xlib:window-p *current-child*) - (let ((parent (find-parent-frame *current-child*))) - (with-xlib-protect - (setf (xlib:drawable-x *current-child*) (truncate (+ (frame-rx parent) - (/ (- (frame-rw parent) - (xlib:drawable-width *current-child*)) 2))) - (xlib:drawable-y *current-child*) (truncate (+ (frame-ry parent) - (/ (- (frame-rh parent) - (xlib:drawable-height *current-child*)) 2))))))) - (leave-second-mode)) - - - ;;; Show frame info (defun show-all-frames-info () "Show all frames info windows" @@ -502,7 +476,8 @@ (with-slots (window) frame (move-window window orig-x orig-y #'display-frame-info (list frame)) (setf (frame-x frame) (x-px->fl (xlib:drawable-x window) parent) - (frame-y frame) (y-px->fl (xlib:drawable-y window) parent))))) + (frame-y frame) (y-px->fl (xlib:drawable-y window) parent))) + (show-all-children frame))) (defun resize-frame (frame parent orig-x orig-y) @@ -511,7 +486,8 @@ (with-slots (window) frame (resize-window window orig-x orig-y #'display-frame-info (list frame)) (setf (frame-w frame) (w-px->fl (xlib:drawable-width window) parent) - (frame-h frame) (h-px->fl (xlib:drawable-height window) parent))))) + (frame-h frame) (h-px->fl (xlib:drawable-height window) parent))) + (show-all-children frame))) @@ -850,15 +826,80 @@ + + + +;;; Current window utilities +(defun get-current-window () + (typecase *current-child* + (xlib:window *current-child*) + (frame (first (frame-child *current-child*))))) + +(defmacro with-current-window (&body body) + "Bind 'window' to the current window" + `(let ((window (get-current-window))) + (when window + , at body))) + + + + + +;;; Force window functions +(defun force-window-in-frame () + "Force the current window to move in the frame (Useful only for transient windows)" + (with-current-window + (let ((parent (find-parent-frame window))) + (with-xlib-protect + (setf (xlib:drawable-x window) (frame-rx parent) + (xlib:drawable-y window) (frame-ry parent))))) + (leave-second-mode)) + + +(defun force-window-center-in-frame () + "Force the current window to move in the center of the frame (Useful only for transient windows)" + (with-current-window + (let ((parent (find-parent-frame window))) + (with-xlib-protect + (setf (xlib:drawable-x window) (truncate (+ (frame-rx parent) + (/ (- (frame-rw parent) + (xlib:drawable-width window)) 2))) + (xlib:drawable-y window) (truncate (+ (frame-ry parent) + (/ (- (frame-rh parent) + (xlib:drawable-height window)) 2))))))) + (leave-second-mode)) + + + (defun display-current-window-info () "Display information on the current window" - (let ((window (typecase *current-child* - (xlib:window *current-child*) - (frame (first (frame-child *current-child*)))))) - (when window - (info-mode (list (format nil "Window: ~A" window) - (format nil "Window name: ~A" (xlib:wm-name window)) - (format nil "Window class: ~A" (xlib:get-wm-class window)) - (format nil "Window type: ~:(~A~)" (window-type window)))))) + (with-current-window + (info-mode (list (format nil "Window: ~A" window) + (format nil "Window name: ~A" (xlib:wm-name window)) + (format nil "Window class: ~A" (xlib:get-wm-class window)) + (format nil "Window type: ~:(~A~)" (window-type window))))) + (leave-second-mode)) + + +(defun manage-current-window () + "Force to manage the current window by its parent frame" + (with-current-window + (let ((parent (find-parent-frame window))) + (with-slots ((managed forced-managed-window) + (unmanaged forced-unmanaged-window)) parent + (setf unmanaged (remove window unmanaged) + unmanaged (remove (xlib:wm-name window) unmanaged :test #'string-equal-p)) + (pushnew window managed)))) + (leave-second-mode)) + +(defun unmanage-current-window () + "Force to not manage the current window by its parent frame" + (with-current-window + (let ((parent (find-parent-frame window))) + (with-slots ((managed forced-managed-window) + (unmanaged forced-unmanaged-window)) parent + (setf managed (remove window managed) + managed (remove (xlib:wm-name window) managed :test #'string-equal-p)) + (pushnew window unmanaged)))) (leave-second-mode)) Modified: clfswm/src/package.lisp ============================================================================== --- clfswm/src/package.lisp (original) +++ clfswm/src/package.lisp Mon Apr 28 17:14:48 2008 @@ -90,6 +90,14 @@ (managed-type :initarg :managed-type :accessor frame-managed-type :initform *default-managed-type* :documentation "Managed window type") + (forced-managed-window :initarg :forced-managed-window + :accessor frame-forced-managed-window + :initform nil + :documentation "A list of forced managed windows (wm-name or window)") + (forced-unmanaged-window :initarg :forced-unmanaged-window + :accessor frame-forced-unmanaged-window + :initform nil + :documentation "A list of forced unmanaged windows (wm-name or window)") (window :initarg :window :accessor frame-window :initform nil) (gc :initarg :gc :accessor frame-gc :initform nil) (child :initarg :child :accessor frame-child :initform nil) Modified: clfswm/src/tools.lisp ============================================================================== --- clfswm/src/tools.lisp (original) +++ clfswm/src/tools.lisp Mon Apr 28 17:14:48 2008 @@ -41,6 +41,7 @@ :ensure-list :ensure-printable :ensure-n-elems + :string-equal-p :find-assoc-word :print-space :escape-string @@ -207,7 +208,9 @@ (cond ((= length n) list) ((< length n) (ensure-n-elems (append list '(nil)) n)) ((> length n) (ensure-n-elems (butlast list) n))))) - + +(defun string-equal-p (x y) + (when (stringp y) (string-equal x y))) Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Mon Apr 28 17:14:48 2008 @@ -459,7 +459,7 @@ (setf (xlib:drawable-x window) (+ root-x dx) (xlib:drawable-y window) (+ root-y dy)) (when additional-fn - (apply additional-fn additional-arg))) + (apply additional-fn additional-arg))) (my-handle-event (&rest event-slots &key event-key &allow-other-keys) (case event-key (:motion-notify (apply #'motion-notify event-slots)) @@ -471,9 +471,7 @@ (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) (:property-notify (call-hook *property-notify-hook* event-slots)) - (:create-notify (call-hook *create-notify-hook* event-slots)) - (:enter-notify (call-hook *enter-notify-hook* event-slots)) - (:exposure (call-hook *exposure-hook* event-slots))) + (:create-notify (call-hook *create-notify-hook* event-slots))) t)) (unless pointer-grabbed-p (xgrab-pointer *root* nil nil)) @@ -506,7 +504,7 @@ dy (- dy (- root-y ly)) lx root-x ly root-y) (when additional-fn - (apply additional-fn additional-arg))) + (apply additional-fn additional-arg))) (handle-event (&rest event-slots &key event-key &allow-other-keys) (case event-key (:motion-notify (apply #'motion-notify event-slots)) @@ -518,9 +516,7 @@ (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) (:property-notify (call-hook *property-notify-hook* event-slots)) - (:create-notify (call-hook *create-notify-hook* event-slots)) - (:enter-notify (call-hook *enter-notify-hook* event-slots)) - (:exposure (call-hook *exposure-hook* event-slots))) + (:create-notify (call-hook *create-notify-hook* event-slots))) t)) (unless pointer-grabbed-p (xgrab-pointer *root* nil nil)) From pbrochard at common-lisp.net Tue Apr 29 20:11:35 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Tue, 29 Apr 2008 16:11:35 -0400 (EDT) Subject: [clfswm-cvs] r101 - in clfswm: . src Message-ID: <20080429201135.3AE8A3F029@common-lisp.net> Author: pbrochard Date: Tue Apr 29 16:11:34 2008 New Revision: 101 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/clfswm-internal.lisp clfswm/src/xlib-util.lisp Log: Display unmanaged windows only when its window parent is the current child. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Tue Apr 29 16:11:34 2008 @@ -1,3 +1,8 @@ +2008-04-29 Philippe Brochard + + * src/clfswm-internal.lisp (show-all-children): Display unmanaged + windows only when its window parent is the current child. + 2008-04-28 Philippe Brochard * src/clfswm-util.lisp (manage-current-window) Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Tue Apr 29 16:11:34 2008 @@ -7,16 +7,15 @@ =============== Should handle these soon. -- forced-managed-window/forced-unmanaged-window: new frame parameter [Philippe] - - Move window over frame (Alt+Control+B1) [Philippe] -LESS URGENT TODO -================ - - Move the autodoc in its own file (clfswm-autodoc.lisp) and make the autodoc for the menu system. + +LESS URGENT TODO +================ + - Hook to open next window in named/numbered frame [Philippe] - Ensure-unique-number/name (new function) [Philippe] @@ -29,7 +28,6 @@ - Add boundaries in the info window [Philippe] -- Show unmanaged windows only for *current-child* [Philippe] MAYBE ===== Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Tue Apr 29 16:11:34 2008 @@ -418,22 +418,29 @@ (and (eql raise-p :first-only) first-p)) (raise-window window))) -(defgeneric show-child (child raise-p first-p)) +(defgeneric show-child (child parent display-p raise-p first-p)) -(defmethod show-child ((frame frame) raise-p first-p) - (with-xlib-protect - (with-slots (window) frame - (when (or *show-root-frame-p* (not (equal frame *current-root*))) - (setf (xlib:window-background window) (get-color "Black")) - (xlib:map-window window) - (raise-if-needed window raise-p first-p) - (display-frame-info frame))))) +(defmethod show-child ((frame frame) parent display-p raise-p first-p) + (declare (ignore parent)) + (when display-p + (with-xlib-protect + (with-slots (window) frame + (when (or *show-root-frame-p* (not (equal frame *current-root*))) + (setf (xlib:window-background window) (get-color "Black")) + (xlib:map-window window) + (raise-if-needed window raise-p first-p) + (display-frame-info frame)))))) -(defmethod show-child ((window xlib:window) raise-p first-p) +(defmethod show-child ((window xlib:window) parent display-p raise-p first-p) (with-xlib-protect - (xlib:map-window window) - (raise-if-needed window raise-p first-p))) + (if (or (managed-window-p window parent) + (equal parent *current-child*)) + (when display-p + (xlib:map-window window) + (raise-if-needed window raise-p first-p)) + (hide-window window)))) + (defgeneric hide-child (child)) @@ -497,8 +504,7 @@ (multiple-value-bind (raise-p change) (adapt-child-to-parent root parent) (when change (setf geometry-change change)) - (when display-p - (show-child root raise-p first-p))) + (show-child root parent display-p raise-p first-p)) (select-child root (if (equal root *current-child*) t (if (and first-p first-parent) :maybe nil))) (when (frame-p root) @@ -615,7 +621,7 @@ (when (frame-p *current-child*) (awhen (first (frame-child *current-child*)) (setf *current-child* it))) - (select-current-frame t)) + (show-all-children)) (defun select-previous-level () "Select the previous level in frame" @@ -623,7 +629,7 @@ (select-current-frame :maybe) (awhen (find-parent-frame *current-child*) (setf *current-child* it)) - (select-current-frame t))) + (show-all-children))) Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Tue Apr 29 16:11:34 2008 @@ -475,6 +475,8 @@ t)) (unless pointer-grabbed-p (xgrab-pointer *root* nil nil)) + (when additional-fn + (apply additional-fn additional-arg)) (loop until done do (with-xlib-protect (xlib:display-finish-output *display*) @@ -520,6 +522,8 @@ t)) (unless pointer-grabbed-p (xgrab-pointer *root* nil nil)) + (when additional-fn + (apply additional-fn additional-arg)) (loop until done do (with-xlib-protect (xlib:display-finish-output *display*) From pbrochard at common-lisp.net Wed Apr 30 19:23:08 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Wed, 30 Apr 2008 15:23:08 -0400 (EDT) Subject: [clfswm-cvs] r102 - in clfswm: . src Message-ID: <20080430192308.E5F1447005@common-lisp.net> Author: pbrochard Date: Wed Apr 30 15:23:08 2008 New Revision: 102 Modified: clfswm/ChangeLog clfswm/src/bindings-second-mode.lisp clfswm/src/clfswm-internal.lisp clfswm/src/clfswm-util.lisp Log: paste-selection-no-clear: Prevent to paste a child on one of its own children. (this prevent a recursive bug). Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Wed Apr 30 15:23:08 2008 @@ -1,3 +1,11 @@ +2008-04-30 Philippe Brochard + + * src/clfswm-util.lisp (paste-selection-no-clear): Prevent to + paste a child on one of its own children. (this prevent a + recursive bug). + + * src/clfswm-internal.lisp (find-child-in-parent): New function. + 2008-04-29 Philippe Brochard * src/clfswm-internal.lisp (show-all-children): Display unmanaged Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Wed Apr 30 15:23:08 2008 @@ -241,9 +241,8 @@ (define-second-key (#\b :mod-1) 'banish-pointer) -(define-second-key (#\o) 'set-open-in-new-frame-in-parent-frame-nw-hook) -(define-second-key (#\o :control) 'set-open-in-new-frame-in-root-frame-nw-hook) - +(define-second-key (#\o) 'set-open-in-new-frame-in-root-frame-nw-hook) +(define-second-key (#\o :control) 'set-open-in-new-frame-in-parent-frame-nw-hook) ;;;; Escape (define-second-key ("Escape" :control :shift) 'delete-focus-window) Modified: clfswm/src/clfswm-internal.lisp ============================================================================== --- clfswm/src/clfswm-internal.lisp (original) +++ clfswm/src/clfswm-internal.lisp Wed Apr 30 15:23:08 2008 @@ -305,6 +305,17 @@ (return-from find-frame-by-number frame))))) +(defun find-child-in-parent (child base) + "Return t if child is in base or in its parents" + (labels ((rec (base) + (when (equal child base) + (return-from find-child-in-parent t)) + (let ((parent (find-parent-frame base))) + (when parent + (rec parent))))) + (rec base))) + + (defun get-all-windows (&optional (root *root-frame*)) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Wed Apr 30 15:23:08 2008 @@ -185,7 +185,8 @@ (frame *current-child*)))) (when frame-dest (dolist (child *child-selection*) - (pushnew child (frame-child frame-dest))) + (unless (find-child-in-parent child frame-dest) + (pushnew child (frame-child frame-dest)))) (show-all-children)))) (defun paste-selection () From pbrochard at common-lisp.net Wed Apr 30 20:14:21 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Wed, 30 Apr 2008 16:14:21 -0400 (EDT) Subject: [clfswm-cvs] r103 - in clfswm: . src Message-ID: <20080430201421.20DC25D174@common-lisp.net> Author: pbrochard Date: Wed Apr 30 16:14:19 2008 New Revision: 103 Modified: clfswm/ChangeLog clfswm/TODO clfswm/src/bindings-second-mode.lisp clfswm/src/bindings.lisp clfswm/src/clfswm-util.lisp clfswm/src/xlib-util.lisp Log: mouse-move-window-over-frame: New function to move the window under the mouse cursor to another frame. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Wed Apr 30 16:14:19 2008 @@ -3,6 +3,10 @@ * src/clfswm-util.lisp (paste-selection-no-clear): Prevent to paste a child on one of its own children. (this prevent a recursive bug). + (move-child-to): Rename move/copy-current-child-by to + move/copy-child-to. + (mouse-move-window-over-frame): New function to move the window + under the mouse cursor to another frame. * src/clfswm-internal.lisp (find-child-in-parent): New function. Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Wed Apr 30 16:14:19 2008 @@ -7,8 +7,6 @@ =============== Should handle these soon. -- Move window over frame (Alt+Control+B1) [Philippe] - - Move the autodoc in its own file (clfswm-autodoc.lisp) and make the autodoc for the menu system. Modified: clfswm/src/bindings-second-mode.lisp ============================================================================== --- clfswm/src/bindings-second-mode.lisp (original) +++ clfswm/src/bindings-second-mode.lisp Wed Apr 30 16:14:19 2008 @@ -362,6 +362,8 @@ (define-second-mouse (1 :mod-1) 'mouse-click-to-focus-and-move-window) (define-second-mouse (3 :mod-1) 'mouse-click-to-focus-and-resize-window) +(define-second-mouse (1 :control :mod-1) 'mouse-move-window-over-frame) + (define-second-mouse (4) 'sm-mouse-select-next-level) (define-second-mouse (5) 'sm-mouse-select-previous-level) Modified: clfswm/src/bindings.lisp ============================================================================== --- clfswm/src/bindings.lisp (original) +++ clfswm/src/bindings.lisp Wed Apr 30 16:14:19 2008 @@ -127,6 +127,8 @@ (define-main-mouse (1 :mod-1) 'mouse-click-to-focus-and-move-window) (define-main-mouse (3 :mod-1) 'mouse-click-to-focus-and-resize-window) +(define-main-mouse (1 :control :mod-1) 'mouse-move-window-over-frame) + (define-main-mouse (4) 'mouse-select-next-level) (define-main-mouse (5) 'mouse-select-previous-level) Modified: clfswm/src/clfswm-util.lisp ============================================================================== --- clfswm/src/clfswm-util.lisp (original) +++ clfswm/src/clfswm-util.lisp Wed Apr 30 16:14:19 2008 @@ -396,7 +396,7 @@ ;;; Move by function -(defun move-current-child-by (child frame-dest) +(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)) @@ -406,21 +406,21 @@ (defun move-current-child-by-name () "Move current child in a named frame" - (move-current-child-by *current-child* - (find-frame-by-name - (ask-frame-name (format nil "Move '~A' to frame" (child-name *current-child*))))) + (move-child-to *current-child* + (find-frame-by-name + (ask-frame-name (format nil "Move '~A' to frame" (child-name *current-child*))))) (leave-second-mode)) (defun move-current-child-by-number () "Move current child in a numbered frame" - (move-current-child-by *current-child* - (find-frame-by-number - (query-number (format nil "Move '~A' to frame numbered:" (child-name *current-child*))))) + (move-child-to *current-child* + (find-frame-by-number + (query-number (format nil "Move '~A' to frame numbered:" (child-name *current-child*))))) (leave-second-mode)) ;;; Copy by function -(defun copy-current-child-by (child frame-dest) +(defun copy-child-to (child frame-dest) (when (and child (frame-p frame-dest)) (hide-all *current-root*) (pushnew child (frame-child frame-dest)) @@ -429,16 +429,16 @@ (defun copy-current-child-by-name () "Copy current child in a named frame" - (copy-current-child-by *current-child* - (find-frame-by-name - (ask-frame-name (format nil "Copy '~A' to frame" (child-name *current-child*))))) + (copy-child-to *current-child* + (find-frame-by-name + (ask-frame-name (format nil "Copy '~A' to frame" (child-name *current-child*))))) (leave-second-mode)) (defun copy-current-child-by-number () "Copy current child in a numbered frame" - (copy-current-child-by *current-child* - (find-frame-by-number - (query-number (format nil "Copy '~A' to frame numbered:" (child-name *current-child*))))) + (copy-child-to *current-child* + (find-frame-by-number + (query-number (format nil "Copy '~A' to frame numbered:" (child-name *current-child*))))) (leave-second-mode)) @@ -904,3 +904,24 @@ (pushnew window unmanaged)))) (leave-second-mode)) + + +;;; Moving window with the mouse function +(defun mouse-move-window-over-frame (window root-x root-y) + "Move the window under the mouse cursor to another frame" + (declare (ignore window)) + (let ((child (find-child-under-mouse root-x root-y))) + (unless (equal child *current-root*) + (hide-child child) + (remove-child-in-frame child (find-parent-frame child)) + (wait-mouse-button-release 50 51) + (multiple-value-bind (x y) + (xlib:query-pointer *root*) + (let ((dest (find-child-under-mouse x y))) + (when (xlib:window-p dest) + (setf dest (find-parent-frame dest))) + (unless (equal child dest) + (move-child-to child dest)))))) + (stop-button-event)) + + Modified: clfswm/src/xlib-util.lisp ============================================================================== --- clfswm/src/xlib-util.lisp (original) +++ clfswm/src/xlib-util.lisp Wed Apr 30 16:14:19 2008 @@ -460,7 +460,7 @@ (xlib:drawable-y window) (+ root-y dy)) (when additional-fn (apply additional-fn additional-arg))) - (my-handle-event (&rest event-slots &key event-key &allow-other-keys) + (handle-event (&rest event-slots &key event-key &allow-other-keys) (case event-key (:motion-notify (apply #'motion-notify event-slots)) (:button-release (setf done t)) @@ -480,7 +480,7 @@ (loop until done do (with-xlib-protect (xlib:display-finish-output *display*) - (xlib:process-event *display* :handler #'my-handle-event))) + (xlib:process-event *display* :handler #'handle-event))) (unless pointer-grabbed-p (xungrab-pointer))))) @@ -535,6 +535,37 @@ +(defun wait-mouse-button-release (&optional cursor-char cursor-mask-char) + (let ((done nil) + (pointer-grabbed-p (xgrab-pointer-p))) + (labels ((handle-event (&rest event-slots &key event-key &allow-other-keys) + (case event-key + ;;(:motion-notify (apply #'motion-notify event-slots)) + (:button-release (setf done t)) + (:configure-request (call-hook *configure-request-hook* event-slots)) + (:configure-notify (call-hook *configure-notify-hook* event-slots)) + (:map-request (call-hook *map-request-hook* event-slots)) + (:unmap-notify (call-hook *unmap-notify-hook* event-slots)) + (:destroy-notify (call-hook *destroy-notify-hook* event-slots)) + (:mapping-notify (call-hook *mapping-notify-hook* event-slots)) + (:property-notify (call-hook *property-notify-hook* event-slots)) + (:create-notify (call-hook *create-notify-hook* event-slots))) + t)) + (unless pointer-grabbed-p + (xgrab-pointer *root* cursor-char cursor-mask-char)) + (loop until done + do (with-xlib-protect + (xlib:display-finish-output *display*) + (xlib:process-event *display* :handler #'handle-event))) + (unless pointer-grabbed-p + (xungrab-pointer))))) + + + + + + + (defun get-color (color) (xlib:alloc-color (xlib:screen-default-colormap *screen*) color)) @@ -615,3 +646,11 @@ (xlib:event-case (*display* :discard-p nil :peek-p t :timeout 0) (:motion-notify () t)))) + +(defun display-all-cursors (&optional (display-time 1)) + "Display all X11 cursors for display-time seconds" + (loop for i from 0 to 152 by 2 + do (xgrab-pointer *root* i (1+ i)) + (dbg i) + (sleep display-time) + (xungrab-pointer))) From pbrochard at common-lisp.net Wed Apr 30 22:05:24 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Wed, 30 Apr 2008 18:05:24 -0400 (EDT) Subject: [clfswm-cvs] r104 - in clfswm: . doc src Message-ID: <20080430220524.2F6C313069@common-lisp.net> Author: pbrochard Date: Wed Apr 30 18:05:17 2008 New Revision: 104 Added: clfswm/doc/menu.html clfswm/doc/menu.txt clfswm/src/clfswm-autodoc.lisp Modified: clfswm/ChangeLog clfswm/clfswm.asd clfswm/doc/keys.html clfswm/doc/keys.txt clfswm/src/clfswm-keys.lisp clfswm/src/clfswm-menu.lisp clfswm/src/package.lisp Log: produce-doc-*: Moved to clfswm-autodoc.lisp. Produce-menu-doc, produce-menu-doc-html: New functions. Modified: clfswm/ChangeLog ============================================================================== --- clfswm/ChangeLog (original) +++ clfswm/ChangeLog Wed Apr 30 18:05:17 2008 @@ -1,5 +1,9 @@ 2008-04-30 Philippe Brochard + * src/clfswm-autodoc.lisp (produce-menu-doc, + (produce-menu-doc-html): New functions. + (produce-doc-*): Moved to clfswm-autodoc.lisp. + * src/clfswm-util.lisp (paste-selection-no-clear): Prevent to paste a child on one of its own children. (this prevent a recursive bug). Modified: clfswm/clfswm.asd ============================================================================== --- clfswm/clfswm.asd (original) +++ clfswm/clfswm.asd Wed Apr 30 18:05:17 2008 @@ -27,6 +27,8 @@ :depends-on ("package" "xlib-util")) (:file "clfswm-keys" :depends-on ("package" "config" "xlib-util" "keysyms")) + (:file "clfswm-autodoc" + :depends-on ("package" "clfswm-keys" "my-html" "tools")) (:file "clfswm-internal" :depends-on ("xlib-util" "clfswm-keys" "netwm-util" "tools")) (:file "clfswm" Modified: clfswm/doc/keys.html ============================================================================== --- clfswm/doc/keys.html (original) +++ clfswm/doc/keys.html Wed Apr 30 18:05:17 2008 @@ -35,996 +35,21 @@ Mod-1 - 0 - - - Focus workspace 10 - - - - - Mod-1 - - - 9 - - - Focus workspace 9 - - - - - Mod-1 - - - 8 - - - Focus workspace 8 - - - - - Mod-1 - - - 7 - - - Focus workspace 7 - - - - - Mod-1 - - - 6 - - - Focus workspace 6 - - - - - Mod-1 - - - 5 - - - Focus workspace 5 - - - - - Mod-1 - - - 4 - - - Focus workspace 4 - - - - - Mod-1 - - - 3 - - - Focus workspace 3 - - - - - Mod-1 - - - 2 - - - Focus workspace 2 - - - - - Mod-1 - - - 1 - - - Focus workspace 1 - - - - - Mod-1 Control Shift - - - Left - - - Circulate down in workspace copying current group in the next workspace - - - - - Mod-1 Shift - - - Left - - - Circulate down in workspace moving current group in the next workspace - - - - - Mod-1 - - - Left - - - Circulate down in workspace - - - - - Mod-1 Control Shift - - - Right - - - Circulate up in workspace copying current group in the next workspace - - - - - Mod-1 Shift - - - Right - - - Circulate up in workspace moving current group in the next workspace - - - - - Mod-1 - - - Right - - - Circulate up in workspace - - - - - Mod-1 Control Shift - - - Down - - - Circulate down in group copying the current window in the next group - - - - - Mod-1 Shift - - - Down - - - Circulate down in group moving the current window in the next group - - - - - Mod-1 - - - Down - - - Circulate down in group - - - - - Mod-1 Control Shift - - - Up - - - Circulate up in group copying the current window in the next group - - - - - Mod-1 Shift - - - Up - - - Circulate up in group moving the current window in the next group - - - - - Mod-1 - - - Up - - - Circulate up in group - - - - - Shift - - - Escape - - - Unhide all hidden windows into the current group - - - - - Control - - - Escape - - - Remove the current window in the current group - - - - - Mod-1 Control Shift - - - Escape - - - Destroy the current window in all groups and workspaces - - - - - Control Shift - - - Escape - - - Delete the current window in all groups and workspaces - - - - - Mod-1 Control - - - B - - - Maximize/minimize the current group - - - - - Mod-1 - - - B - - - Move the pointer to the lower right corner of the screen and redraw all groups - - - - - Mod-1 Shift - - - Tab - - - Rotate down windows in the current group - - - - - Mod-1 - - - Tab - - - Rotate up windows in the current group - - - - - Control - - - Less - - - Switch to editing mode - - - - - Mod-1 - - - T - - - Switch to editing mode - - - - - Mod-1 Control Shift - - - Home - - - Quit clfswm - - - - - Mod-1 - - - F1 - - - Open the help and info window - - - -

- - Second mode keys - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1032,10 +57,10 @@ Mod-1 @@ -1043,32 +68,21 @@ Mod-1 - - - - - @@ -1076,21 +90,21 @@ Mod-1 @@ -1098,10 +112,10 @@ Mod-1 Shift @@ -1109,21 +123,10 @@ Mod-1 - - - - - @@ -1131,10 +134,10 @@ Mod-1 Shift @@ -1142,21 +145,10 @@ Mod-1 - - - - - @@ -1164,21 +156,21 @@ Mod-1 Shift @@ -1186,10 +178,10 @@ Shift @@ -1197,21 +189,21 @@ Control @@ -1222,18 +214,18 @@ Escape @@ -1241,76 +233,32 @@ Control - - - - - - - - - - - - - - - - - - - - @@ -1318,10 +266,10 @@ Control @@ -1329,41 +277,10 @@ Mod-1 - - -
- Modifiers - - Key/Button - - Function -
- Shift - - Left - - Resize group left -
- Shift - - Right - - Resize group right -
- Shift - - Down - - Resize group down -
- Shift - - Up - - Resize group up -
- - - Left - - Move, pack, fill or resize group left -
- - - Right - - Move, pack, fill or resize group right -
- - - Down - - Move, pack, fill or resize group down -
- - - Up - - Move, pack, fill or resize group up -
- - - M - - Center the current group -
- Mod-1 - - L - - Resize down the current group -
- - - L - - Resize down the current group to its minimal size -
- - - R - - Resize group to its half width or heigth on next arraw action -
- Control - - F - - Fill group horizontally -
- Shift - - F - - Fill group vertically -
- Mod-1 - - F - - Fill group in all directions -
- - - F - - Fill group on next arrow action (fill in all directions on second f keypress) -
- - - P - - Pack group on next arrow action -
- Control Shift - - Y - - Move all windows in the current workspace to one group and remove other groups -
- Control - - Y - - Create a new group for each window in the current group -
- Mod-1 - - Y - - Reconfigure the workspace tiling for the current session -
- - - Y - - Tile the current workspace with the current window on one side and others on the other -
- Control Shift - - T - - Tile the current workspace horizontally -
- Control - - T - - Tile the current workspace vertically -
- Mod-1 - - D - - Show debuging info -
- Mod-1 - - A - - Force the current window to move in the group (Useful only for transient windows) -
- - - A - - Force the current window to move in the center of the group (Useful only for transient windows) -
- - - H - - start an xclock -
- Control - - E - - start an emacs for another user -
- - - E - - start emacs -
- - - C - - start an xterm -
- Mod-1 Control - - O - - Open each next window in a new group -
- Mod-1 - - O - - Open the next window in a new group and all others in the same group -
- Control - - O - - Open the next window in a numbered workspace -
- - - O - - Open the next window in a new workspace -
- Mod-1 - - W - - Remove the current workspace -
- - - W - - Create a new default workspace -
- Mod-1 - - G - - Remove the current group in the current workspace -
- - - G - - Create a new default group -
- - - K - - Remove the current window in the current group -
- Mod-1 - - K - - Destroy the current window in all groups and workspaces -
- - - X - - Open the fullscreen pager -
- Mod-1 - - B - - Maximize/minimize the current group -
- - - B - - Move the pointer to the lower right corner of the screen and redraw all groups -
- Mod-1 Shift - - Tab - - Rotate down windows in the current group -
- Mod-1 - - Tab - - Rotate up windows in the current group -
- Mod-1 Control - - 2 - - Sort workspaces by numbers -
- Mod-1 Control - - 1 - - Reset workspaces numbers (1 for current workspace, 2 for the second...) -
- Mod-1 - - 0 - - Focus workspace 10 -
- Mod-1 - - 9 - - Focus workspace 9 -
- Mod-1 - - 8 - - Focus workspace 8 -
- Mod-1 - - 7 - - Focus workspace 7 -
- Mod-1 - - 6 - - Focus workspace 6 -
- Mod-1 - - 5 - - Focus workspace 5 -
- Mod-1 - - 4 + F1 - Focus workspace 4 + Open the help and info window
- Mod-1 + Mod-1 Control Shift - 3 + Home - Focus workspace 3 + Quit clfswm
- 2 + Right - Focus workspace 2 + Select the next brother frame
- 1 - - Focus workspace 1 -
- Mod-1 Control Shift - Left - Circulate down in workspace copying current group in the next workspace + Select the previous brother frame
- Mod-1 Shift + Mod-1 - Left + Down - Circulate down in workspace moving current group in the next workspace + Select the previous level in frame
- Left + Up - Circulate down in workspace + Select the next level in frame
- Mod-1 Control Shift + Mod-1 - Right + Tab - Circulate up in workspace copying current group in the next workspace + Select the next child
- Right + Iso_left_tab - Circulate up in workspace moving current group in the next workspace + Select the previous child
- Right - - Circulate up in workspace -
- Mod-1 Control Shift - - Down + Return - Circulate down in group copying the current window in the next group + Enter in the selected frame - ie make it the root frame
- Down + Return - Circulate down in group moving the current window in the next group + Leave the selected frame - ie make its parent the root frame
- Down - - Circulate down in group -
- Mod-1 Control Shift - - Up + Home - Circulate up in group copying the current window in the next group + Switch to the root frame
- Up + Home - Circulate up in group moving the current window in the next group + Switch and select the root frame
- Mod-1 + - Up + Menu - Circulate up in group + Show all frames info windows until a key is release
- Escape + Menu - Unhide all hidden windows into the current group + Show all frames info windows
- Escape + Menu - Remove the current window in the current group + Show/Hide the root frame
- Mod-1 Control Shift + Mod-1 - Escape + B - Destroy the current window in all groups and workspaces + Move the pointer to the lower right corner of the screen
- Delete the current window in all groups and workspaces + Delete the focus window in all frames and workspaces
- Control + Mod-1 Control Shift - Return + Escape - Leave second mode + Destroy the focus window in all frames and workspaces
- < - - Leave second mode -
- - Escape - Leave second mode + Remove the focus window in the current frame
- + Shift - Return + Escape - Leave second mode and maximize current group + Unhide all hidden windows into the current child
- + Mod-1 T - Leave second mode and maximize current group -
- - - ! - - Run a program from the query input -
- - - : - - Eval a lisp form from the query input -
- - - I - - Identify a key + Switch to editing mode
- G + Less - Stop all pending actions (actions like open in new workspace/group) + Switch to editing mode
- F1 - - Open the help and info window -
-

- - Mouse buttons actions in second mode - -

- - - - - - - - - @@ -1371,10 +288,10 @@ Mod-1 @@ -1382,87 +299,65 @@ Mod-1 - - - - - - - - - - @@ -1470,27 +365,27 @@ Mod-1
- Modifiers - - Key/Button - - Function -
- - - Motion + |1| - -Move or resize group. Move window from a group to another. -Go to top left or rigth corner to change workspaces. + Bind or jump to a slot
- 5 + |2| - Circulate down in workspaces + Bind or jump to a slot
- 4 - - Circulate up in workspaces -
- - - 5 - - Rotate window down -
- - - 4 + |3| - Rotate window up + Bind or jump to a slot
- Control + Mod-1 - 3 + |4| - Copy selected window + Bind or jump to a slot
- + Mod-1 - 3 + |5| - Move selected window + Bind or jump to a slot
- Control + Mod-1 - 2 + |6| - Leave second mode + Bind or jump to a slot
- + Mod-1 - 2 + |7| - Leave second mode and maximize current group + Bind or jump to a slot
- Control + Mod-1 - 1 + |8| - Copy selected group + Bind or jump to a slot
- 1 + |9| - Resize selected group + Bind or jump to a slot
- + Mod-1 - 1 + |0| - Move selected group or create a new group on the root window + Bind or jump to a slot

- Pager mode keys + Mouse buttons actions in main mode

@@ -1507,35 +402,24 @@ - - - - - @@ -1543,10 +427,10 @@ Mod-1 @@ -1554,43 +438,43 @@ Mod-1 @@ -1598,10 +482,10 @@ Mod-1 @@ -1609,296 +493,292 @@ Mod-1 +
- Mod-1 Control - - 2 - - Sort workspaces by numbers -
- Mod-1 Control + - 1 + 1 - Reset workspaces numbers (1 for current workspace, 2 for the second...) + Move and focus the current frame or focus the current window parent
- Mod-1 + - 0 + 3 - Focus workspace 10 + Resize and focus the current frame or focus the current window parent
- 9 + 1 - Focus workspace 9 + Move and focus the current child - Create a new frame on the root window
- 8 + 3 - Focus workspace 8 + Resize and focus the current child - Create a new frame on the root window
- Mod-1 + Mod-1 Control - 7 + 1 - Focus workspace 7 + Move the window under the mouse cursor to another frame
- Mod-1 + - 6 + 4 - Focus workspace 6 + Select the next level in frame
- Mod-1 + - 5 + 5 - Focus workspace 5 + Select the previous level in frame
- 4 + 4 - Focus workspace 4 + Enter in the selected frame - ie make it the root frame
- 3 + 5 - Focus workspace 3 + Leave the selected frame - ie make its parent the root frame
+

+ + Second mode keys + +

+ - - - + + + - - - - - @@ -1906,21 +786,21 @@ @@ -1928,43 +808,43 @@ @@ -1972,54 +852,54 @@ Control @@ -2027,32 +907,32 @@ Control @@ -2060,87 +940,87 @@ @@ -2148,76 +1028,76 @@ Mod-1 @@ -2225,16 +1105,16 @@ Mod-1
- Mod-1 - - 2 - - Focus workspace 2 - + Modifiers + + Key/Button + + Function +
Mod-1 - 1 - - Focus workspace 1 -
- Control Shift - - Right + F1 - Copy the current group to the next workspace + Open the help and info window for the second mode
- Control Shift + - Left + M - Copy the current group to the previous workspace + Open the main menu
- Shift + - Up + F - Move the current window to the previous line + Open the frame menu
- Shift + - Down + W - Move the current window to the next line + Open the window menu
- Shift + - Right + N - Move the current group to the next workspace + Open the action by name menu
- Shift + - Left + U - Move the current group to the previous workspace + Open the action by number menu
- Mod-1 Control + - Left + I - Resize group left + Identify a key
- Mod-1 Control + - Right + Colon - Resize group right + Eval a lisp form from the query input
- Mod-1 Control + - Down + Exclam - Resize group down + Run a program from the query input
- Mod-1 Control + - Up + T - Resize group up + Leave second mode
- Mod-1 + - Left + Return - Move group left + Leave second mode
- Mod-1 + - Right + Escape - Move group right + Leave second mode
- Mod-1 + Control - Down + < - Move group down + Leave second mode
- Mod-1 + Mod-1 Control Shift - Up + Home - Move group up + Quit clfswm
- + Mod-1 - M + Right - Center the current group + Select the next brother frame
- + Mod-1 Left - Move cursor, pack, fill or resize group left + Select the previous brother frame
- + Mod-1 - Right + Down - Move cursor, pack, fill or resize group right + Select the previous level in frame
- + Mod-1 - Down + Up - Move cursor, pack, fill or resize group down + Select the next level in frame
- + Mod-1 - Up + Tab - Move cursor, pack, fill or resize group up + Select the next child
- Mod-1 + Mod-1 Shift - L + Iso_left_tab - Resize down the current group + Select the previous child
- + Mod-1 - L + Return - Resize down the current group to its minimal size + Enter in the selected frame - ie make it the root frame
- Control + Mod-1 Shift - F + Return - Fill group horizontally + Leave the selected frame - ie make its parent the root frame
- Shift + Mod-1 - F + Home - Fill group vertically + Switch to the root frame
- Mod-1 + Mod-1 Shift - F + Home - Fill group in all directions + Switch and select the root frame
- F + Menu - Fill group on next arrow action (fill in all directions on second f keypress) + Show all frames info windows until a key is release
- Shift + Mod-1 - R + B - Resize group on next arrow action + Move the pointer to the lower right corner of the screen
- R + O - Resize group to its half width or heigth on next arrow action + Open the next window in a new frame in the root frame
- Shift + Control - M + O - Move group on next arrow action + Open the next window in a new frame in the parent frame
- + Control Shift - P + Escape - Pack group on next arrow action + Delete the focus window in all frames and workspaces
- Control Shift + Mod-1 Control Shift - Y + Escape - Move all windows in the current workspace to one group and remove other groups + Destroy the focus window in all frames and workspaces
- Y + Escape - Create a new group for each window in the current group + Remove the focus window in the current frame
- + Shift - Y + Escape - Tile the current workspace with the current window on one side and others on the other + Unhide all hidden windows into the current child
- Shift + Control - T + X - Tile the current workspace horizontally + Cut the current child to the selection
- + Mod-1 Control - T + X - Tile the current workspace vertically + Clear the current selection
- Mod-1 + Control - X + C - Swap the current window with the next window + Copy the current child to the selection
- X + V - Swap the current group with the next group + Paste the selection in the current frame
- + Control Shift - X + V - Swap the current workspace with the next workspace + Paste the selection in the current frame - Do not clear the selection after paste
- Mod-1 + - W + Delete - Remove the current workspace + Remove the current child from its parent frame
- W + C - Create a new default workspace + start an xterm
- Mod-1 + - G + E - Remove the current group in the current workspace + start emacs
- + Control - G + E - Create a new default group + start an emacs for another user
- Shift + - Escape + H - Unhide all hidden windows into the current group + start an xclock
- Control + Shift - Escape + Menu - Remove the current window in the current group + Show all frames info windows
- Mod-1 Control Shift + Control - Escape + Menu - Destroy the current window in all groups and workspaces + Show/Hide the root frame
- Control Shift + Mod-1 - Escape + |1| - Delete the current window in all groups and workspaces + Bind or jump to a slot
- Mod-1 Shift + Mod-1 - Tab + |2| - Rotate down windows in the current group + Bind or jump to a slot
- Tab + |3| - Rotate up windows in the current group + Bind or jump to a slot
- + Mod-1 - End + |4| - Select the last workspace + Bind or jump to a slot
- + Mod-1 - Home + |5| - Select the first workspace + Bind or jump to a slot
- + Mod-1 - B + |6| - Move the pointer to the lower right corner of the screen and redraw all groups + Bind or jump to a slot
- + Mod-1 - Escape + |7| - Leave the pager mode + Bind or jump to a slot
- + Mod-1 - Return + |8| - Leave the pager mode + Bind or jump to a slot
- Control + Mod-1 - G + |9| - Stop all pending actions (actions like open in new workspace/group) + Bind or jump to a slot
- F1 + |0| - Open the help and info window + Bind or jump to a slot

- Mouse buttons actions in pager mode + Mouse buttons actions in second mode

@@ -2254,10 +1134,10 @@ @@ -2265,32 +1145,43 @@ + + + + + @@ -2298,10 +1189,10 @@ @@ -2309,32 +1200,32 @@
- Motion + 1 - Select workspaces + Move and focus the current child - Create a new frame on the root window
- 5 + 3 - Rotate down windows in selected group + Resize and focus the current child - Create a new frame on the root window
- + Mod-1 - 4 + 1 - Rotate up windows in selected group + Move and focus the current child - Create a new frame on the root window
- Control + Mod-1 3 - Copy selected window + Resize and focus the current child - Create a new frame on the root window +
+ Mod-1 Control + + 1 + + Move the window under the mouse cursor to another frame
- 3 + 4 - Move selected window + Select the next level in frame
- 2 + 5 - Leave the pager mode + Select the previous level in frame
- Control + Mod-1 - 1 + 4 - Copy selected group + Enter in the selected frame - ie make it the root frame
- + Mod-1 - 1 + 5 - Move selected group + Leave the selected frame - ie make its parent the root frame
@@ -2360,10 +1251,10 @@ - Page_up + Q - Move ten lines up + Leave the info mode @@ -2371,10 +1262,10 @@ - Page_down + Return - Move ten lines down + Leave the info mode @@ -2382,10 +1273,10 @@ - End + Escape - Move to last line + Leave the info mode @@ -2393,10 +1284,10 @@ - Home + - Move to first line + Leave the info mode @@ -2404,10 +1295,10 @@ - Right + Twosuperior - Move one char right + Move the pointer to the lower right corner of the screen @@ -2415,10 +1306,10 @@ - Left + Down - Move one char left + Move one line down @@ -2437,10 +1328,10 @@ - Down + Left - Move one line down + Move one char left @@ -2448,10 +1339,10 @@ - Twosuperior + Right - Move the pointer to the lower right corner of the screen + Move one char right @@ -2459,10 +1350,10 @@ - + Home - Leave the info mode + Move to first line @@ -2470,10 +1361,10 @@ - Escape + End - Leave the info mode + Move to last line @@ -2481,10 +1372,10 @@ - Return + Page_down - Leave the info mode + Move ten lines down @@ -2492,10 +1383,10 @@ - Q + Page_up - Leave the info mode + Move ten lines up @@ -2521,10 +1412,10 @@ - Motion + 1 - Grab text + Begin grab text @@ -2532,10 +1423,10 @@ - 5 + 2 - Move one line down + Leave the info mode @@ -2554,10 +1445,10 @@ - 2 + 5 - Leave the info mode + Move one line down @@ -2565,10 +1456,10 @@ - 1 + Clfswm motion - Begin grab text + Grab text Modified: clfswm/doc/keys.txt ============================================================================== --- clfswm/doc/keys.txt (original) +++ clfswm/doc/keys.txt Wed Apr 30 18:05:17 2008 @@ -6,257 +6,151 @@ Main mode keys: -------------- -Mod-1 0 Focus workspace 10 -Mod-1 9 Focus workspace 9 -Mod-1 8 Focus workspace 8 -Mod-1 7 Focus workspace 7 -Mod-1 6 Focus workspace 6 -Mod-1 5 Focus workspace 5 -Mod-1 4 Focus workspace 4 -Mod-1 3 Focus workspace 3 -Mod-1 2 Focus workspace 2 -Mod-1 1 Focus workspace 1 -Mod-1 Control Shift Left Circulate down in workspace copying current group in the next workspace -Mod-1 Shift Left Circulate down in workspace moving current group in the next workspace -Mod-1 Left Circulate down in workspace -Mod-1 Control Shift Right Circulate up in workspace copying current group in the next workspace -Mod-1 Shift Right Circulate up in workspace moving current group in the next workspace -Mod-1 Right Circulate up in workspace -Mod-1 Control Shift Down Circulate down in group copying the current window in the next group -Mod-1 Shift Down Circulate down in group moving the current window in the next group -Mod-1 Down Circulate down in group -Mod-1 Control Shift Up Circulate up in group copying the current window in the next group -Mod-1 Shift Up Circulate up in group moving the current window in the next group -Mod-1 Up Circulate up in group -Shift Escape Unhide all hidden windows into the current group -Control Escape Remove the current window in the current group -Mod-1 Control Shift Escape Destroy the current window in all groups and workspaces -Control Shift Escape Delete the current window in all groups and workspaces -Mod-1 Control B Maximize/minimize the current group -Mod-1 B Move the pointer to the lower right corner of the screen and redraw all groups -Mod-1 Shift Tab Rotate down windows in the current group -Mod-1 Tab Rotate up windows in the current group -Control Less Switch to editing mode -Mod-1 T Switch to editing mode -Mod-1 Control Shift Home Quit clfswm Mod-1 F1 Open the help and info window +Mod-1 Control Shift Home Quit clfswm +Mod-1 Right Select the next brother frame +Mod-1 Left Select the previous brother frame +Mod-1 Down Select the previous level in frame +Mod-1 Up Select the next level in frame +Mod-1 Tab Select the next child +Mod-1 Shift Iso_left_tab Select the previous child +Mod-1 Return Enter in the selected frame - ie make it the root frame +Mod-1 Shift Return Leave the selected frame - ie make its parent the root frame +Mod-1 Home Switch to the root frame +Mod-1 Shift Home Switch and select the root frame + Menu Show all frames info windows until a key is release +Shift Menu Show all frames info windows +Control Menu Show/Hide the root frame +Mod-1 B Move the pointer to the lower right corner of the screen +Control Shift Escape Delete the focus window in all frames and workspaces +Mod-1 Control Shift Escape Destroy the focus window in all frames and workspaces +Control Escape Remove the focus window in the current frame +Shift Escape Unhide all hidden windows into the current child +Mod-1 T Switch to editing mode +Control Less Switch to editing mode +Mod-1 |1| Bind or jump to a slot +Mod-1 |2| Bind or jump to a slot +Mod-1 |3| Bind or jump to a slot +Mod-1 |4| Bind or jump to a slot +Mod-1 |5| Bind or jump to a slot +Mod-1 |6| Bind or jump to a slot +Mod-1 |7| Bind or jump to a slot +Mod-1 |8| Bind or jump to a slot +Mod-1 |9| Bind or jump to a slot +Mod-1 |0| Bind or jump to a slot + + +Mouse buttons actions in main mode: +---------------------------------- + + 1 Move and focus the current frame or focus the current window parent + 3 Resize and focus the current frame or focus the current window parent +Mod-1 1 Move and focus the current child - Create a new frame on the root window +Mod-1 3 Resize and focus the current child - Create a new frame on the root window +Mod-1 Control 1 Move the window under the mouse cursor to another frame + 4 Select the next level in frame + 5 Select the previous level in frame +Mod-1 4 Enter in the selected frame - ie make it the root frame +Mod-1 5 Leave the selected frame - ie make its parent the root frame Second mode keys: ---------------- -Shift Left Resize group left -Shift Right Resize group right -Shift Down Resize group down -Shift Up Resize group up - Left Move, pack, fill or resize group left - Right Move, pack, fill or resize group right - Down Move, pack, fill or resize group down - Up Move, pack, fill or resize group up - M Center the current group -Mod-1 L Resize down the current group - L Resize down the current group to its minimal size - R Resize group to its half width or heigth on next arraw action -Control F Fill group horizontally -Shift F Fill group vertically -Mod-1 F Fill group in all directions - F Fill group on next arrow action (fill in all directions on second f keypress) - P Pack group on next arrow action -Control Shift Y Move all windows in the current workspace to one group and remove other groups -Control Y Create a new group for each window in the current group -Mod-1 Y Reconfigure the workspace tiling for the current session - Y Tile the current workspace with the current window on one side and others on the other -Control Shift T Tile the current workspace horizontally -Control T Tile the current workspace vertically -Mod-1 D Show debuging info -Mod-1 A Force the current window to move in the group (Useful only for transient windows) - A Force the current window to move in the center of the group (Useful only for transient windows) - H start an xclock -Control E start an emacs for another user - E start emacs - C start an xterm -Mod-1 Control O Open each next window in a new group -Mod-1 O Open the next window in a new group and all others in the same group -Control O Open the next window in a numbered workspace - O Open the next window in a new workspace -Mod-1 W Remove the current workspace - W Create a new default workspace -Mod-1 G Remove the current group in the current workspace - G Create a new default group - K Remove the current window in the current group -Mod-1 K Destroy the current window in all groups and workspaces - X Open the fullscreen pager -Mod-1 B Maximize/minimize the current group - B Move the pointer to the lower right corner of the screen and redraw all groups -Mod-1 Shift Tab Rotate down windows in the current group -Mod-1 Tab Rotate up windows in the current group -Mod-1 Control 2 Sort workspaces by numbers -Mod-1 Control 1 Reset workspaces numbers (1 for current workspace, 2 for the second...) -Mod-1 0 Focus workspace 10 -Mod-1 9 Focus workspace 9 -Mod-1 8 Focus workspace 8 -Mod-1 7 Focus workspace 7 -Mod-1 6 Focus workspace 6 -Mod-1 5 Focus workspace 5 -Mod-1 4 Focus workspace 4 -Mod-1 3 Focus workspace 3 -Mod-1 2 Focus workspace 2 -Mod-1 1 Focus workspace 1 -Mod-1 Control Shift Left Circulate down in workspace copying current group in the next workspace -Mod-1 Shift Left Circulate down in workspace moving current group in the next workspace -Mod-1 Left Circulate down in workspace -Mod-1 Control Shift Right Circulate up in workspace copying current group in the next workspace -Mod-1 Shift Right Circulate up in workspace moving current group in the next workspace -Mod-1 Right Circulate up in workspace -Mod-1 Control Shift Down Circulate down in group copying the current window in the next group -Mod-1 Shift Down Circulate down in group moving the current window in the next group -Mod-1 Down Circulate down in group -Mod-1 Control Shift Up Circulate up in group copying the current window in the next group -Mod-1 Shift Up Circulate up in group moving the current window in the next group -Mod-1 Up Circulate up in group -Shift Escape Unhide all hidden windows into the current group -Control Escape Remove the current window in the current group -Mod-1 Control Shift Escape Destroy the current window in all groups and workspaces -Control Shift Escape Delete the current window in all groups and workspaces -Control Return Leave second mode -Control < Leave second mode - Escape Leave second mode - Return Leave second mode and maximize current group - T Leave second mode and maximize current group - ! Run a program from the query input - : Eval a lisp form from the query input +Mod-1 F1 Open the help and info window for the second mode + M Open the main menu + F Open the frame menu + W Open the window menu + N Open the action by name menu + U Open the action by number menu I Identify a key -Control G Stop all pending actions (actions like open in new workspace/group) -Mod-1 F1 Open the help and info window + Colon Eval a lisp form from the query input + Exclam Run a program from the query input + T Leave second mode + Return Leave second mode + Escape Leave second mode +Control < Leave second mode +Mod-1 Control Shift Home Quit clfswm +Mod-1 Right Select the next brother frame +Mod-1 Left Select the previous brother frame +Mod-1 Down Select the previous level in frame +Mod-1 Up Select the next level in frame +Mod-1 Tab Select the next child +Mod-1 Shift Iso_left_tab Select the previous child +Mod-1 Return Enter in the selected frame - ie make it the root frame +Mod-1 Shift Return Leave the selected frame - ie make its parent the root frame +Mod-1 Home Switch to the root frame +Mod-1 Shift Home Switch and select the root frame + Menu Show all frames info windows until a key is release +Mod-1 B Move the pointer to the lower right corner of the screen + O Open the next window in a new frame in the root frame +Control O Open the next window in a new frame in the parent frame +Control Shift Escape Delete the focus window in all frames and workspaces +Mod-1 Control Shift Escape Destroy the focus window in all frames and workspaces +Control Escape Remove the focus window in the current frame +Shift Escape Unhide all hidden windows into the current child +Control X Cut the current child to the selection +Mod-1 Control X Clear the current selection +Control C Copy the current child to the selection +Control V Paste the selection in the current frame +Control Shift V Paste the selection in the current frame - Do not clear the selection after paste + Delete Remove the current child from its parent frame + C start an xterm + E start emacs +Control E start an emacs for another user + H start an xclock +Shift Menu Show all frames info windows +Control Menu Show/Hide the root frame +Mod-1 |1| Bind or jump to a slot +Mod-1 |2| Bind or jump to a slot +Mod-1 |3| Bind or jump to a slot +Mod-1 |4| Bind or jump to a slot +Mod-1 |5| Bind or jump to a slot +Mod-1 |6| Bind or jump to a slot +Mod-1 |7| Bind or jump to a slot +Mod-1 |8| Bind or jump to a slot +Mod-1 |9| Bind or jump to a slot +Mod-1 |0| Bind or jump to a slot Mouse buttons actions in second mode: ------------------------------------ - Motion -Move or resize group. Move window from a group to another. -Go to top left or rigth corner to change workspaces. -Mod-1 5 Circulate down in workspaces -Mod-1 4 Circulate up in workspaces - 5 Rotate window down - 4 Rotate window up -Control 3 Copy selected window - 3 Move selected window -Control 2 Leave second mode - 2 Leave second mode and maximize current group -Control 1 Copy selected group -Mod-1 1 Resize selected group - 1 Move selected group or create a new group on the root window - - -Pager mode keys: ---------------- - -Mod-1 Control 2 Sort workspaces by numbers -Mod-1 Control 1 Reset workspaces numbers (1 for current workspace, 2 for the second...) -Mod-1 0 Focus workspace 10 -Mod-1 9 Focus workspace 9 -Mod-1 8 Focus workspace 8 -Mod-1 7 Focus workspace 7 -Mod-1 6 Focus workspace 6 -Mod-1 5 Focus workspace 5 -Mod-1 4 Focus workspace 4 -Mod-1 3 Focus workspace 3 -Mod-1 2 Focus workspace 2 -Mod-1 1 Focus workspace 1 -Control Shift Right Copy the current group to the next workspace -Control Shift Left Copy the current group to the previous workspace -Shift Up Move the current window to the previous line -Shift Down Move the current window to the next line -Shift Right Move the current group to the next workspace -Shift Left Move the current group to the previous workspace -Mod-1 Control Left Resize group left -Mod-1 Control Right Resize group right -Mod-1 Control Down Resize group down -Mod-1 Control Up Resize group up -Mod-1 Left Move group left -Mod-1 Right Move group right -Mod-1 Down Move group down -Mod-1 Up Move group up - M Center the current group - Left Move cursor, pack, fill or resize group left - Right Move cursor, pack, fill or resize group right - Down Move cursor, pack, fill or resize group down - Up Move cursor, pack, fill or resize group up -Mod-1 L Resize down the current group - L Resize down the current group to its minimal size -Control F Fill group horizontally -Shift F Fill group vertically -Mod-1 F Fill group in all directions - F Fill group on next arrow action (fill in all directions on second f keypress) -Shift R Resize group on next arrow action - R Resize group to its half width or heigth on next arrow action -Shift M Move group on next arrow action - P Pack group on next arrow action -Control Shift Y Move all windows in the current workspace to one group and remove other groups -Control Y Create a new group for each window in the current group - Y Tile the current workspace with the current window on one side and others on the other -Shift T Tile the current workspace horizontally - T Tile the current workspace vertically -Mod-1 X Swap the current window with the next window -Control X Swap the current group with the next group - X Swap the current workspace with the next workspace -Mod-1 W Remove the current workspace - W Create a new default workspace -Mod-1 G Remove the current group in the current workspace - G Create a new default group -Shift Escape Unhide all hidden windows into the current group -Control Escape Remove the current window in the current group -Mod-1 Control Shift Escape Destroy the current window in all groups and workspaces -Control Shift Escape Delete the current window in all groups and workspaces -Mod-1 Shift Tab Rotate down windows in the current group -Mod-1 Tab Rotate up windows in the current group - End Select the last workspace - Home Select the first workspace - B Move the pointer to the lower right corner of the screen and redraw all groups - Escape Leave the pager mode - Return Leave the pager mode -Control G Stop all pending actions (actions like open in new workspace/group) -Mod-1 F1 Open the help and info window - - -Mouse buttons actions in pager mode: ------------------------------------ - - Motion Select workspaces - 5 Rotate down windows in selected group - 4 Rotate up windows in selected group -Control 3 Copy selected window - 3 Move selected window - 2 Leave the pager mode -Control 1 Copy selected group - 1 Move selected group + 1 Move and focus the current child - Create a new frame on the root window + 3 Resize and focus the current child - Create a new frame on the root window +Mod-1 1 Move and focus the current child - Create a new frame on the root window +Mod-1 3 Resize and focus the current child - Create a new frame on the root window +Mod-1 Control 1 Move the window under the mouse cursor to another frame + 4 Select the next level in frame + 5 Select the previous level in frame +Mod-1 4 Enter in the selected frame - ie make it the root frame +Mod-1 5 Leave the selected frame - ie make its parent the root frame Info mode keys: -------------- - Page_up Move ten lines up - Page_down Move ten lines down - End Move to last line - Home Move to first line - Right Move one char right - Left Move one char left - Up Move one line up - Down Move one line down - Twosuperior Move the pointer to the lower right corner of the screen - Leave the info mode - Escape Leave the info mode - Return Leave the info mode Q Leave the info mode + Return Leave the info mode + Escape Leave the info mode + Leave the info mode + Twosuperior Move the pointer to the lower right corner of the screen + Down Move one line down + Up Move one line up + Left Move one char left + Right Move one char right + Home Move to first line + End Move to last line + Page_down Move ten lines down + Page_up Move ten lines up Mouse buttons actions in info mode: ---------------------------------- - Motion Grab text - 5 Move one line down - 4 Move one line up - 2 Leave the info mode 1 Begin grab text + 2 Leave the info mode + 4 Move one line up + 5 Move one line down + Clfswm::motion Grab text Added: clfswm/doc/menu.html ============================================================================== --- (empty file) +++ clfswm/doc/menu.html Wed Apr 30 18:05:17 2008 @@ -0,0 +1,290 @@ + + + + CLFSWM Menu + + + +

+ + CLFSWM Menu + +

+

+ Here is the map of the CLFSWM menu: + (By default it is bound on second-mode + m) +

+

+ Main +

+

+ f: < Frame menu > +

+

+ w: < Window menu > +

+

+ s: < Selection menu > +

+

+ n: < Action by name menu > +

+

+ u: < Action by number menu > +

+

+ y: < Utility menu > +

+
+

+ Frame-Menu +

+

+ a: < Adding frame menu > +

+

+ l: < Frame layout menu > +

+

+ o: < Frame layout menu (Set only once) > +

+

+ n: < Frame new window hook menu > +

+

+ m: < Frame movement menu > +

+

+ w: < Managed window type menu > +

+

+ i: < Frame info menu > +

+

+ r: Rename the current child +

+

+ u: Renumber the current frame +

+

+ x: Create a new frame for each window in frame +

+
+

+ Frame-Adding-Menu +

+

+ a: Add a default frame +

+

+ p: Add a placed frame +

+
+

+ Frame-Movement-Menu +

+

+ p: < Frame pack menu > +

+

+ f: < Frame fill menu > +

+

+ r: < Frame resize menu > +

+

+ c: Center the current frame +

+
+

+ Frame-Pack-Menu +

+

+ Up: Pack the current frame up +

+

+ Down: Pack the current frame down +

+

+ Left: Pack the current frame left +

+

+ Right: Pack the current frame right +

+
+

+ Frame-Fill-Menu +

+

+ Up: Fill the current frame up +

+

+ Down: Fill the current frame down +

+

+ Left: Fill the current frame left +

+

+ Right: Fill the current frame right +

+

+ a: Fill the current frame in all directions +

+

+ v: Fill the current frame vertically +

+

+ h: Fill the current frame horizontally +

+
+

+ Frame-Resize-Menu +

+

+ Up: Resize the current frame up to its half height +

+

+ Down: Resize the current frame down to its half height +

+

+ Left: Resize the current frame left to its half width +

+

+ Right: Resize the current frame right to its half width +

+

+ d: Resize down the current frame +

+

+ a: Resize down the current frame to its minimal size +

+
+

+ Managed-Window-Menu +

+

+ m: Change window types to be managed by a frame +

+

+ a: Manage all window type +

+

+ n: Manage only normal window type +

+

+ u: Do not manage any window type +

+
+

+ Frame-Info-Menu +

+

+ s: Show all frames info windows +

+

+ h: Hide all frames info windows +

+
+

+ Window-Menu +

+

+ i: Display information on the current window +

+

+ f: Force the current window to move in the frame (Useful only for transient windows) +

+

+ c: Force the current window to move in the center of the frame (Useful only for transient windows) +

+

+ m: Force to manage the current window by its parent frame +

+

+ u: Force to not manage the current window by its parent frame +

+

+ a: Adapt the current frame to the current window minimal size hints +

+

+ w: Adapt the current frame to the current window minimal width hint +

+

+ h: Adapt the current frame to the current window minimal height hint +

+
+

+ Selection-Menu +

+

+ x: Cut the current child to the selection +

+

+ c: Copy the current child to the selection +

+

+ v: Paste the selection in the current frame +

+

+ p: Paste the selection in the current frame - Do not clear the selection after paste +

+

+ Delete: Remove the current child from its parent frame +

+

+ z: Clear the current selection +

+
+

+ Action-By-Name-Menu +

+

+ f: Focus a frame by name +

+

+ o: Open a new frame in a named frame +

+

+ d: Delete a frame by name +

+

+ m: Move current child in a named frame +

+

+ c: Copy current child in a named frame +

+
+

+ Action-By-Number-Menu +

+

+ f: Focus a frame by number +

+

+ o: Open a new frame in a numbered frame +

+

+ d: Delete a frame by number +

+

+ m: Move current child in a numbered frame +

+

+ c: Copy current child in a numbered frame +

+
+

+ Utility-Menu +

+

+ i: Identify a key +

+

+ colon: Eval a lisp form from the query input +

+

+ exclam: Run a program from the query input +

+
+ + Added: clfswm/doc/menu.txt ============================================================================== --- (empty file) +++ clfswm/doc/menu.txt Wed Apr 30 18:05:17 2008 @@ -0,0 +1,102 @@ +Here is the map of the CLFSWM menu: +(By default it is bound on second-mode + m) + +Main +f: < Frame menu > +w: < Window menu > +s: < Selection menu > +n: < Action by name menu > +u: < Action by number menu > +y: < Utility menu > + +Frame-Menu +a: < Adding frame menu > +l: < Frame layout menu > +o: < Frame layout menu (Set only once) > +n: < Frame new window hook menu > +m: < Frame movement menu > +w: < Managed window type menu > +i: < Frame info menu > +r: Rename the current child +u: Renumber the current frame +x: Create a new frame for each window in frame + +Frame-Adding-Menu +a: Add a default frame +p: Add a placed frame + +Frame-Movement-Menu +p: < Frame pack menu > +f: < Frame fill menu > +r: < Frame resize menu > +c: Center the current frame + +Frame-Pack-Menu +Up: Pack the current frame up +Down: Pack the current frame down +Left: Pack the current frame left +Right: Pack the current frame right + +Frame-Fill-Menu +Up: Fill the current frame up +Down: Fill the current frame down +Left: Fill the current frame left +Right: Fill the current frame right +a: Fill the current frame in all directions +v: Fill the current frame vertically +h: Fill the current frame horizontally + +Frame-Resize-Menu +Up: Resize the current frame up to its half height +Down: Resize the current frame down to its half height +Left: Resize the current frame left to its half width +Right: Resize the current frame right to its half width +d: Resize down the current frame +a: Resize down the current frame to its minimal size + +Managed-Window-Menu +m: Change window types to be managed by a frame +a: Manage all window type +n: Manage only normal window type +u: Do not manage any window type + +Frame-Info-Menu +s: Show all frames info windows +h: Hide all frames info windows + +Window-Menu +i: Display information on the current window +f: Force the current window to move in the frame (Useful only for transient windows) +c: Force the current window to move in the center of the frame (Useful only for transient windows) +m: Force to manage the current window by its parent frame +u: Force to not manage the current window by its parent frame +a: Adapt the current frame to the current window minimal size hints +w: Adapt the current frame to the current window minimal width hint +h: Adapt the current frame to the current window minimal height hint + +Selection-Menu +x: Cut the current child to the selection +c: Copy the current child to the selection +v: Paste the selection in the current frame +p: Paste the selection in the current frame - Do not clear the selection after paste +Delete: Remove the current child from its parent frame +z: Clear the current selection + +Action-By-Name-Menu +f: Focus a frame by name +o: Open a new frame in a named frame +d: Delete a frame by name +m: Move current child in a named frame +c: Copy current child in a named frame + +Action-By-Number-Menu +f: Focus a frame by number +o: Open a new frame in a numbered frame +d: Delete a frame by number +m: Move current child in a numbered frame +c: Copy current child in a numbered frame + +Utility-Menu +i: Identify a key +colon: Eval a lisp form from the query input +exclam: Run a program from the query input Added: clfswm/src/clfswm-autodoc.lisp ============================================================================== --- (empty file) +++ clfswm/src/clfswm-autodoc.lisp Wed Apr 30 18:05:17 2008 @@ -0,0 +1,198 @@ +;;; -------------------------------------------------------------------------- +;;; CLFSWM - FullScreen Window Manager +;;; +;;; -------------------------------------------------------------------------- +;;; Documentation: Auto documentation tools +;;; -------------------------------------------------------------------------- +;;; +;;; (C) 2005 Philippe Brochard +;;; +;;; This program is free software; you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program; if not, write to the Free Software +;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +;;; +;;; -------------------------------------------------------------------------- + +(in-package :clfswm) + + +(defun produce-doc-html (hash-table-key-list &optional (stream t)) + "Produce an html doc from a hash-table key" + (labels ((clean-string (str) + (cond ((string-equal str "#\\:") ":") + ((string-equal str "#\\#") "#") + ((string-equal str "#\\\\") "\\") + (t (substitute #\Space #\# + (substitute #\Space #\\ + (substitute #\Space #\: str)))))) + (produce-keys (hk) + `("table class=\"ex\" cellspacing=\"5\" border=\"0\" width=\"100%\"" + (tr ("th align=\"right\" width=\"10%\"" "Modifiers") + ("th align=\"center\" width=\"10%\"" "Key/Button") + ("th align=\"left\"" "Function")) + ,@(let ((acc nil)) + (maphash #'(lambda (k v) + (when (consp k) + (push `(tr + ("td align=\"right\" style=\"color:#FF0000\" nowrap" + ,(clean-string (format nil "~{~@(~S ~)~}" (state->modifiers (second k))))) + ("td align=\"center\" nowrap" + ,(clean-string (format nil "~@(~S~)" + (or (and (stringp (first k)) + (intern (string-upcase (first k)))) + (first k))))) + ("td style=\"color:#0000FF\" nowrap" ,(documentation (or (first v) (third v)) 'function))) + acc))) + hk) + (nreverse acc))))) + (produce-html + `(html + (head + (title "CLFSWM Keys")) + (body + (h1 "CLFSWM Keys") + (p (small "Note: Mod-1 is the Meta or Alt key")) + ,@(let ((acc nil)) + (dolist (hk hash-table-key-list) + (push `(h3 (u ,(gethash 'name hk))) acc) + (push (produce-keys hk) acc)) + (nreverse acc)))) + 0 stream))) + + +(defun produce-doc-html-in-file (filename) + (with-open-file (stream filename :direction :output + :if-exists :supersede :if-does-not-exist :create) + (produce-doc-html (list *main-keys* *main-mouse* *second-keys* *second-mouse* + *info-keys* *info-mouse*) + stream))) + + + +(defun produce-doc (hash-table-key-list &optional (stream t)) + "Produce a text doc from a hash-table key" + (format stream " * CLFSWM Keys *~%") + (format stream " -----------~%") + (format stream "~%Note: Mod-1 is the Meta or Alt key~%") + (dolist (hk hash-table-key-list) + (format stream "~2&~A:~%" (gethash 'name hk)) + (dotimes (i (length (gethash 'name hk))) + (format stream "-")) + (format stream "~2%") + (maphash #'(lambda (k v) + (when (consp k) + (format stream "~&~20@<~{~@(~A~) ~}~> ~13@<~@(~A~)~> ~A~%" + (state->modifiers (second k)) + (remove #\# (remove #\\ (format nil "~S" (or (and (stringp (first k)) + (intern (string-upcase (first k)))) + (first k))))) + (documentation (or (first v) (third v)) 'function)))) + hk) + (format stream "~2&"))) + + + +(defun produce-doc-in-file (filename) + (with-open-file (stream filename :direction :output + :if-exists :supersede :if-does-not-exist :create) + (produce-doc (list *main-keys* *main-mouse* *second-keys* *second-mouse* + *info-keys* *info-mouse*) + stream))) + + + + + +;;; Menu autodoc functions +(defun produce-menu-doc (&optional (stream t)) + (labels ((rec (base) + (format stream "~2&~:(~A~)~%" (menu-name base)) + (dolist (item (menu-item base)) + (typecase item + (menu (format stream "~A: ~A~%" (menu-name item) (menu-doc item))) + (menu-item (format stream "~A: ~A~%" (menu-item-key item) + (typecase (menu-item-value item) + (menu (format nil "< ~A >" (menu-doc (menu-item-value item)))) + (t (documentation (menu-item-value item) 'function))))))) + (dolist (item (menu-item base)) + (typecase item + (menu (rec item)) + (menu-item (when (menu-p (menu-item-value item)) + (rec (menu-item-value item)))))))) + (format stream "Here is the map of the CLFSWM menu:~%") + (format stream "(By default it is bound on second-mode + m)~%") + (rec *menu*))) + + + +(defun produce-menu-doc-in-file (filename) + (with-open-file (stream filename :direction :output + :if-exists :supersede :if-does-not-exist :create) + (produce-menu-doc stream))) + + + + +(defun produce-menu-doc-html (&optional (stream t)) + (let ((menu-list nil)) + (labels ((rec (base parent) + (push `(h3 ,(format nil "~:(~A~)" + (menu-name base) + (if parent (menu-name parent) "Top") + (menu-name base))) menu-list) + (dolist (item (menu-item base)) + (typecase item + (menu (push `(p ,(format nil "~A: ~A" (menu-name item) (menu-doc item))) menu-list)) + (menu-item (push `(p ,(format nil "~A: ~A" (menu-item-key item) + (typecase (menu-item-value item) + (menu (format nil "< ~A >" + (menu-name (menu-item-value item)) + (menu-doc (menu-item-value item)))) + (t (documentation (menu-item-value item) 'function))))) + menu-list)))) + (push '
menu-list) + (dolist (item (menu-item base)) + (typecase item + (menu (rec item base)) + (menu-item (when (menu-p (menu-item-value item)) + (rec (menu-item-value item) base))))))) + (rec *menu* nil) + (produce-html `(html + (head + (title "CLFSWM Menu")) + (body + (h1 ("a name=\"Top\"" "CLFSWM Menu")) + (p "Here is the map of the CLFSWM menu:" + "(By default it is bound on second-mode + m)") + ,@(nreverse menu-list))) + 0 stream)))) + + +(defun produce-menu-doc-html-in-file (filename) + (with-open-file (stream filename :direction :output + :if-exists :supersede :if-does-not-exist :create) + (produce-menu-doc-html stream))) + + + + + + + +(defun produce-all-docs () + "Produce all docs in keys.html and keys.txt" + (produce-doc-in-file "doc/keys.txt") + (produce-doc-html-in-file "doc/keys.html") + (produce-menu-doc-in-file "doc/menu.txt") + (produce-menu-doc-html-in-file "doc/menu.html")) + Modified: clfswm/src/clfswm-keys.lisp ============================================================================== --- clfswm/src/clfswm-keys.lisp (original) +++ clfswm/src/clfswm-keys.lisp Wed Apr 30 18:05:17 2008 @@ -194,96 +194,3 @@ -;;;,----- -;;;| Auto documentation tools -;;;`----- - -(defun produce-doc-html (hash-table-key-list &optional (stream t)) - "Produce an html doc from a hash-table key" - (labels ((clean-string (str) - (cond ((string-equal str "#\\:") ":") - ((string-equal str "#\\#") "#") - ((string-equal str "#\\\\") "\\") - (t (substitute #\Space #\# - (substitute #\Space #\\ - (substitute #\Space #\: str)))))) - (produce-keys (hk) - `("table class=\"ex\" cellspacing=\"5\" border=\"0\" width=\"100%\"" - (tr ("th align=\"right\" width=\"10%\"" "Modifiers") - ("th align=\"center\" width=\"10%\"" "Key/Button") - ("th align=\"left\"" "Function")) - ,@(let ((acc nil)) - (maphash #'(lambda (k v) - (when (consp k) - (push `(tr - ("td align=\"right\" style=\"color:#FF0000\" nowrap" - ,(clean-string (format nil "~{~@(~S ~)~}" (state->modifiers (second k))))) - ("td align=\"center\" nowrap" - ,(clean-string (format nil "~@(~S~)" - (or (and (stringp (first k)) - (intern (string-upcase (first k)))) - (first k))))) - ("td style=\"color:#0000FF\" nowrap" ,(documentation (or (first v) (third v)) 'function))) - acc))) - hk) - (nreverse acc))))) - (produce-html - `(html - (head - (title "CLFSWM Keys")) - (body - (h1 "CLFSWM Keys") - (p (small "Note: Mod-1 is the Meta or Alt key")) - ,@(let ((acc nil)) - (dolist (hk hash-table-key-list) - (push `(h3 (u ,(gethash 'name hk))) acc) - (push (produce-keys hk) acc)) - (nreverse acc)))) - 0 stream))) - - -(defun produce-doc-html-in-file (filename) - (with-open-file (stream filename :direction :output - :if-exists :supersede :if-does-not-exist :create) - (produce-doc-html (list *main-keys* *main-mouse* *second-keys* *second-mouse* - *info-keys* *info-mouse*) - stream))) - - - -(defun produce-doc (hash-table-key-list &optional (stream t)) - "Produce a text doc from a hash-table key" - (format stream " * CLFSWM Keys *~%") - (format stream " -----------~%") - (format stream "~%Note: Mod-1 is the Meta or Alt key~%") - (dolist (hk hash-table-key-list) - (format stream "~2&~A:~%" (gethash 'name hk)) - (dotimes (i (length (gethash 'name hk))) - (format stream "-")) - (format stream "~2%") - (maphash #'(lambda (k v) - (when (consp k) - (format stream "~&~20@<~{~@(~A~) ~}~> ~13@<~@(~A~)~> ~A~%" - (state->modifiers (second k)) - (remove #\# (remove #\\ (format nil "~S" (or (and (stringp (first k)) - (intern (string-upcase (first k)))) - (first k))))) - (documentation (or (first v) (third v)) 'function)))) - hk) - (format stream "~2&"))) - - - -(defun produce-doc-in-file (filename) - (with-open-file (stream filename :direction :output - :if-exists :supersede :if-does-not-exist :create) - (produce-doc (list *main-keys* *main-mouse* *second-keys* *second-mouse* - *info-keys* *info-mouse*) - stream))) - - -(defun produce-all-docs () - "Produce all docs in keys.html and keys.txt" - (produce-doc-in-file "keys.txt") - (produce-doc-html-in-file "keys.html")) - Modified: clfswm/src/clfswm-menu.lisp ============================================================================== --- clfswm/src/clfswm-menu.lisp (original) +++ clfswm/src/clfswm-menu.lisp Wed Apr 30 18:05:17 2008 @@ -26,13 +26,6 @@ (in-package :clfswm) -(defstruct menu name item doc) -(defstruct menu-item key value) - - -(defvar *menu* (make-menu :name 'main)) - - (defmacro with-all-menu ((menu item) &body body) (let ((rec (gensym)) (subm (gensym))) Modified: clfswm/src/package.lisp ============================================================================== --- clfswm/src/package.lisp (original) +++ clfswm/src/package.lisp Wed Apr 30 18:05:17 2008 @@ -125,17 +125,12 @@ (defparameter *info-mouse* (make-hash-table :test 'equal)) -(defparameter *open-next-window-in-new-workspace* nil - "Set to t to open the next window in a new workspace -or to a number to open in a numbered workspace") - -(defparameter *open-next-window-in-new-frame* nil - "Set to t to open the each next window in a new frame -or set to :once open the next window in a new frame and all -others in the same frame") -(defparameter *arrow-action* nil - "Arrow action in the second mode") +(defstruct menu name item doc) +(defstruct menu-item key value) + + +(defvar *menu* (make-menu :name 'main :doc "Main menu")) ;;; Main mode hooks (set in clfswm.lisp) @@ -173,14 +168,6 @@ -;;; Second mode global variables -(defparameter *motion-action* nil) -(defparameter *motion-object* nil) -(defparameter *motion-start-frame* nil) -(defparameter *motion-dx* nil) -(defparameter *motion-dy* nil) - - ;; For debug - redefine defun ;;(shadow :defun) ;; From pbrochard at common-lisp.net Wed Apr 30 22:08:35 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Wed, 30 Apr 2008 18:08:35 -0400 (EDT) Subject: [clfswm-cvs] r105 - clfswm Message-ID: <20080430220835.4541C3D0B5@common-lisp.net> Author: pbrochard Date: Wed Apr 30 18:08:34 2008 New Revision: 105 Modified: clfswm/TODO Log: update the TODO file Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Wed Apr 30 18:08:34 2008 @@ -7,23 +7,8 @@ =============== Should handle these soon. -- Move the autodoc in its own file (clfswm-autodoc.lisp) and make the autodoc - for the menu system. - - -LESS URGENT TODO -================ - -- Hook to open next window in named/numbered frame [Philippe] - - Ensure-unique-number/name (new function) [Philippe] -- Raise/lower frame - this can be done with children order [Philippe] - -- Show config -> list and display documentation for all tweakable global variables. [Philippe] - -- A Gimp layout example [Philippe] - - Add boundaries in the info window [Philippe] @@ -59,3 +44,11 @@ - Undo/redo (any idea to implement this is welcome) - Double buffering for all text windows. + +- Raise/lower frame - this can be done with children order [Philippe] + +- Show config -> list and display documentation for all tweakable global variables. [Philippe] + +- A Gimp layout example [Philippe] + +- Hook to open next window in named/numbered frame [Philippe] From pbrochard at common-lisp.net Wed Apr 30 22:20:31 2008 From: pbrochard at common-lisp.net (pbrochard at common-lisp.net) Date: Wed, 30 Apr 2008 18:20:31 -0400 (EDT) Subject: [clfswm-cvs] r106 - clfswm Message-ID: <20080430222031.3A90F5319B@common-lisp.net> Author: pbrochard Date: Wed Apr 30 18:20:30 2008 New Revision: 106 Modified: clfswm/TODO Log: update the TODO file Modified: clfswm/TODO ============================================================================== --- clfswm/TODO (original) +++ clfswm/TODO Wed Apr 30 18:20:30 2008 @@ -7,6 +7,9 @@ =============== Should handle these soon. +- Produce the autodoc menu for Frame layout menu, Frame layout menu (Set only once) + and Frame new window hook menu + - Ensure-unique-number/name (new function) [Philippe] - Add boundaries in the info window [Philippe]