Re: Re: Add compton module to sawfish

fuchur <[email protected]>
Newsgroups gmane.comp.window-managers.sawfish
Organization W.W
Message-ID <[email protected]>
Hi,

On Sat, 14 Sep 2013 20:09:12 +0200
wrote Christopher Roy Bratusek <[email protected]>:

>I corrected two more typos, and I found the issue why it does not work for me:
>
>  --xinerama-shadow-crop does not exist on debian (both official and self-compiled from 
>git repository) So I added a new boolean defcustom: shadows-crop-xinerama, defaulted 
>to nil with note that not all compton versions support it.

Your changes --xinerama-shadow-crop also crash compton. You have use
"--xinerama-shadow-crop" but it should '--xinerama-shadow-crop.

By this patch:
Add a hook "tab-group-windows-hook" to tabgroup.jl. This hook
returns the tabbed windows in a group if a tab add or remove from a
tabgroup.

Improve tabsupport in compton.jl.

Fix --xinerama-shadow-crop crash.


Patch also tested in debian.

-- 
Regards,
Fuchur

GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
01_compton-xinerama-fix.patch (text/x-patch, 4.5 KB)
diff -urNad sawfish.orig/lisp/sawfish/wm/prg/compton.jl sawfish/lisp/sawfish/wm/prg/compton.jl
--- sawfish.orig/lisp/sawfish/wm/prg/compton.jl
+++ sawfish/lisp/sawfish/wm/prg/compton.jl
@@ -38,6 +38,7 @@
   (define switch-opacity nil)
   (define update-opacity nil)
   (define stop-compton nil)
+
   (defgroup window-effects "Window Effects"
     :group appearance)
 
@@ -88,7 +89,8 @@
       :type boolean
       :after-set (lambda () (switch-opacity)))
 
-    (defcustom shadows-crop-xinerama nil "Crop shadows in xinerama setups (not supported by all compton versions)."
+    (defcustom shadows-crop-xinerama nil "Crop shadows in xinerama setups (not supported by all compton versions and
+if your versions not supported this, compton crash and you must restart sawfish)."
       :depends opacity-enable
       :group (appearance window-effects)
       :type boolean
@@ -252,7 +254,7 @@
     (define (zero) (if zero-mask '-z '-e1))
     (define (dad) (if shadows-disable-dad '-G '-e1))
     (define (smenu) (if shadows-disable-menu (concat "window_type *= 'menu'") (concat "window_type *= 'nil'")))
-    (define (sxinerama) (if shadows-crop-xinerama "--xinerama-shadow-crop" '-e1 ))
+    (define (sxinerama) (if shadows-crop-xinerama '--xinerama-shadow-crop '-e1 ))
 
     (define (trans) (/ (+ 0.00 translucency) 100))
     (define (fade-i) (/ (+ 0.00 fade-in) 1000))
@@ -276,7 +278,7 @@
                            (c-red (red))
                            (c-green (green))
                            (c-blue (blue))
-			   (c-sxinerama (sxinerama)))
+                           (c-sxinerama (sxinerama)))
       "Start compton. If a compton process already exists, it's beeing killed."
       (when (program-exists-p "compton")
         (stop-compton)
@@ -398,13 +400,13 @@
       (dim-window w (get-opacity opacity-by-resize)))
 
     (define (tab-release w)
-      (if (eq w 'tab-release-window)
-          (map-windows (lambda (win)
-                         (if opacity-enable
-                             (window-opacity win)
-                           (dim-window win (get-opacity '100)))))))
+      (and car
+           (not (cdr w))
+           (if opacity-enable
+               (window-opacity (car w))
+             (dim-window (car w) (get-opacity '100)))))
 
-    (add-hook 'post-command-hook (lambda (w) (if opacity-enable (tab-release w))))
+    (add-hook 'tab-group-windows-hook (lambda (w) (if opacity-enable (tab-release w))))
     (add-hook 'after-add-window-hook (lambda (w) (if opacity-enable (window-opacity w))))
     (add-hook 'shade-window-hook (lambda (w) (if opacity-enable (window-opacity w))))
     (add-hook 'focus-in-hook (lambda (w) (if opacity-enable (window-opacity w))))
diff -urNad sawfish.orig/lisp/sawfish/wm/tabs/tabgroup.jl sawfish/lisp/sawfish/wm/tabs/tabgroup.jl
--- sawfish.orig/lisp/sawfish/wm/tabs/tabgroup.jl
+++ sawfish/lisp/sawfish/wm/tabs/tabgroup.jl
@@ -62,6 +62,10 @@
   (define in-tab-group-name nil)
   (define tab-theme-name)
 
+  (defvar tab-group-windows-hook '()
+    "Tab-group-windows-hook called by change or created a tabgroup.
+Containing all windows current in the tabgroup")
+
   (define (set-tab-theme-name #!key frame-style-supported-tabs)
     (setq tab-theme-name frame-style-supported-tabs))
 
@@ -155,10 +159,12 @@
         (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)
-      (tab-refresh-group oldgroup 'frame)
-      (reframe-window w)))
+      (let ((wins (list (remove w (tab-group-window-index w)))))
+        (tab-delete-window-from-group w (tab-window-group-index w))
+        (window-put w 'fixed-position nil)
+        (tab-refresh-group oldgroup 'frame)
+        (call-hook 'tab-group-windows-hook wins)
+        (reframe-window w))))
 
   (define (tab-put-window-in-group win index)
     "Put window in group at given index."
@@ -353,6 +359,7 @@
           (setq tab-refresh-lock t)
           (tab-refresh-group w 'frame)
           (set-input-focus w)
+          (call-hook 'tab-group-windows-hook (list (tab-group-window-index w)))
           (if (not (window-tabbed-p win)) (window-put win 'tabbed t))
           (window-put w 'tabbed t)))))
   
@@ -441,6 +448,7 @@
                     (window-put w 'never-iconify-opaque nil)
                     (window-put w 'never-iconify t))
                   (window-put w 'tabbed t)) wins)
+        (call-hook 'tab-group-windows-hook (list (tab-group-window-index win)))
         (raise-window win)
         (setq all-wins nil))
       (setq tab-refresh-lock t)
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)

iEYEARECAAYFAlI2BfEACgkQ5bxw1bjXsrAkbACeJHYuWnbzk4cQqBpDb3uO9xs8
6RkAn3B0FlhoG7a//j5h+N+QjRSmbKli
=kLF2
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.