Re: [Sawfish] Patch for tab.jl

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


Hi,

On Tue, 28 Aug 2012 02:01:07 +0200
wrote fuchur <flohtransporter@xxxxxxxxx>:

>Hi,
>
>On Fri, 24 Aug 2012 03:14:43 +0200
>wrote fuchur <flohtransporter@xxxxxxxxx>:
>
>>Hi,
>>
>>On Fri, 24 Aug 2012 00:37:49 +0200
>>wrote Christopher Roy Bratusek <nano@xxxxxxxxxxxxx>:
>>
>>>On Thursday 23 August 2012 21:10:42 fuchur wrote:
>>>> Hi,
>>>> 
>>>> This patch removes "/usr/share/sawfish/lisp/sawfish/wm/util/marks.jl"
>>>> It seems marks.jl is only for tab.jl. But with a pair small changes
>>>> in tab.jl we don't need marks.jl
>>>> 
>>>> I also add a check if the select window for a tab exists (if not
>>>> exists (maybe you have close the window), then tabs will
>>>> not work until you restart sawfish, the patch fix that)
>>>> 
>>>> And also now the cursor changes if you select a window as tab.
>>>
>>>Thanks, commited.
>>
>>Here is already an update, sorry. We always set the default cursor to
>>left_ptr. But i am not sure that always the default cursor is left_ptr.
>>To make sure to have always the default cursor set by
>>gtk-mouse-theme-selector or other programs we should use also this
>>patch.
>>
>>
>
>Two patches: 
>With add-group-as-tabs.patch we have a function and keybinding to
>add a complete tabgroup to a window or other tabgroup as tabs. The
>keybinding works by the first or second command if you select
>a group/window, it makes no difference.
>
>tabgroup-bugfix-01.patch have many bugfix for tabsupport (tabgroup.jl)
>
>

normal-window-marked.patch:
allows only windows '_NET_WM_WINDOW_TYPE_NORMAL to marked as tab. 


-- 
Regards,
Fuchur

GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53  C116 E5BC 70D5 B8D7 B2B0
diff -urNad sawfish.orgi/lisp/sawfish/wm/tabs/tab.jl sawfish/lisp/sawfish/wm/tabs/tab.jl
--- sawfish.orgi/lisp/sawfish/wm/tabs/tab.jl
+++ sawfish/lisp/sawfish/wm/tabs/tab.jl
@@ -175,13 +175,14 @@
     "Add a window to a tabgroup. Apply this command on a window, then
 on another. The first window will be added to the tabgroup containig
 the second."
-    (if marked-window
-        (progn
-          (mapcar (lambda (w) (tab-group-window w win)) marked-window)
-          (default-cursor select-cursor)
-          (setq marked-window nil))
-      (default-cursor (get-cursor 'clock))
-      (setq marked-window (cons win))))
+    (when (net-wm-window-type-normal-p win)
+      (if marked-window
+          (progn
+            (mapcar (lambda (w) (tab-group-window w win)) marked-window)
+            (default-cursor select-cursor)
+            (setq marked-window nil))
+        (default-cursor (get-cursor 'clock))
+        (setq marked-window (cons win)))))
 
   (define-command 'tab-add-to-group tab-add-to-group #:spec "%W")
 
@@ -189,18 +190,19 @@
     "Add a tabgroup to a tabgroup. Apply this command on a window 
 from the tabgroup, then on another. The tabgroup will be added to 
 the tabgroup containig the second."
-    (if marked-window
-        (progn
-          (setq marked-window (tab-group-window-index (car marked-window)))
-          (tab-add-to-group win))
-      (default-cursor (get-cursor 'clock))
-      (setq marked-window (tab-group-window-index win))))
+    (when (net-wm-window-type-normal-p win)
+      (if marked-window
+          (progn
+            (setq marked-window (tab-group-window-index (car marked-window)))
+            (tab-add-to-group win))
+        (default-cursor (get-cursor 'clock))
+        (setq marked-window (tab-group-window-index win)))))
 
   (define-command 'tabgroup-add-to-group tabgroup-add-to-group #:spec "%W")
 
   (define (check-win)
-    (if (and marked-window
-             (not (window-id marked-window)))
+    (if (and (car marked-window)
+             (not (window-id (car marked-window))))
         (progn
           (default-cursor select-cursor)
           (setq marked-window nil))))
diff -urNad sawfish.orgi/lisp/sawfish/wm/tabs/tabgroup.jl sawfish/lisp/sawfish/wm/tabs/tabgroup.jl
--- sawfish.orgi/lisp/sawfish/wm/tabs/tabgroup.jl
+++ sawfish/lisp/sawfish/wm/tabs/tabgroup.jl
@@ -22,6 +22,7 @@
 (define-structure sawfish.wm.tabs.tabgroup
 
     (export window-tabbed-p
+            net-wm-window-type-normal-p
             tab-refresh-group
             tab-release-window
             tab-raise-left-window
@@ -62,6 +63,9 @@
   (define (window-tabbed-p w)
     (window-get w 'tabbed))
 
+  (define (net-wm-window-type-normal-p w)
+    (equal (aref (nth 2 (get-x-property w '_NET_WM_WINDOW_TYPE)) 0) '_NET_WM_WINDOW_TYPE_NORMAL))
+
   (define-record-type :tab-group
     (tab-build-group p d wl)
     tab-group?
@@ -251,8 +255,8 @@
     ;; exists on another workspace or window type
     ;; is not a "normal" window (e.g. dock panel ...)
     (when (and (not (cdr (window-get win 'workspaces)))
-               (equal (aref (nth 2 (get-x-property w '_NET_WM_WINDOW_TYPE)) 0) '_NET_WM_WINDOW_TYPE_NORMAL)
-               (equal (aref (nth 2 (get-x-property win '_NET_WM_WINDOW_TYPE)) 0) '_NET_WM_WINDOW_TYPE_NORMAL))
+               (net-wm-window-type-normal-p w)
+               (net-wm-window-type-normal-p win))
       (let* ((index (tab-window-group-index win))
              (index2 (tab-window-group-index w))
              (pos (window-position win))

Attachment: signature.asc
Description: PGP signature



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