[Sawfish] Re: Add new window as tab patch

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


Hi,

On Fri, 30 Mar 2012 20:16:58 +0200
wrote fuchur <flohtransporter@xxxxxxxxx>:

>Hi,
>
>On Wed, 28 Mar 2012 23:54:32 +0200
>wrote fuchur <flohtransporter@xxxxxxxxx>:
>
>>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. 
>>
>
>Add support if the new window/tab and the tab-group not at the same
>workspace. Apply the patch after the patch above.
>

Two bugfix patches for tabgroup.jl. Apply after 03-tabgroup-fix.patch
and 04-tabgroup-fix.patch patches from above to the local-master branch.

-- 
Regards,
Fuchur

GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
--- sawfish/lisp/sawfish/wm/tabs/tabgroup.jl.orgi
+++ sawfish/lisp/sawfish/wm/tabs/tabgroup.jl
@@ -269,8 +269,6 @@
              (group-frame-maximized-horizontally (window-get win 'maximized-horizontally))
              (group-frame-maximized-fullscreen (window-get win 'maximized-fullscreen))
              (group-frame-unmaximized-type (window-get win 'unmaximized-type))
-             (group-frame-to-workspaces (car (window-workspaces win)))
-             (group-frame-from-workspaces (car (window-workspaces w)))
              (group-frame-unmaximized-geometry (window-get win 'unmaximized-geometry)))
         (when (not (eq index index2))
           ;; tabgroup to tabgroup
@@ -279,41 +277,43 @@
             (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))
-          (window-put w 'frame-style group-frame-style)
-          (window-put w 'type group-frame-type)
-          (window-put w 'focus-mode group-frame-focus-mode)
-          (window-put w 'gravity group-frame-gravity)
-          (window-put w 'title-position group-frame-title-position)
-          (window-put w 'sticky group-frame-sticky)
-          (window-put w 'sticky-viewport group-frame-sticky-viewport)
-          (window-put w 'never-iconify group-frame-never-iconify)
-          (window-put w 'depth group-frame-depth)
-          (window-put w 'fixed-position group-frame-fixed-position)
-          (window-put w 'never-maximize group-frame-never-maximize)
-          (window-put w 'maximized-vertically group-frame-maximized-vertically)
-          (window-put w 'maximized-horizontally group-frame-maximized-horizontally)
-          (window-put w 'maximized-fullscreen group-frame-maximized-fullscreen)
-          (window-put w 'unmaximized-type group-frame-unmaximized-type)
-          (window-put w 'unmaximized-geometry group-frame-unmaximized-geometry)
-          ;; reframe w here, tab-refresh-group expectet
-          ;; the same frame for w and win
-          (reframe-window w)
-          (tab-put-window-in-group w index)
-          (tab-delete-window-from-group w index2)
-          (resize-window-to w (car dim) (cdr dim))
-          (move-window-to w (car pos) (cdr pos))
-          (when (and group-frame-to-workspaces group-frame-from-workspaces
-                     (not (eq group-frame-to-workspaces group-frame-from-workspaces)))
-            (move-window-to-workspace w group-frame-from-workspaces group-frame-to-workspaces))
-          (setq tab-refresh-lock t)
-          (tab-refresh-group w 'frame)
-          (set-input-focus w)
-          (if (not (window-tabbed-p win)) (window-put win 'tabbed t))
-          (window-put w 'tabbed t)))))
+          (let ((group-frame-to-workspaces (car (window-workspaces win))))
+            (if (window-get win 'shaded) (unshade-window win))
+            (setq tab-refresh-lock nil)
+            (if (window-get w 'iconified) (uniconify-window w))
+            (let ((group-frame-from-workspaces (car (window-workspaces w))))
+              (if (window-get w 'shaded) (unshade-window w))
+              (window-put w 'frame-style group-frame-style)
+              (window-put w 'type group-frame-type)
+              (window-put w 'focus-mode group-frame-focus-mode)
+              (window-put w 'gravity group-frame-gravity)
+              (window-put w 'title-position group-frame-title-position)
+              (window-put w 'sticky group-frame-sticky)
+              (window-put w 'sticky-viewport group-frame-sticky-viewport)
+              (window-put w 'never-iconify group-frame-never-iconify)
+              (window-put w 'depth group-frame-depth)
+              (window-put w 'fixed-position group-frame-fixed-position)
+              (window-put w 'never-maximize group-frame-never-maximize)
+              (window-put w 'maximized-vertically group-frame-maximized-vertically)
+              (window-put w 'maximized-horizontally group-frame-maximized-horizontally)
+              (window-put w 'maximized-fullscreen group-frame-maximized-fullscreen)
+              (window-put w 'unmaximized-type group-frame-unmaximized-type)
+              (window-put w 'unmaximized-geometry group-frame-unmaximized-geometry)
+              ;; reframe w here, tab-refresh-group expectet
+              ;; the same frame for w and win
+              (reframe-window w)
+              (tab-put-window-in-group w index)
+              (tab-delete-window-from-group w index2)
+              (resize-window-to w (car dim) (cdr dim))
+              (move-window-to w (car pos) (cdr pos))
+              (when (and group-frame-to-workspaces group-frame-from-workspaces
+                         (not (eq group-frame-to-workspaces group-frame-from-workspaces)))
+                (move-window-to-workspace w group-frame-from-workspaces group-frame-to-workspaces))
+              (setq tab-refresh-lock t)
+              (tab-refresh-group w 'frame)
+              (set-input-focus w)
+              (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."
--- sawfish/lisp/sawfish/wm/tabs/tabgroup.jl.orgi
+++ sawfish/lisp/sawfish/wm/tabs/tabgroup.jl
@@ -55,7 +55,7 @@
   (define oldgroup nil)
   (define tab-groups nil)
   (define tab-refresh-lock t)
-  (define release-window nil)
+  (define release-window t)
   (define last-unmap-id nil)
   (define in-tab-group-name nil)
 
@@ -135,8 +135,9 @@
 
   (define (tab-delete-window-from-tab-groups w)
     "Find window's group and remove it."
-    (if (not release-window)
+    (if release-window
         (remove-from-tab-group w))
+    (setq release-window t)
     (when (window-tabbed-p w)
       (tab-delete-window-from-group w (tab-window-group-index w))
       (window-put w 'fixed-position nil)
@@ -273,9 +274,8 @@
         (when (not (eq index index2))
           ;; tabgroup to tabgroup
           (when (window-tabbed-p w)
-            (setq release-window t)
-            (tab-delete-window-from-tab-groups w)
-            (setq release-window nil))
+            (setq release-window nil)
+            (tab-delete-window-from-tab-groups w))
           (if (window-get win 'iconified) (uniconify-window win))
           (let ((group-frame-to-workspaces (car (window-workspaces win))))
             (if (window-get win 'shaded) (unshade-window win))
@@ -317,9 +317,8 @@
   
   (define (tab-release-window w)
     "Release the window from its group."
-    (setq release-window t)
-    (tab-delete-window-from-tab-groups w)
     (setq release-window nil)
+    (tab-delete-window-from-tab-groups w)
     (tab-make-new-group w))
   
   (define-command 'tab-release-window tab-release-window #:spec "%f")

Attachment: signature.asc
Description: PGP signature



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