[sawfish] All hooks are now initialized to nil.



commit 4769dcd991ea7237463d79098534b34ac0ca4141
Author: Teika kazura <teika lavabit com>
Date:   Sat Feb 12 19:35:39 2011 +0900

    All hooks are now initialized to nil.
    
    `remove-hook' doesn't consider if it's bound or not, so this is better to avoid error. (All means all defined in Sawfish.)

 lisp/sawfish/wm/commands/move-resize.jl |    7 +++++++
 lisp/sawfish/wm/state/iconify.jl        |    3 +++
 lisp/sawfish/wm/state/shading.jl        |    3 +++
 lisp/sawfish/wm/swapper.jl              |    2 ++
 lisp/sawfish/wm/util/workarea.jl        |    2 ++
 lisp/sawfish/wm/viewport.jl             |    3 +++
 lisp/sawfish/wm/windows.jl              |    2 ++
 src/events.c                            |   21 +++++++++++++++++++++
 src/flippers.c                          |    2 ++
 src/functions.c                         |    1 +
 src/keys.c                              |    1 +
 src/windows.c                           |    8 ++++++++
 12 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/lisp/sawfish/wm/commands/move-resize.jl b/lisp/sawfish/wm/commands/move-resize.jl
index 389337c..f2c0c9f 100644
--- a/lisp/sawfish/wm/commands/move-resize.jl
+++ b/lisp/sawfish/wm/commands/move-resize.jl
@@ -150,6 +150,13 @@ its edges with an edge of another window.")
   (defvar move-resize-moving-edges nil)
   (defvar move-resize-directions nil)
 
+  (defvar while-moving-hook nil)
+  (defvar while-resizing-hook nil)
+  (defvar before-move-hook nil)
+  (defvar after-move-hook nil)
+  (defvar before-resize-hook nil)
+  (defvar after-resize-hook nil)
+
   (define (delete-unmovable-directions directions)
     (when move-lock-when-maximized
       (when (window-maximized-vertically-p move-resize-window)
diff --git a/lisp/sawfish/wm/state/iconify.jl b/lisp/sawfish/wm/state/iconify.jl
index 766ca3b..823c35c 100644
--- a/lisp/sawfish/wm/state/iconify.jl
+++ b/lisp/sawfish/wm/state/iconify.jl
@@ -83,6 +83,9 @@
     :type (choice none transients group)
     :group min-max)
 
+  (defvar iconify-window-hook nil)
+  (defvar uniconify-window-hook nil)
+
   (define (window-iconified-p w) (window-get w 'iconified))
 
   (define (window-iconifiable-p w)
diff --git a/lisp/sawfish/wm/state/shading.jl b/lisp/sawfish/wm/state/shading.jl
index cd32590..37445df 100644
--- a/lisp/sawfish/wm/state/shading.jl
+++ b/lisp/sawfish/wm/state/shading.jl
@@ -42,6 +42,9 @@
   (defvar raise-windows-when-unshaded nil
     "Raise windows when they are unshaded.")
 
+  (defvar shade-window-hook nil)
+  (defvar unshade-window-hook nil)
+
   (define (window-shaded-p w) (window-get w 'shaded))
 
   (define (shade-window w)
diff --git a/lisp/sawfish/wm/swapper.jl b/lisp/sawfish/wm/swapper.jl
index 018578e..74e9511 100644
--- a/lisp/sawfish/wm/swapper.jl
+++ b/lisp/sawfish/wm/swapper.jl
@@ -30,6 +30,8 @@
           sawfish.wm.viewport
           sawfish.wm.frames)
 
+  (defvar after-workspace-swap-in-hook nil)
+  
 ;;; default swappers
 
   (define (workspace-swap-out w space)
diff --git a/lisp/sawfish/wm/util/workarea.jl b/lisp/sawfish/wm/util/workarea.jl
index 71090bf..17251df 100644
--- a/lisp/sawfish/wm/util/workarea.jl
+++ b/lisp/sawfish/wm/util/workarea.jl
@@ -36,6 +36,8 @@
           sawfish.wm.viewport
 	  sawfish.wm.misc)
 
+  (defvar workarea-changed-hook nil)
+  
   (define (define-window-strut w left top right bottom)
     (let ((new (list left top right bottom))
 	  (old (window-get w 'workarea-strut)))
diff --git a/lisp/sawfish/wm/viewport.jl b/lisp/sawfish/wm/viewport.jl
index 79feda7..36f5b9c 100644
--- a/lisp/sawfish/wm/viewport.jl
+++ b/lisp/sawfish/wm/viewport.jl
@@ -95,6 +95,9 @@ the change is instantaneous."
   (defvar workspace-viewport-data nil
     "Information about the viewport details of different workspaces.")
 
+  (defvar viewport-moved-hook nil)
+  (defvar viewport-resized-hook nil)
+  
 ;;; raw viewport handling
 
   ;; The unit is pixel, NOT (col, row).
diff --git a/lisp/sawfish/wm/windows.jl b/lisp/sawfish/wm/windows.jl
index 12f9ba4..8d3cdf4 100644
--- a/lisp/sawfish/wm/windows.jl
+++ b/lisp/sawfish/wm/windows.jl
@@ -122,6 +122,8 @@
   (defvar dock-window-depth 0
     "The stacking depth of dock windows.")
 
+  (defvar activate-window-hook nil)
+
 ;;; finding windows, reading properties
 
   (define (get-window-by-name name #!key regex icon)
diff --git a/src/events.c b/src/events.c
index 6e5d41c..1d2b8de 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1984,6 +1984,27 @@ events_init (void)
     rep_INTERN_SPECIAL(window_state_change_hook);
     rep_INTERN_SPECIAL(randr_change_notify_hook);
 
+    Fset(Qvisibility_notify_hook, Qnil);
+    Fset(Qdestroy_notify_hook, Qnil);
+    Fset(Qmap_notify_hook, Qnil);
+    Fset(Qunmap_notify_hook, Qnil);
+    Fset(Qreparent_notify_hook, Qnil);
+    Fset(Qproperty_notify_hook, Qnil);
+    Fset(Qenter_notify_hook, Qnil);
+    Fset(Qleave_notify_hook, Qnil);
+    Fset(Qfocus_in_hook, Qnil);
+    Fset(Qfocus_out_hook, Qnil);
+    Fset(Qclient_message_hook, Qnil);
+    Fset(Qwindow_moved_hook, Qnil);
+    Fset(Qwindow_resized_hook, Qnil);
+    Fset(Qshape_notify_hook, Qnil);
+    Fset(Qenter_frame_part_hook, Qnil);
+    Fset(Qleave_frame_part_hook, Qnil);
+    Fset(Qconfigure_notify_hook, Qnil);
+    Fset(Qconfigure_request_hook, Qnil);
+    Fset(Qwindow_state_change_hook, Qnil);
+    Fset(Qrandr_change_notify_hook, Qnil);
+
     rep_INTERN_SPECIAL(pointer_motion_threshold);
 
     rep_INTERN(iconify_window);
diff --git a/src/flippers.c b/src/flippers.c
index e4e27d1..c18efcf 100644
--- a/src/flippers.c
+++ b/src/flippers.c
@@ -161,6 +161,8 @@ flippers_init (void)
     rep_INTERN (bottom);
     rep_INTERN_SPECIAL (enter_flipper_hook);
     rep_INTERN_SPECIAL (leave_flipper_hook);
+    Fset(Qenter_flipper_hook, Qnil);
+    Fset(Qleave_flipper_hook, Qnil);
 
 }
 
diff --git a/src/functions.c b/src/functions.c
index 3f8646a..ff79752 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -1408,6 +1408,7 @@ functions_init (void)
 
     rep_INTERN(root);
     rep_INTERN_SPECIAL(after_restacking_hook);
+    Fset(Qafter_restacking_hook, Qnil);
     rep_INTERN(position);
     rep_INTERN(spacing);
     rep_INTERN(head);
diff --git a/src/keys.c b/src/keys.c
index bcc6d3c..5be7b06 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -1918,6 +1918,7 @@ keys_init(void)
     rep_INTERN_SPECIAL(root_window_keymap);
     rep_INTERN_SPECIAL(override_keymap);
     rep_INTERN_SPECIAL(unbound_key_hook);
+    Fset(Qunbound_key_hook, Qnil);
     rep_INTERN_SPECIAL(eval_key_release_events);
     rep_INTERN_SPECIAL(eval_modifier_events);
     Fset (Qeval_key_release_events, Qnil);
diff --git a/src/windows.c b/src/windows.c
index 208ff0d..aa99bf4 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -1721,6 +1721,14 @@ windows_init (void)
     rep_INTERN_SPECIAL(after_initialization_hook);
     rep_INTERN_SPECIAL(remove_window_hook);
 
+    Fset(Qbefore_add_window_hook, Qnil);
+    Fset(Qadd_window_hook, Qnil);
+    Fset(Qafter_add_window_hook, Qnil);
+    Fset(Qplace_window_hook, Qnil);
+    Fset(Qafter_framing_hook, Qnil);
+    Fset(Qafter_initialization_hook, Qnil);
+    Fset(Qremove_window_hook, Qnil);
+
     rep_INTERN(fully_obscured);
     rep_INTERN(partially_obscured);
     rep_INTERN(unobscured);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]