sawfish r4263 - in trunk: . lisp/sawfish/wm/commands man
- From: gsromero svn gnome org
- To: svn-commits-list gnome org
- Subject: sawfish r4263 - in trunk: . lisp/sawfish/wm/commands man
- Date: Wed, 6 Aug 2008 01:03:25 +0000 (UTC)
Author: gsromero
Date: Wed Aug 6 01:03:25 2008
New Revision: 4263
URL: http://svn.gnome.org/viewvc/sawfish?rev=4263&view=rev
Log:
Added after-cycle-step-hook and related docs, originally by Teika
kazura. Changed some white space in the process.
Modified:
trunk/ChangeLog
trunk/lisp/sawfish/wm/commands/x-cycle.jl
trunk/man/sawmill.texi
Modified: trunk/lisp/sawfish/wm/commands/x-cycle.jl
==============================================================================
--- trunk/lisp/sawfish/wm/commands/x-cycle.jl (original)
+++ trunk/lisp/sawfish/wm/commands/x-cycle.jl Wed Aug 6 01:03:25 2008
@@ -127,6 +127,9 @@
:group bindings
:type keymap)
+ (defvar after-cycle-step-hook '()
+ "Window hook called after each step of window cycling.")
+
;; variables
@@ -167,46 +170,47 @@
(define (cycle-next windows count)
(fluid-set x-cycle-windows windows)
(let ((win (window-order (if cycle-all-workspaces
- nil
- current-workspace)
- cycle-include-iconified cycle-all-viewports)))
+ nil
+ current-workspace)
+ cycle-include-iconified cycle-all-viewports)))
(setq win (delete-if (lambda (w)
- (not (memq w windows))) win))
+ (not (memq w windows))) win))
(unless win
- (throw 'x-cycle-exit t))
+ (throw 'x-cycle-exit t))
(if (fluid x-cycle-current)
- (when (or (window-get (fluid x-cycle-current) 'iconified)
- (not (window-appears-in-workspace-p
- (fluid x-cycle-current) current-workspace)))
- (hide-window (fluid x-cycle-current)))
- ;; first call, push the currently focused window onto
- ;; the top of the stack
- (when (input-focus)
- (fluid-set x-cycle-current (input-focus))
- (window-order-push (fluid x-cycle-current))
- (setq win (cons (fluid x-cycle-current)
- (delq (fluid x-cycle-current) win)))))
+ (when (or (window-get (fluid x-cycle-current) 'iconified)
+ (not (window-appears-in-workspace-p
+ (fluid x-cycle-current) current-workspace)))
+ (hide-window (fluid x-cycle-current)))
+ ;; first call, push the currently focused window onto
+ ;; the top of the stack
+ (when (input-focus)
+ (fluid-set x-cycle-current (input-focus))
+ (window-order-push (fluid x-cycle-current))
+ (setq win (cons (fluid x-cycle-current)
+ (delq (fluid x-cycle-current) win)))))
(when (fluid x-cycle-stacking)
- (restack-windows (fluid x-cycle-stacking))
- (fluid-set x-cycle-stacking nil))
+ (restack-windows (fluid x-cycle-stacking))
+ (fluid-set x-cycle-stacking nil))
(if (fluid x-cycle-current)
- (setq win (forwards win (fluid x-cycle-current) count))
- (setq win (car win)))
+ (setq win (forwards win (fluid x-cycle-current) count))
+ (setq win (car win)))
(fluid-set x-cycle-current win)
(when (not (window-get win 'sticky))
- (select-workspace (nearest-workspace-with-window
- win current-workspace)))
+ (select-workspace (nearest-workspace-with-window
+ win current-workspace)))
(move-viewport-to-window win)
(when (window-get win 'iconified)
- (show-window win))
+ (show-window win))
(when cycle-raise-windows
- (fluid-set x-cycle-stacking (stacking-order))
- (raise-window* win))
+ (fluid-set x-cycle-stacking (stacking-order))
+ (raise-window* win))
(when cycle-show-window-names
- (cycle-display-message))
+ (cycle-display-message))
(when (window-really-wants-input-p win)
- (set-input-focus win))
- (allow-events 'sync-keyboard)))
+ (set-input-focus win))
+ (allow-events 'sync-keyboard)
+ (call-window-hook 'after-cycle-step-hook win)))
(define (cycle-begin windows step)
"Cycle through all windows in order of recent selections."
Modified: trunk/man/sawmill.texi
==============================================================================
--- trunk/man/sawmill.texi (original)
+++ trunk/man/sawmill.texi Wed Aug 6 01:03:25 2008
@@ -5577,6 +5577,7 @@
* Window Destruction Hooks::
* Window Mapping Hooks::
* Window Motion Hooks::
+* Window Cycling Hooks::
* X Hooks::
* Pointer Motion Hooks::
* Workspace Hooks::
@@ -5698,7 +5699,7 @@
@end defvr
- node Window Motion Hooks, X Hooks, Window Mapping Hooks, Standard Hooks
+ node Window Motion Hooks, Window Cycling Hooks, Window Mapping Hooks, Standard Hooks
@section Window Motion Hooks
@cindex Window Motion Hooks
@cindex Hooks, Window Motion
@@ -5749,8 +5750,16 @@
@code{x-lower-window}. The hook functions take no arguments.
@end defvr
+ node Window Cycling Hooks, X Hooks, Window Motion Hooks, Standard Hooks
+ section Window Cycling Hooks
+ cindex Window Cycling Hooks
+ cindex Hooks, Window Cycling
- node X Hooks, Pointer Motion Hooks, Window Motion Hooks, Standard Hooks
+ defvr {Window Hook} after-cycle-step-hook
+Called after each step of window cycling. (See @ref{Cycling Between Windows}.)
+ end defvr
+
+ node X Hooks, Pointer Motion Hooks, Window Cycling Hooks, Standard Hooks
@section X Hooks
@cindex X Hooks
@cindex Hooks, X
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]