Hi, On Sun, 13 Feb 2011 21:42:10 +0100 wrote fuchur <flohtransporter gmail com>: >Hi, > >On Sat, 12 Feb 2011 21:36:19 +0100 >wrote fuchur <flohtransporter gmail com>: > >>Hi, >> >>On Sat, 12 Feb 2011 00:35:01 +0100 >>wrote fuchur <flohtransporter gmail com>: >> >>This patch add support for keybindigs to move tabbar with keyboard >>(chose from sawfish default keybinding dialog). >>Also add customize support for tabbar font. >> > >Patch for Styletab theme.jl >Changes: >Rewrite code for frametype-button (use the same codestyle >as teika's code for icon switch) >Add support for keybindigs to switch frametype with window resize. >Temporary disable reload theme after style change (sawfish crash, need >a fix). > Add support for send-to/copy-to next/prev workspace for tabbed windows. Changelog: Add tab-group-windows-index to tabgroup.jl which returns a list of tabbed windows (if any). Don't add a window to tabgroup if window has a copy on a other workspace (tabgroup.jl). Add tab-group-windows-index to gaol-add in tabgroup.jl. In workspace.jl makes "send-to-next-workspace" works with tabs. -- Regards, Fuchur GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53 C116 E5BC 70D5 B8D7 B2B0
diff -urNad sawfish-git-9999.orgi/lisp/sawfish/wm/tabs/tabgroup.jl sawfish-git-9999/lisp/sawfish/wm/tabs/tabgroup.jl
--- sawfish-git-9999.orgi/lisp/sawfish/wm/tabs/tabgroup.jl 2011-02-18 00:55:42.000000000 +0100
+++ sawfish-git-9999/lisp/sawfish/wm/tabs/tabgroup.jl 2011-02-18 00:48:36.000000000 +0100
@@ -29,6 +29,7 @@
tab-find-window
tab-rank
tab-group-window-list
+ tab-group-windows-index
tab-group-window)
(open rep
@@ -112,6 +113,12 @@
(t
(loop (+ index 1))))))
+ (define (tab-group-windows-index win)
+ "Return the windows of the group containing win."
+ (let* ((index (tab-window-group-index win))
+ (wins (tab-group-window-list (nth index tab-groups))))
+ wins))
+
(define (tab-rank elem list)
(if (eq elem (car list))
0
@@ -235,41 +242,44 @@
;; Entry points
(define (tab-group-window w win)
"Add window W to tabgroup containing WIN."
- ;; from tabgroup to tabgroup
- (when (window-tabbed-p w)
- (tab-delete-window-from-tab-groups w))
- ;; sort windows/tabs (depth)
- (tab-refresh-group win 'raise)
- (raise-window w)
- (set-input-focus w)
- (let* ((index (tab-window-group-index win))
- (index2 (tab-window-group-index w))
- ;; adopt window settings for the new tab
- (group-frame-style (window-get win 'frame-style))
- (group-frame-type (window-get win 'type))
- (group-frame-sticky (window-get win 'sticky))
- (group-frame-fixed-position (window-get win 'fixed-position))
- (group-frame-title-position (window-get win 'title-position))
- (group-frame-depth (window-get win 'depth)))
- (when (not (eq index index2))
- (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 'title-position group-frame-title-position)
- (window-put w 'sticky group-frame-sticky)
- (window-put w 'depth group-frame-depth)
- (window-put w 'fixed-position group-frame-fixed-position)
- ;; reframe w here, tab-refresh-group expectet
- ;; the same frame for w and win
- (reframe-window w)
- (tab-refresh-group win 'move)
- (tab-put-window-in-group w index)
- (tab-delete-window-from-group w index2)
- (tab-refresh-group win 'frame)
- (tab-refresh-group w 'move)
- (if (not (window-tabbed-p win)) (window-put win 'tabbed t))
- (window-put w 'tabbed t))))
+ ;; don't add a tab is/have win a copy on a
+ ;; other workspace
+ (when (not (cdr (window-get win 'workspaces)))
+ ;; from tabgroup to tabgroup
+ (when (window-tabbed-p w)
+ (tab-delete-window-from-tab-groups w))
+ ;; sort windows/tabs (depth)
+ (tab-refresh-group win 'raise)
+ (raise-window w)
+ (set-input-focus w)
+ (let* ((index (tab-window-group-index win))
+ (index2 (tab-window-group-index w))
+ ;; adopt window settings for the new tab
+ (group-frame-style (window-get win 'frame-style))
+ (group-frame-type (window-get win 'type))
+ (group-frame-sticky (window-get win 'sticky))
+ (group-frame-fixed-position (window-get win 'fixed-position))
+ (group-frame-title-position (window-get win 'title-position))
+ (group-frame-depth (window-get win 'depth)))
+ (when (not (eq index index2))
+ (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 'title-position group-frame-title-position)
+ (window-put w 'sticky group-frame-sticky)
+ (window-put w 'depth group-frame-depth)
+ (window-put w 'fixed-position group-frame-fixed-position)
+ ;; reframe w here, tab-refresh-group expectet
+ ;; the same frame for w and win
+ (reframe-window w)
+ (tab-refresh-group win 'move)
+ (tab-put-window-in-group w index)
+ (tab-delete-window-from-group w index2)
+ (tab-refresh-group win 'frame)
+ (tab-refresh-group w 'move)
+ (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."
@@ -357,5 +367,5 @@
(add-hook 'add-to-workspace-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'frame))))
(add-hook 'destroy-notify-hook tab-delete-window-from-tab-groups))
- (gaol-add tab-refresh-group)
+ (gaol-add tab-refresh-group tab-group-windows-index)
)
diff -urNad sawfish-git-9999.orgi/lisp/sawfish/wm/workspace.jl sawfish-git-9999/lisp/sawfish/wm/workspace.jl
--- sawfish-git-9999.orgi/lisp/sawfish/wm/workspace.jl 2011-02-18 00:55:42.000000000 +0100
+++ sawfish-git-9999/lisp/sawfish/wm/workspace.jl 2011-02-18 01:04:29.000000000 +0100
@@ -692,19 +692,25 @@
(define (send-to-next-workspace w count #!optional copy select)
"Move the window to the next workspace."
+ (require 'sawfish.wm.tabs.tabgroup)
(ws-call-with-workspace
(lambda (space)
(let ((was-focused (eq w (input-focus)))
- (orig-space (if (window-in-workspace-p
- w current-workspace)
- current-workspace
- (car (window-workspaces w)))))
- (when orig-space
- (copy-window-to-workspace w orig-space space was-focused)
- (when select
- (select-workspace space was-focused))
- (unless copy
- (move-window-to-workspace w orig-space space was-focused)))))
+ (orig-space (if (window-in-workspace-p
+ w current-workspace)
+ current-workspace
+ (car (window-workspaces w))))
+ (tabbed (tab-group-windows-index w)))
+ (when orig-space
+ (mapcar (lambda (w)
+ (copy-window-to-workspace w orig-space space)) tabbed)
+ (when select
+ (select-workspace space was-focused))
+ (unless copy
+ (mapcar (lambda (w)
+ (move-window-to-workspace w orig-space space)) tabbed))
+ (when (and was-focused (window-visible-p w))
+ (set-input-focus w)))))
count workspace-send-boundary-mode))
(define (send-to-previous-workspace w count #!optional copy select)
diff -urNad sawfish-git-9999.orgi/themes/StyleTab/theme.jl sawfish-git-9999/themes/StyleTab/theme.jl
--- sawfish-git-9999.orgi/themes/StyleTab/theme.jl 2011-02-18 00:55:42.000000000 +0100
+++ sawfish-git-9999/themes/StyleTab/theme.jl 2011-02-18 01:02:21.000000000 +0100
@@ -540,14 +540,14 @@
(defvar prev-button-keymap
(bind-keys (make-keymap)
- "Button3-Off" 'send-group-to-next-workspace
+ "Button3-Off" 'send-to-next-workspace
"Button2-Click" 'popup-workspace-list
- "Button1-Off" 'send-group-to-previous-workspace))
+ "Button1-Off" 'send-to-previous-workspace))
(defvar next-button-keymap
(bind-keys (make-keymap)
- "Button3-Off" 'send-group-to-previous-workspace
+ "Button3-Off" 'send-to-previous-workspace
"Button2-Click" 'popup-workspace-list
- "Button1-Off" 'send-group-to-next-workspace))
+ "Button1-Off" 'send-to-next-workspace))
(define-frame-class 'prev-button '((keymap . prev-button-keymap)))
(define-frame-class 'next-button '((keymap . next-button-keymap)))
Attachment:
signature.asc
Description: PGP signature