[sawfish] added maybe-raise-tab function



commit d743fcf69089b7acd89403d0740318d0975b29e8
Author: Christopher Roy Bratusek <zanghar freenet de>
Date:   Sun Feb 20 21:20:44 2011 +0100

    added maybe-raise-tab function

 lisp/sawfish/wm/autoload.jl      |    1 +
 lisp/sawfish/wm/keymaps.jl       |    5 +----
 lisp/sawfish/wm/tabs/tabgroup.jl |   11 ++++++++++-
 3 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/lisp/sawfish/wm/autoload.jl b/lisp/sawfish/wm/autoload.jl
index d5a537b..39c2021 100644
--- a/lisp/sawfish/wm/autoload.jl
+++ b/lisp/sawfish/wm/autoload.jl
@@ -213,4 +213,5 @@
 (autoload-command 'set-viewport-linear:9 'sawfish.wm.commands.viewport-linear)
 (autoload-command 'set-window-viewport-linear:9 'sawfish.wm.commands.viewport-linear)
 (autoload-command 'jump-or-exec 'sawfish.wm.commands.jump-or-exec)
+(autoload-command 'maybe-raise-tab 'sawfish.wm.tabs.tabgroup)
 ;;; ::autoload-end::
diff --git a/lisp/sawfish/wm/keymaps.jl b/lisp/sawfish/wm/keymaps.jl
index 709977a..431a404 100644
--- a/lisp/sawfish/wm/keymaps.jl
+++ b/lisp/sawfish/wm/keymaps.jl
@@ -126,10 +126,7 @@
     :type keymap)
 
   (defcustom tabbar-keymap (bind-keys (make-keymap)
-				      "Button1-Off" (lambda ()
-						      (require 'sawfish.wm.tabs.tabgroup)
-						      (unless tab-raise-on-hover
-							(tab-refresh-group (current-event-window) 'raise)))
+				      "Button1-Off" 'maybe-raise-tab
 				      "Button1-Off2" 'toggle-window-shaded
 				      "Button1-Move" 'move-window-interactively
 				      "Button2-Off" 'tab-add-to-group
diff --git a/lisp/sawfish/wm/tabs/tabgroup.jl b/lisp/sawfish/wm/tabs/tabgroup.jl
index 967c95c..ead0ab5 100644
--- a/lisp/sawfish/wm/tabs/tabgroup.jl
+++ b/lisp/sawfish/wm/tabs/tabgroup.jl
@@ -30,7 +30,8 @@
             tab-rank
             tab-group-window-list
             tab-group-window-index
-            tab-group-window)
+            tab-group-window
+	    maybe-raise-tab)
     
     (open rep
           rep.system
@@ -56,6 +57,14 @@
     :group focus
     :type boolean)
 
+  (define (maybe-raise-tab w)
+    "Raise a window, when it's a tab and automatic raising of is disabled"
+    (when (and (not tab-raise-on-hover)
+	       (window-tabbed-p w))
+      (tab-refresh-group w 'raise)))
+
+  (define-command 'maybe-raise-tab maybe-raise-tab #:spec "%W")
+
   (define tab-groups nil)
   (define tab-refresh-lock t)
   (define tab-move-lock t)



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