[Sawfish] Patch for tab.jl |
[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]
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. -- 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 2012-08-23 20:12:59.000000000 +0200 +++ sawfish/lisp/sawfish/wm/tabs/tab.jl 2012-08-23 19:38:28.000000000 +0200 @@ -30,9 +30,9 @@ sawfish.wm.commands sawfish.wm.frames sawfish.wm.tabs.tabgroup - sawfish.wm.util.marks + sawfish.wm.cursors sawfish.wm.windows - sawfish.wm.gaol) + sawfish.wm.gaol) (define-structure-alias tab sawfish.wm.tabs.tab) @@ -41,6 +41,8 @@ ;; - hide some frame parts on leftmost and rightmost tabs, should fixed ;; - add a drag-n-drop way to group windows by tabs + (define marked-window nil) + (define tabbar-left-dec-width) (define tabbar-right-dec-width) (define tabbar-left-margin) @@ -172,13 +174,24 @@ "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-windows) + (if marked-window (progn - (apply-on-marked-windows (lambda (w) (tab-group-window w win))) - (unmark-all-windows)) - (mark-window win))) + (tab-group-window marked-window win) + (default-cursor (get-cursor 'left_ptr)) + (setq marked-window nil)) + (default-cursor (get-cursor 'clock)) + (setq marked-window win))) - (define-command 'tab-add-to-group tab-add-to-group #:spec "%W")) + (define-command 'tab-add-to-group tab-add-to-group #:spec "%W") + + (define (check-win) + (if (and marked-window + (not (window-id marked-window))) + (progn + (default-cursor (get-cursor 'left_ptr)) + (setq marked-window nil)))) + + (add-hook 'destroy-notify-hook check-win)) ;;(require 'x-cycle) ;;(define-cycle-command-pair diff -urNad sawfish.orgi/lisp/sawfish/wm/util/marks.jl sawfish/lisp/sawfish/wm/util/marks.jl --- sawfish.orgi/lisp/sawfish/wm/util/marks.jl 2012-08-23 20:12:59.000000000 +0200 +++ sawfish/lisp/sawfish/wm/util/marks.jl 1970-01-01 01:00:00.000000000 +0100 @@ -1,59 +0,0 @@ -;; marks.jl -- provide a way to operate on multiple windows -;; -;; Copyright (C) Yann Hodique <Yann.Hodique@xxxxxxx> -;; -;; This file is an official accepted contribution into sawfish. -;; -;; This script is free software; you can redistribute it and/or modify it -;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; sawfish is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with sawfish; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301 USA. - -(define-structure sawfish.wm.util.marks - - (export mark-window - unmark-window - unmark-all-windows - apply-on-marked-windows - marked-windows) - - (open rep - rep.system - sawfish.wm.misc - sawfish.wm.custom - sawfish.wm.commands) - - (define-structure-alias marks sawfish.wm.util.marks) - - (defvar marked-windows-list nil) - - (define (mark-window win) - (setq marked-windows-list (append marked-windows-list (list win)))) - - (define-command 'mark-window mark-window #:spec "%W") - - (define (unmark-window win) - (setq marked-windows-list (remove win marked-windows-list))) - - (define-command 'unmark-window unmark-window #:spec "%W") - - (define (unmark-all-windows) - (setq marked-windows-list nil)) - - (define-command 'unmark-all-windows unmark-all-windows) - - (define (apply-on-marked-windows func) - (mapcar func marked-windows-list)) - - (define (marked-windows) - (not (eq marked-windows-list nil))))
Attachment:
signature.asc
Description: PGP signature
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |