[Sawfish] Re: Add new window as tab patch

[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]


Hi,

On Tue, 27 Mar 2012 18:51:16 +0200
wrote fuchur <flohtransporter@xxxxxxxxx>:

>>Hi,
>>
>>On Mon, 26 Mar 2012 04:01:26 +0200
>>wrote fuchur <flohtransporter@xxxxxxxxx>:
>>  
>>>Hi,
>>>
>>>Here is a patch to add a new window as tab if have one (the first
>>>created if more as one) of the windows the same 'tab-group property".
>>>'tab-group property can set by window-rules and also save in
>>>window-history. You can choose between 12 tab-groups. If you know how
>>>to grow Tab groups or "automatically" update (maybe by window-names) in
>>>window-rules please send a patch. 
>>>  
>>
>>Here is the same patch as above but with some bugfix.
>>Need more tester/ing.
>>  

Some Windows not call the unmap-notify-hook e.g. gimp and tabgroup
will not work. This patch for local-master-branch fix that. 

-- 
Regards,
Fuchur

GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
--- sawfish/lisp/sawfish/wm/tabs/tabgroup.jl.orgi	2012-03-28 23:45:00.000000000 +0200
+++ sawfish/lisp/sawfish/wm/tabs/tabgroup.jl	2012-03-28 23:42:01.000000000 +0200
@@ -276,9 +276,11 @@
             (setq release-window t)
             (tab-delete-window-from-tab-groups w)
             (setq release-window nil))
+          (if (window-get win 'iconified) (uniconify-window win))
+          (if (window-get win 'shaded) (unshade-window win))
           (setq tab-refresh-lock nil)
+          (if (window-get w 'iconified) (uniconify-window w))
           (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 'focus-mode group-frame-focus-mode)
@@ -420,9 +422,15 @@
     (when (window-get win 'tab-group)
       (setq in-tab-group-name (append in-tab-group-name (cons (cons (window-id win) (window-get win 'tab-group)))))
       (let ((open-win-tabgroup (get-window-by-id (car (rassoc (window-get win 'tab-group) in-tab-group-name)))))
-        (if (and open-win-tabgroup
-                 (not (eq win open-win-tabgroup)))
-            (tab-group-window win open-win-tabgroup)))))
+        ;; unmap-notify-hook gets not always a window-id for all 
+        ;; windows e.g. gimp (it will close more as one window and
+        ;; also not all call the unmap-notify-hook and/or we get the window-id).
+        ;; This next "if" will clean the list and remove the "ghosts".
+        (if (not (eq open-win-tabgroup nil))
+            (if (not (eq win open-win-tabgroup))
+                (tab-group-window win open-win-tabgroup))
+          (setq in-tab-group-name (remove (rassoc (window-get win 'tab-group) in-tab-group-name) in-tab-group-name))
+          (in-tab-group win)))))
 
   (define (remove-from-tab-group win)
     "Remove window from in-tab-group-name alist if it have a 'tab-group property"

Attachment: signature.asc
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/