EdgeAction changes in 1.8.1



Hi all,

some small changes in EA for 1.8.1:

- moved all options to sawfish.wm.edge.conf (so that they appear in the correct 
order in SawfishConfig)

- load from user.jl not wm.jl

- add a defcustom (edge-actions-enabled) to be able to completely disable them 
(also from SawfishRC)

- propose HM (HotMove), updated patch for current master attached, perhaps 
someone will now have a look at it and share an opinion(?)

Regards,
Chris
diff --git a/lisp/sawfish/wm/edge/actions.jl b/lisp/sawfish/wm/edge/actions.jl
index 2700086..333d811 100644
--- a/lisp/sawfish/wm/edge/actions.jl
+++ b/lisp/sawfish/wm/edge/actions.jl
@@ -46,6 +46,8 @@
        (edge-flip-invoke edge 'viewport))
       ((none/hot-spot)
        (hot-spot-invoke edge))
+      ((none/hot-move)
+       (hot-move-invoke edge))
       (t nil)))
 
   ;; Entry point without dragging 
diff --git a/lisp/sawfish/wm/edge/conf.jl b/lisp/sawfish/wm/edge/conf.jl
index 08a3d38..2319339 100644
--- a/lisp/sawfish/wm/edge/conf.jl
+++ b/lisp/sawfish/wm/edge/conf.jl
@@ -39,20 +39,20 @@
     :group edge-actions
     :type (choice none/hot-spot viewport-drag flip-workspace flip-viewport))
 
-  (defcustom left-right-edge-move-action 'none
+  (defcustom left-right-edge-move-action 'none/hot-move
     "Action for the left and right screen-edge while moving a window."
     :group edge-actions
-    :type  (choice none viewport-drag flip-workspace flip-viewport))
+    :type  (choice none/hot-move viewport-drag flip-workspace flip-viewport))
 
   (defcustom top-bottom-edge-action 'none/hot-spot
     "Action for the top and bottom screen-edge."
     :group edge-actions
     :type (choice none/hot-spot viewport-drag flip-workspace flip-viewport))
 
-  (defcustom top-bottom-edge-move-action 'none
+  (defcustom top-bottom-edge-move-action 'none/hot-move
     "Action for the top and bottom screen-edge while moving a window."
     :group edge-actions
-    :type  (choice none viewport-drag flip-workspace flip-viewport))
+    :type  (choice none/hot-move viewport-drag flip-workspace flip-viewport))
 
   (defcustom edge-flip-delay 250
     "Delay (in milliseconds) of flipping of viewport / workspace."
diff --git a/lisp/sawfish/wm/edge/hot-spots.jl b/lisp/sawfish/wm/edge/hot-spots.jl
index e88c7ac..b8c722a 100644
--- a/lisp/sawfish/wm/edge/hot-spots.jl
+++ b/lisp/sawfish/wm/edge/hot-spots.jl
@@ -20,7 +20,8 @@
 
 (define-structure sawfish.wm.edge.hot-spots
 
-    (export hot-spot-invoke)
+    (export hot-spot-invoke
+            hot-move-invoke)
 
     (open rep
 	  rep.system
@@ -82,5 +83,38 @@
 		      (mod hot-spot-delay 1000))
 	(when func
 	  ;; non-nil, but not a function?
-	  (error "In hot-spot, you configuration of `%s' is wrong; it should be a function." spot))
+	  (error "In hot-spot, you configuration of spot `%s' is wrong; it should be a function." spot))
+	)))
+
+  (defvar left-edge-move-function nil
+    "The function launched when hitting the left-edge.")
+
+  (defvar top-edge-move-function nil
+    "The function launched when hitting the top-edge.")
+
+  (defvar right-edge-move-function nil
+    "The function launched when hitting the right-edge.")
+
+  (defvar bottom-edge-move-function nil
+    "The function launched when hitting the bottom-edge.")
+
+  (define (hot-move-invoke spot)
+    (let ((func (case spot
+		  ((left)
+		   left-edge-move-function)
+		  ((top)
+		   top-edge-move-function)
+		  ((right)
+		   right-edge-move-function)
+		  ((bottom)
+		   bottom-edge-move-function))))
+      (if (functionp func)
+	  (make-timer (lambda ()
+			(allow-events 'async-both)
+			(funcall func))
+		      (quotient hot-spot-delay 1000)
+		      (mod hot-spot-delay 1000))
+	(when func
+	  ;; non-nil, but not a function?
+	  (error "In hot-spot, you configuration of spot `%s' is wrong; it should be a function." spot))
 	))))
diff --git a/lisp/sawfish/wm/windows.jl b/lisp/sawfish/wm/windows.jl
index 8d3cdf4..022fc99 100644
--- a/lisp/sawfish/wm/windows.jl
+++ b/lisp/sawfish/wm/windows.jl
@@ -60,6 +60,7 @@
 	     call-after-property-changed
 	     call-after-state-changed
 	     rename-window
+	     release-windows
 	     toggle-fixed-postion))
 
     (open rep
@@ -575,6 +576,16 @@ STATES has been changed. STATES may also be a single symbol."
   (define-command 'rename-window rename-window
     #:spec "%W\nsEnter new window name:")
 
+  (define (release-windows #!key warp center)
+    "Release all windows (commonly used for hot-spot while moving)."
+    (synthesize-event (lookup-event "ESC") 'root)
+    (if warp
+        (warp-cursor-to-window warp))
+    (if center
+        (progn
+	  (require 'sawfish.wm.commands.move-cursor)
+          (move-cursor-center))))
+
   (define (toggle-fixed-postion w)
     "Toggle the window property `fixed-position'."
      (if (window-get w 'fixed-position)

Attachment: signature.asc
Description: This is a digitally signed message part.



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