Hi, Here i have patches for tab support and tabthemes. 01.themes.patch Changes: Remove reframe/rebuild functions from theme.jl Reframe/rebuild windows by tab-themes now only call from tabgroup.jl 02.tabs.patch Changes: Reframe/rebuild windows by tab-themes now call from tabgroup.jl. Don't try to add a single/same window in a tabgroup. Remember titel-position if window uniconify. Reset set-tab-adjustments from tab-themes.jl if required. Bugfix. 03.frames.patch Changes: Add functions adjustment-title to call hook title-position. Before reframe a window call adjustment-title and reset set-tab-adjustments from tab-themes.jl file. 04_DarkTab.patch Changes: Remove clicked title color settings, now the same as the highlight color. Remove reframe/rebuild functions, now set by tabgroup.jl -- Regards, Fuchur GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53 C116 E5BC 70D5 B8D7 B2B0
diff -urNad sawfish.orgi/themes/Elberg-tabbed/theme.jl sawfish/themes/Elberg-tabbed/theme.jl
--- sawfish.orgi/themes/Elberg-tabbed/theme.jl 2010-11-11 15:20:08.000000000 +0100
+++ sawfish/themes/Elberg-tabbed/theme.jl 2010-11-11 15:22:28.000000000 +0100
@@ -492,24 +492,6 @@
(when (eq (window-get w 'current-frame-style) 'Elberg-tabbed)
(create-frames))))
-(define (reframe-one w)
- (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed)
- (create-frames)
- (reframe-window w)))
-
-(define (reframe-group w)
- (when (eq (window-get w 'current-frame-style) 'Elberg-tabbed)
- (map-window-group
- (lambda (x)
- (reframe-one x)) w)))
-
-;; create only frames when focus a window don't draw
-;;
-(add-hook 'focus-in-hook create-frames-only)
-(add-hook 'add-window-hook create-frames-only)
-
-(call-after-property-changed '(WM_HINTS WM_NAME _NET_WM_NAME _NET_WM_STATE _NET_WM_DESKTOP) reframe-one)
-
-;; tabgroup.jl call
-;;
-(call-after-state-changed '(title-position) reframe-group)
+;; Create only frames, don't rebuild-frame/reframe-window.
+;; Tabthemes will reframe/rebuild windows call from tabgroup.jl.
+(call-after-state-changed '(title-position) create-frames-only)
diff -urNad sawfish.orgi/themes/get-S-tabbed/theme.jl sawfish/themes/get-S-tabbed/theme.jl
--- sawfish.orgi/themes/get-S-tabbed/theme.jl 2010-11-11 15:20:08.000000000 +0100
+++ sawfish/themes/get-S-tabbed/theme.jl 2010-11-11 15:22:41.000000000 +0100
@@ -330,24 +330,7 @@
(when (eq (window-get w 'current-frame-style) 'get-S-tabbed)
(create-frames))))
-(define (reframe-one w)
- (when (eq (window-get w 'current-frame-style) 'get-S-tabbed)
- (create-frames)
- (reframe-window w)))
-
-(define (reframe-group w)
- (when (eq (window-get w 'current-frame-style) 'get-S-tabbed)
- (map-window-group
- (lambda (x)
- (reframe-one x)) w)))
-
-;; create only frames when focus a window don't draw
-;;
-(add-hook 'focus-in-hook create-frames-only)
-(add-hook 'add-window-hook create-frames-only)
-
-(call-after-property-changed '(WM_HINTS WM_NAME _NET_WM_NAME _NET_WM_STATE _NET_WM_DESKTOP) reframe-one)
-
-;; tabgroup.jl call
-;;
-(call-after-state-changed '(title-position) reframe-group)
+;; Create only frames, don't rebuild-frame/reframe-window.
+;; Tabthemes will reframe/rebuild windows call from tabgroup.jl.
+;;
+(call-after-state-changed '(title-position) create-frames-only)
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 2010-11-11 15:20:08.000000000 +0100
+++ sawfish/lisp/sawfish/wm/tabs/tabgroup.jl 2010-11-11 15:49:38.000000000 +0100
@@ -158,7 +158,7 @@
(mapcar (lambda (w)
(set-frame-style w group-frame-style)
(tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim))
- (rebuild-frame w)) wins)))
+ (reframe-window w)) wins)))
((or (eq prop 'move) (eq prop 'resize))
(let ((dim (window-frame-dimensions win))
(pos (window-position win)))
@@ -219,23 +219,24 @@
;; adopt group for the new tab
;; use sawfish's "default" groups
(group-id (window-actual-group-id win)))
- (window-put w 'type group-frame-type)
- (window-put w 'sticky group-frame-sticky)
- (window-put w 'depth group-frame-depth)
- (window-put w 'fixed-position group-frame-fixed-position)
- (window-put w 'title-position group-frame-title-position)
- (window-put w 'frame-style group-frame-style)
- ;; ugly hack, don't know why it's needed, but new groups are
- ;; listed with pos (0,0):
- (tab-refresh-group w 'reframe)
- (tab-refresh-group win 'move)
- (add-window-to-group w group-id)
- (tab-put-window-in-group w index)
- ;;
- ;; call hook to redraw tablength from theme file
- (call-window-hook 'window-state-change-hook w (list '(title-position)))
- (tab-delete-window-from-group w index2)
- (tab-refresh-group win 'move)))
+ (when (not (eq index index2))
+ (window-put w 'frame-style group-frame-style)
+ (window-put w 'type group-frame-type)
+ (window-put w 'title-position group-frame-title-position)
+ ;; reframe w with new frame-style , type, title-position.
+ ;; tab-move-resize-frame-window-to, tab-refresh-group expectet
+ ;; the same frame for w and win
+ (reframe-window w)
+ (window-put w 'sticky group-frame-sticky)
+ (window-put w 'depth group-frame-depth)
+ (window-put w 'fixed-position group-frame-fixed-position)
+ ;; ugly hack, don't know why it's needed, but new groups are
+ ;; listed with pos (0,0):
+ (tab-refresh-group win 'move)
+ (add-window-to-group w group-id)
+ (tab-put-window-in-group w index)
+ (tab-delete-window-from-group w index2)
+ (tab-refresh-group win 'frame))))
(define (tab-release-window w)
"Release active window from its group"
@@ -278,20 +279,17 @@
(lambda (w) (eq w win))
(tab-group-window-list (tab-find-window win)))) )
- (define (raise-tab-group w)
- (raise-group w))
-
(define (tab-group-sticky w)
(if (window-get w 'sticky)
(make-group-sticky w)
(make-group-unsticky w)))
(unless batch-mode
- ;(add-hook 'focus-in-hook raise-tab-group)
(add-hook 'window-state-change-hook
(lambda (win args)
- (if (= '(sticky) args)
- (tab-group-sticky win))))
+ (when (= '(sticky) args)
+ (tab-group-sticky win)
+ (tab-refresh-group win 'frame))))
(add-hook 'window-state-change-hook
(lambda (win args)
(if (= '(fixed-position) args)
@@ -299,6 +297,7 @@
(add-hook 'window-state-change-hook
(lambda (win args)
(if (= '(frame-style) args)
+ (adjustment-title win)
(tab-refresh-group win 'reframe-style))))
(add-hook 'window-state-change-hook
(lambda (win args)
@@ -308,6 +307,7 @@
(lambda (win args)
(if (= '(stacking) args)
(tab-refresh-group win 'depth))))
+ (add-hook 'before-move-hook (lambda (win) (adjustment-title win)))
(add-hook 'after-move-hook (lambda (win) (tab-refresh-group win 'move)))
(add-hook 'after-resize-hook (lambda (win) (tab-refresh-group win 'resize)))
;; only update tabs by move if opaque move mode (opaque = slow)
@@ -317,7 +317,14 @@
)
(add-hook 'window-resized-hook (lambda (win) (tab-refresh-group win 'resize)))
(add-hook 'shade-window-hook (lambda (win) (tab-refresh-group win 'shade)))
- (add-hook 'unshade-window-hook (lambda (win) (tab-refresh-group win 'unshade)))
+ (add-hook 'unshade-window-hook
+ (lambda (win)
+ (adjustment-title win)
+ (tab-refresh-group win 'unshade)))
(add-hook 'iconify-window-hook (lambda (win) (tab-refresh-group win 'iconify)))
- (add-hook 'uniconify-window-hook (lambda (win) (tab-refresh-group win 'uniconify)))
+ (add-hook 'uniconify-window-hook
+ (lambda (win)
+ (adjustment-title win)
+ (tab-refresh-group win 'uniconify)))
+ (add-hook 'add-to-workspace-hook (lambda (win) (tab-refresh-group win 'frame)))
(add-hook 'destroy-notify-hook tab-delete-window-from-tab-groups)))
diff -urNad sawfish.orgi/lisp/sawfish/wm/frames.jl sawfish/lisp/sawfish/wm/frames.jl
--- sawfish.orgi/lisp/sawfish/wm/frames.jl 2010-11-11 15:20:08.000000000 +0100
+++ sawfish/lisp/sawfish/wm/frames.jl 2010-11-11 15:26:25.000000000 +0100
@@ -36,6 +36,7 @@
apply-frame-style
apply-frame-style-and-save
window-type
+ adjustment-title
set-window-type
push-window-type
pop-window-type
@@ -326,9 +327,13 @@
(reload-frame-style style))))
frame-style-files)))
+ (define (adjustment-title w)
+ (call-window-hook 'window-state-change-hook w (list '(title-position))))
+
;;; applying frame styles to windows
(define (reframe-window w)
+ (adjustment-title w)
(if (window-get w 'ignored)
(progn
(window-put w 'current-frame-style nil)
diff -urNad DarkTab.orgi/theme.jl DarkTab/theme.jl
--- DarkTab.orgi/theme.jl 2010-11-11 16:08:00.000000000 +0100
+++ DarkTab/theme.jl 2010-11-11 16:08:37.000000000 +0100
@@ -81,11 +81,6 @@
:group (appearance DarkTab:group DarkTab:settings-group)
:type color)
-(defcustom darktab:clicked-color "#F2F2F2"
- "Clicked title text color."
- :group (appearance DarkTab:group DarkTab:settings-group)
- :type color)
-
(defcustom darktab:inactive-color "#CCCCCC"
"Inactive title text color."
:group (appearance DarkTab:group DarkTab:settings-group)
@@ -96,11 +91,6 @@
:group (appearance DarkTab:group DarkTab:settings-group)
:type color)
-(defcustom darktab:inactive-clicked "#E6E6E6"
- "Inactive Clicked title text color."
- :group (appearance DarkTab:group DarkTab:settings-group)
- :type color)
-
(defcustom darktab:top-left-buttons `((menu ,t) (shade ,t) (sticky ,nil))
"Top Titlebar Left Buttons (from left to right)"
:group (appearance DarkTab:group DarkTab:buttons-group DarkTab:top-buttons-group DarkTab:top-left-buttons-group)
@@ -411,6 +401,7 @@
(lambda (x)
(window-put x 'title-position 'left)) (current-event-window))
(call-window-hook 'window-state-change-hook (current-event-window) (list '(title-position)))
+ (map-window-group (lambda (x) (reframe-window x)) (current-event-window))
(move-window-to (current-event-window) pos-x pos-y)
(resize-window-to (current-event-window) dim-x dim-y))))
(bind-keys
@@ -445,6 +436,7 @@
(lambda (x)
(window-put x 'title-position 'top)) (current-event-window)))
(call-window-hook 'window-state-change-hook (current-event-window) (list '(title-position)))
+ (map-window-group (lambda (x) (reframe-window x)) (current-event-window))
(move-window-to (current-event-window) pos-x pos-y)
(resize-window-to (current-event-window) dim-x dim-y))))
(bind-keys
@@ -482,6 +474,7 @@
(lambda (x)
(window-put x 'title-position 'right)) (current-event-window))
(call-window-hook 'window-state-change-hook (current-event-window) (list '(title-position)))
+ (map-window-group (lambda (x) (reframe-window x)) (current-event-window))
(move-window-to (current-event-window) pos-x pos-y)
(resize-window-to (current-event-window) dim-x dim-y)))))
@@ -534,6 +527,7 @@
(lambda (x)
(window-put x 'title-position 'bottom)) (current-event-window)))
(call-window-hook 'window-state-change-hook (current-event-window) (list '(title-position)))
+ (map-window-group (lambda (x) (reframe-window x)) (current-event-window))
(move-window-to (current-event-window) pos-x pos-y)
(resize-window-to (current-event-window) dim-x dim-y))))
(bind-keys
@@ -569,6 +563,7 @@
(lambda (x)
(window-put x 'title-position 'top)) (current-event-window))
(call-window-hook 'window-state-change-hook (current-event-window) (list '(title-position)))
+ (map-window-group (lambda (x) (reframe-window x)) (current-event-window))
(move-window-to (current-event-window) pos-x pos-y)
(resize-window-to (current-event-window) dim-x dim-y))))
(bind-keys
@@ -620,6 +615,7 @@
(lambda (x)
(window-put x 'title-position 'bottom)) (current-event-window)))
(call-window-hook 'window-state-change-hook (current-event-window) (list '(title-position)))
+ (map-window-group (lambda (x) (reframe-window x)) (current-event-window))
(move-window-to (current-event-window) pos-x pos-y)
(resize-window-to (current-event-window) dim-x dim-y)))))
@@ -1677,10 +1673,10 @@
(lambda ()
`((focused . ,darktab:focused-color)
(highlighted . ,darktab:highlighted-color)
- (clicked . ,darktab:clicked-color)
+ (clicked . ,darktab:highlighted-color)
(inactive . ,darktab:inactive-color)
(inactive-highlighted . ,darktab:inactive-highlighted-color)
- (inactive-clicked . ,darktab:inactive-clicked))))
+ (inactive-clicked . ,darktab:inactive-highlighted-color))))
(define top-frame-sticky-image-set
(lambda (w)
@@ -3092,40 +3088,17 @@
(lambda ()
(reframe-windows theme-name)))
+;; also reset icon cache
+;;
(define reframe-all-clean
(lambda ()
(setq icon-table (make-weak-table eq-hash eq))
(reframe-all)))
-(define (reframe-one w)
- (when (eq (window-get w 'current-frame-style) theme-name)
- (current-title-w w)
- (reframe-window w)))
-
-(define (reframe-group w)
- (when (eq (window-get w 'current-frame-style) theme-name)
- (map-window-group
- (lambda (x)
- (reframe-one x)) w)))
-
-;; create only frames when focus a window don't draw
-;;
-(add-hook 'focus-in-hook create-frames-only)
-(add-hook 'add-window-hook create-frames-only)
-
-(call-after-property-changed '(WM_HINTS WM_NAME _NET_WM_NAME _NET_WM_STATE _NET_WM_DESKTOP) reframe-one)
-
-;; theme-title icon switch
-;;
-;;(call-after-state-changed '(title-position) reframe-one)
-(call-after-state-changed '(title-position) reframe-group)
-
-;; when the window is sent to another workspace
-;; redraw it to update the buttons and titlebar if necessary
+;; Create only frames, don't rebuild-frame/reframe-window.
+;; Tabthemes will reframe/rebuild windows call from tabgroup.jl.
;;
-(add-hook 'remove-from-workspace-hook
- (lambda (w)
- (reframe-window w)))
+(call-after-state-changed '(title-position) create-frames-only)
(custom-set-property 'darktab:focused-color ':after-set reframe-all)
(custom-set-property 'darktab:highlighted-color ':after-set reframe-all)
Attachment:
signature.asc
Description: PGP signature