[sawfish] fix rename-window and unbrake sawfish-ui



commit 6bad6a2f7b738dfd97a28697dba3992a3e440162
Author: chrisb <zanghar freenet de>
Date:   Sun Aug 9 10:55:19 2009 +0200

    fix rename-window and unbrake sawfish-ui

 ChangeLog                           |    4 ++++
 lisp/sawfish/wm/ext/match-window.jl |   22 +++++++++++++++++-----
 lisp/sawfish/wm/windows.jl          |   21 +--------------------
 3 files changed, 22 insertions(+), 25 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 36a1243..557525f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-09  Christopher Bratusek <zanghar freenet de>
+	* lisp/sawfish/wm/ext/match-window.jl: move rename-window here, as it requires prompt but this either does not 
+	                                       load properly in windows.jl or breaks sawfish-ui if require'ed instead of open'ed
+
 2009-08-05  Christopher Bratusek <zanghar freenet de>
 	* lisp/sawfish/wm/windows.jl: make rename-window work again
 
diff --git a/lisp/sawfish/wm/ext/match-window.jl b/lisp/sawfish/wm/ext/match-window.jl
index 2c513f9..b18c88c 100644
--- a/lisp/sawfish/wm/ext/match-window.jl
+++ b/lisp/sawfish/wm/ext/match-window.jl
@@ -45,13 +45,16 @@
 	    define-match-window-formatter
 	    add-window-matcher
 	    remove-window-matcher
-	    match-window)
+	    match-window
+	    rename-window
+	    rename-window-interactive)
 
     (open rep
 	  rep.system
 	  rep.regexp
 	  sawfish.wm
-	  sawfish.wm.util.groups)
+	  sawfish.wm.util.groups
+	  sawfish.wm.util.prompt)
 
   (define-structure-alias match-window sawfish.wm.ext.match-window)
 
@@ -402,13 +405,13 @@
            (while (not (workspace-empty-p space))
              (setq space (1+ space)))
            (set-window-workspaces w (list space)))))))
-	   
+
   (define-match-window-setter 'new-viewport
     (lambda (w prop value)
       (declare (unused prop))
       (when value
         (unless (window-get w 'placed)
-          (let ((row 0) 
+          (let ((row 0)
                 (col 0)
                 (nomatch t))
             (while (and nomatch (< row (cdr viewport-dimensions)))
@@ -450,4 +453,13 @@
      (when (memq value '(all vertical))
        (window-put w 'queued-vertical-maximize t))
      (when (memq value '(all horizontal))
-       (window-put w 'queued-horizontal-maximize t)))))
+       (window-put w 'queued-horizontal-maximize t))))
+
+  (define (rename-window window new-name)
+    (set-x-text-property window 'WM_NAME (vector new-name)
+    (set-x-text-property window '_NET_WM_NAME (vector new-name))))
+
+  (define (rename-window-interactive w)
+    (rename-window w (prompt-for-string "new title:" (window-name w))))
+
+  (define-command 'rename-window rename-window-interactive #:spec "%W"))
diff --git a/lisp/sawfish/wm/windows.jl b/lisp/sawfish/wm/windows.jl
index fa10df6..7bea112 100644
--- a/lisp/sawfish/wm/windows.jl
+++ b/lisp/sawfish/wm/windows.jl
@@ -56,9 +56,7 @@
 	     window-avoided-p
 	     avoided-windows
 	     call-after-property-changed
-	     call-after-state-changed
-	     rename-window
-	     rename-window-interactive))
+	     call-after-state-changed))
 
     (open rep
 	  rep.system
@@ -227,23 +225,6 @@ supported by client window W."
 		((eq (aref data i) atom) t)
 		(t (loop (1+ i))))))))
 
-;;; renaming
-
-;; extra require to make rename-window work
-;; (open sawfish.wm.util.prompt) does not work!
-
-(unless batch-mode
-  (require 'sawfish.wm.util.prompt))
-
-(define (rename-window window new-name)
-  (set-x-text-property window 'WM_NAME (vector new-name)
-  (set-x-text-property window '_NET_WM_NAME (vector new-name))))
-
-(define (rename-window-interactive w)
-  (rename-window w (prompt-for-string "new title:" (window-name w))))
-
-(define-command 'rename-window rename-window-interactive #:spec "%W")
-
 ;;; warping
 
   (define (warp-cursor-to-window w #!optional x y)



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