Re: ** to GIT source users ** Some incompatibility in "StyleTab"



Hi,

On Tue, 15 Feb 2011 22:18:58 +0100
wrote Christopher Roy Bratusek <nano tuxfamily org>:

>Well it's of course not a big issue, but still I wouldn't call it minor as it 
>affects all but one focus-mode. Do you know whether it worked at some stage 
>before? That would help to debug the issue. I would say it's somewhere related 
>to focus-in or raise... I'll test it more later on this week.
>
>
>I also noticed the following (with enter-exit mode):
>Two tabbed-windows are below an "ordinary" one, use Alt-TAB to switch to one 
>of the tabbed, the other tab doesn't raise, leaving a whole (clicking on the 
>shown tab, does raise the previously missing to the middle of the stack).

Patch for tabgroup. Changelog:
Makes sure we call only the hooks from tabgroup.jl if a window is
"tabbed".
Rename reframe-style to style in tab-refresh-group.
Replace "reframe-window" with "rebuild-frame" in tab-refresh-group for
type.
Make tab-group-window work with "no-click" mode work.
Makes sure that a window is in a tabgroup you can also add to a other.

Styletab/theme.jl
Make Button2-Off for menubutton work.
Add call-after-state-changed for "sticky fixed-position stacking" to
makes it work with the changes in tabgroug (only call if a
window not "tabbed").

get-S-tabbed/theme.jl and Elberg-tabbed/theme.jl remove old comments
(Sometimes it could be necessary to call "call-after-state-changed" for
tabthemes).



Keybindigs for tabbar "add to group" and "tab release window" must be
different now. I have add a picture from my settings to this mail. If
it also work by all other (click)settings please replace the default
tabbar keybindigs with different for add and release.

This tab need more testing wit different settigns!

-- 
Regards,
Fuchur

GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
diff -urNad sawfish-git-9999.orgi/lisp/sawfish/wm/tabs/tabgroup.jl sawfish-git-9999/lisp/sawfish/wm/tabs/tabgroup.jl
--- sawfish-git-9999.orgi/lisp/sawfish/wm/tabs/tabgroup.jl	2011-02-16 18:37:38.000000000 +0100
+++ sawfish-git-9999/lisp/sawfish/wm/tabs/tabgroup.jl	2011-02-16 18:52:42.000000000 +0100
@@ -34,7 +34,7 @@
     (open rep
           rep.system
           rep.data.records
-	  sawfish.wm.gaol
+          sawfish.wm.gaol
           sawfish.wm.misc
           sawfish.wm.custom
           sawfish.wm.commands
@@ -135,7 +135,8 @@
 
   (define (tab-delete-window-from-tab-groups w)
     "Find window's group and remove it."
-    (tab-delete-window-from-group w (tab-window-group-index w)))
+    (when (window-tabbed-p w)
+      (tab-delete-window-from-group w (tab-window-group-index w))))
 
   (define (tab-put-window-in-group win index)
     "Put window in group at given index."
@@ -151,9 +152,9 @@
 
   (define (tab-refresh-group win prop)
     "Refresh the entire group containing WIN according to PROP.
-PROP can be one of the symbols : frame, reframe, reframe-style, move,
-resize, type, depth, shade, unshade, iconify, uniconify,
-fixed-position."
+PROP can be one of the symbols: raise, frame, reframe, style, move,
+resize, title-position, type, depth, shade, unshade, iconify, uniconify,
+sticky, unsticky, fixed-position."
     (when tab-refresh-lock
       (setq tab-refresh-lock nil)
       (unwind-protect
@@ -174,13 +175,13 @@
              ((eq prop 'reframe)
               (mapcar (lambda (w)
                         (reframe-window w)) wins))
-             ((eq prop 'reframe-style)
+             ((eq prop 'style)
               (let ((group-frame-style (window-get win 'frame-style))
                     (dim (window-frame-dimensions win))
                     (pos (window-position win)))
                 (mapcar (lambda (w)
                           (set-frame-style w group-frame-style)
-                          (tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim)) 
+                          (tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim))
                           (reframe-window w)) wins)))
              ((or (eq prop 'move) (eq prop 'resize))
               (let ((dim (window-frame-dimensions win))
@@ -199,7 +200,7 @@
               (let ((group-frame-type (window-get win 'type)))
                 (mapcar (lambda (w)
                           (window-put w 'type group-frame-type)
-                          (reframe-window w)) wins)))
+                          (rebuild-frame w)) wins)))
              ((eq prop 'depth)
               (let ((group-frame-depth (window-get win 'depth)))
                 (mapcar (lambda (w)
@@ -234,6 +235,13 @@
   ;; Entry points
   (define (tab-group-window w win)
     "Add window W to tabgroup containing WIN."
+    ;; from tabgroup to tabgroup
+    (when (window-tabbed-p w)
+      (tab-delete-window-from-tab-groups w))
+    ;; sort windows/tabs (depth)
+    (tab-refresh-group win 'raise)
+    (raise-window w)
+    (set-input-focus w)
     (let* ((index (tab-window-group-index win))
            (index2 (tab-window-group-index w))
            ;; adopt window settings for the new tab
@@ -244,32 +252,25 @@
            (group-frame-title-position (window-get win 'title-position))
            (group-frame-depth (window-get win 'depth)))
       (when (not (eq index index2))
-        ;; unshade windows if add/remove
-        (if (window-get w 'shaded)
-            (unshade-window w))
-        (if (window-get win 'shaded)
-            (unshade-window win))
-        (if (not (window-tabbed-p win))
-            (window-put win 'tabbed t))
-        (window-put w 'tabbed t)
+        (if (window-get w 'shaded) (unshade-window w))
+        (if (window-get win 'shaded) (unshade-window win))
         (window-put w 'frame-style group-frame-style)
         (window-put w 'type group-frame-type)
         (window-put w 'title-position group-frame-title-position)
-        ;; reframe w with new frame-style , type, title-position.
-        ;; tab-move-resize-frame-window-to, tab-refresh-group expectet
-        ;; the same frame for w and win
-        (reframe-window w)
         (window-put w 'sticky group-frame-sticky)
         (window-put w 'depth group-frame-depth)
         (window-put w 'fixed-position group-frame-fixed-position)
-        ;; ugly hack, don't know why it's needed, but new groups are
-        ;; listed with pos (0,0):
+        ;; reframe w here, tab-refresh-group expectet
+        ;; the same frame for w and win
+        (reframe-window w)
         (tab-refresh-group win 'move)
         (tab-put-window-in-group w index)
         (tab-delete-window-from-group w index2)
         (tab-refresh-group win 'frame)
-        (tab-refresh-group w 'raise))))
-
+        (tab-refresh-group w 'move)
+        (if (not (window-tabbed-p win)) (window-put win 'tabbed t))
+        (window-put w 'tabbed t))))
+  
   (define (tab-release-window w)
     "Release the window from its group."
     (tab-delete-window-from-tab-groups w)
@@ -323,34 +324,37 @@
   (unless batch-mode
     (add-hook 'window-state-change-hook
               (lambda (win args)
-                (setq args (car args))
-                (cond ((eq 'sticky args)
-                       (tab-group-sticky win))
-                      ((eq 'fixed-position args)
-                       (tab-refresh-group win 'fixed-position))
-                      ((eq 'frame-style args)
-                       (tab-refresh-group win 'reframe-style))
-                      ((eq 'type args)
-                       (tab-refresh-group win 'type))
-                      ((eq 'stacking args)
-                       (tab-refresh-group win 'depth)))))
+                (when (window-tabbed-p win)
+                  (setq args (car args))
+                  (cond ((eq 'sticky args)
+                         (tab-group-sticky win))
+                        ((eq 'fixed-position args)
+                         (tab-refresh-group win 'fixed-position))
+                        ((eq 'frame-style args)
+                         (tab-refresh-group win 'style)
+                         (tab-refresh-group win 'move))
+                        ((eq 'type args)
+                         (tab-refresh-group win 'type))
+                        ((eq 'stacking args)
+                         (tab-refresh-group win 'depth))))))
     
-    (add-hook 'focus-in-hook (lambda (win) 
-                                     (if tab-raise-on-hover
-				         (tab-group-raise win))))
-    (add-hook 'after-move-hook (lambda (win) (tab-refresh-group win 'move)))
-    (add-hook 'after-resize-hook (lambda (win) (tab-refresh-group win 'resize)))
+    (add-hook 'focus-in-hook 
+              (lambda (win) 
+                (if tab-raise-on-hover
+                    (tab-group-raise win))))
+    (add-hook 'after-move-hook (lambda (win)  (if (window-tabbed-p win) (tab-refresh-group win 'move))))
+    (add-hook 'after-resize-hook (lambda (win)  (if (window-tabbed-p win) (tab-refresh-group win 'resize))))
     ;; only update tabs by move if opaque move mode (opaque = slow)
     ;;
     (when (eq move-outline-mode 'opaque)
-      (add-hook 'while-moving-hook (lambda (win) (tab-refresh-group win 'move)))
+      (add-hook 'while-moving-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'move))))
       )
-    (add-hook 'window-resized-hook (lambda (win) (tab-refresh-group win 'resize)))
-    (add-hook 'shade-window-hook (lambda (win) (tab-refresh-group win 'shade)))
-    (add-hook 'unshade-window-hook (lambda (win) (tab-refresh-group win 'unshade)))
-    (add-hook 'iconify-window-hook (lambda (win) (tab-refresh-group win 'iconify)))
-    (add-hook 'uniconify-window-hook (lambda (win) (tab-refresh-group win 'uniconify)))
-    (add-hook 'add-to-workspace-hook (lambda (win) (tab-refresh-group win 'frame)))
+    (add-hook 'window-resized-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'resize))))
+    (add-hook 'shade-window-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'shade))))
+    (add-hook 'unshade-window-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'unshade))))
+    (add-hook 'iconify-window-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'iconify))))
+    (add-hook 'uniconify-window-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'uniconify))))
+    (add-hook 'add-to-workspace-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'frame))))
     (add-hook 'destroy-notify-hook tab-delete-window-from-tab-groups))
 
   (gaol-add tab-refresh-group)
diff -urNad sawfish-git-9999.orgi/themes/Elberg-tabbed/theme.jl sawfish-git-9999/themes/Elberg-tabbed/theme.jl
--- sawfish-git-9999.orgi/themes/Elberg-tabbed/theme.jl	2011-02-16 18:37:39.000000000 +0100
+++ sawfish-git-9999/themes/Elberg-tabbed/theme.jl	2011-02-16 18:39:52.000000000 +0100
@@ -491,6 +491,4 @@
     (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed)
       (create-frames)))
 
-;; Create only frames, don't rebuild-frame/reframe-window.
-;; Tabthemes will reframe/rebuild windows call from tabgroup.jl.
 (call-after-state-changed '(title-position) create-frames-only)
diff -urNad sawfish-git-9999.orgi/themes/StyleTab/theme.jl sawfish-git-9999/themes/StyleTab/theme.jl
--- sawfish-git-9999.orgi/themes/StyleTab/theme.jl	2011-02-16 18:37:40.000000000 +0100
+++ sawfish-git-9999/themes/StyleTab/theme.jl	2011-02-16 18:52:00.000000000 +0100
@@ -52,7 +52,7 @@
 (defgroup StyleTab:right-bottom-buttons-group "Right Titlebar Bottom Buttons"
   :group (appearance StyleTab:group StyleTab:buttons-group StyleTab:right-buttons-group))
 
-(defcustom styletab:style 'Dark "Frame and button style. (requires restart)"
+(defcustom styletab:style 'Dark "Frame and button style. (requires restart)"
   :group (appearance StyleTab:group StyleTab:settings-group)
   :options (Reduce Dark DarkColor Silver SilverColor Smoothly)
   :type symbol)
@@ -428,7 +428,7 @@
       (when (or (eq cur 'shaped)
                 (eq cur 'utility))
         (setq new 'default)
-        (setq dim-x (- dim-x (* styletab:borders-dimension 2)))         
+        (setq dim-x (- dim-x (* styletab:borders-dimension 2)))
         (setq dim-y (- dim-y styletab:borders-dimension))
         (when (not (or (eq current-title 'top)
                        (eq current-title 'bottom)))
@@ -452,7 +452,7 @@
                        (eq current-title 'bottom)))
           (setq dim-y (- dim-y (* styletab:borders-dimension 2)))
           (setq dim-x (- dim-x styletab:borders-dimension styletab:title-dimension)))))
-    
+
     (when (eq dest 'sha-tra)
       (if (or (eq cur 'shaped)
               (eq cur 'utility))
@@ -535,7 +535,7 @@
 (def-frame-class frame-type-button ()
   (bind-keys frame-type-button-keymap
              "Button1-Off" 'set-frame-default-and-default/transient-toggle
-             "Button2-Off" 'set-frame-unframed-and-unframed/default-toggle
+             "Button2-Off" 'set-frame-unframed-and-unframed/shaped-transient-toggle
              "Button3-Off" 'set-frame-shaped-and-shaped/shaped-transient-toggle))
 
 (defvar prev-button-keymap
@@ -2089,7 +2089,7 @@
     (current-title-w w)))
 
 (define (reframe-windows style)
-  (map-windows 
+  (map-windows
    (lambda (w)
      (when (eq (window-get w 'current-frame-style) style)
        (current-title-w w)
@@ -2099,6 +2099,12 @@
   (lambda ()
     (reframe-windows theme-name)))
 
+(define (reframe-one w)
+  (when (not (window-get w 'tabbed))
+    (when (eq (window-get w 'current-frame-style) theme-name)
+      (current-title-w w)
+      (rebuild-frame w))))
+
 ;; also reset icon cache
 ;;
 (define clear-cache-reframe
@@ -2113,9 +2119,7 @@
   (setq frame-cache (make-weak-table eq-hash eq))
   (reload-frame-style theme-name))
 
-;; Create only frames, don't rebuild-frame/reframe-window.
-;; Tabthemes will reframe/rebuild windows call from tabgroup.jl. 
-;;
+(call-after-state-changed '(sticky fixed-position stacking) reframe-one)
 (call-after-state-changed '(title-position) create-frames-only)
 
 (custom-set-property 'styletab:title-font ':after-set reframe-all)
diff -urNad sawfish-git-9999.orgi/themes/get-S-tabbed/theme.jl sawfish-git-9999/themes/get-S-tabbed/theme.jl
--- sawfish-git-9999.orgi/themes/get-S-tabbed/theme.jl	2011-02-16 18:37:40.000000000 +0100
+++ sawfish-git-9999/themes/get-S-tabbed/theme.jl	2011-02-16 18:40:20.000000000 +0100
@@ -329,7 +329,4 @@
     (when (eq (window-get w 'current-frame-style) 'get-S-tabbed)
       (create-frames)))
 
-;; Create only frames, don't rebuild-frame/reframe-window.
-;; Tabthemes will reframe/rebuild windows call from tabgroup.jl.
-;; 
 (call-after-state-changed '(title-position) create-frames-only)

Attachment: Bildschirmfoto-Sawfish-Einstellungen.png
Description: PNG image

Attachment: signature.asc
Description: PGP signature



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