Hi, On Mon, 21 Feb 2011 21:03:26 +0100 wrote Christopher Roy Bratusek <nano tuxfamily org>: >OK. I fixed it like: > >349 (define (before-move-resize win) >350 "Releas win from the tabgroup and iconify the rest from the group." >351 (let* ((index (tab-window-group-index win)) >352 (wins (tab-group-window-list (nth index tab-groups))) >353 (tabs (remove win (tab-group-window-list (nth index tab-groups)))) >354 (default-window-animator 'none)) >^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >So for this action the default-animator is always disabled, and the issues are gone. > >Either way opaque should be fixed, to not eat that much CPU-time (not a issue of your code, but the animator itself). Patch for tabgroup.jl. Changelog: Add support for maximized/unmaximized, focus-mode, gravity, sticky-viewpor and never-maximize. Improve tab-refresh-group. Small fix for before-move-resize. All what i want do to in tabgroup.jl is now ready. The select/input or event window should now work like a singel window without tabs. If (you) change "events" for the select window it happens so fast like without tabs, necessary changes for tabs are happens only in the "background". I have make sure the the select window not reframe/frame twice and also change window propertys or reframe/frame only once for tabs if it is necessary. Sure it is possible to remove the most hooks from tabgroup.jl, and use "tab-group-window-index" and integrate tabs complete in the sawish code but it would not be faster, all "settings change" for tabs are in the "background". -- Regards, Fuchur GPG Fingerprint: CA3B 8204 5B3E 6D48 6D53 C116 E5BC 70D5 B8D7 B2B0
--- a/lisp/sawfish/wm/tabs/tabgroup.jl +++ b/lisp/sawfish/wm/tabs/tabgroup.jl @@ -166,8 +166,8 @@ (define (tab-refresh-group win prop) "Refresh the entire group containing WIN according to PROP. -PROP can be one of the symbols: raise, frame, reframe, style, move, -resize, title-position, type, depth, shade, unshade, iconify, uniconify, +PROP can be one of the symbols: raise, frame, reframe, reframe-all, style, move, +resize, title-position, type, depth, shade, unshade, iconify, uniconify, maximized, sticky, unsticky, fixed-position." (when tab-refresh-lock (setq tab-refresh-lock nil) @@ -191,64 +191,70 @@ (rebuild-frame focus)) ((eq prop 'reframe) (mapcar (lambda (w) + (reframe-window w)) unfocus)) + ((eq prop 'reframe-all) + (mapcar (lambda (w) (reframe-window w)) unfocus) (reframe-window focus)) + ((or (eq prop 'move) (eq prop 'resize)) + (let ((dim (window-frame-dimensions win)) + (pos (window-position win))) + (mapcar (lambda (w) + (tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim))) unfocus))) ((eq prop 'style) (let ((group-frame-style (window-get win 'frame-style)) (dim (window-frame-dimensions win)) (pos (window-position win))) (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))) unfocus) - (set-frame-style focus group-frame-style) - (tab-move-resize-frame-window-to focus (car pos) (cdr pos) (car dim) (cdr dim)))) - ((or (eq prop 'move) (eq prop 'resize)) - (let ((dim (window-frame-dimensions win)) - (pos (window-position win))) - (mapcar (lambda (w) - (tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim))) unfocus) - (tab-move-resize-frame-window-to focus (car pos) (cdr pos) (car dim) (cdr dim)) - (rplaca (nthcdr index tab-groups) - (tab-build-group pos dim wins)))) + (tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim))) unfocus))) ((eq prop 'fixed-position) (let ((group-frame-fixed-position (window-get win 'fixed-position))) (mapcar (lambda (w) - (window-put w 'fixed-position group-frame-fixed-position)) unfocus) - (window-put focus 'fixed-position group-frame-fixed-position))) + (window-put w 'fixed-position group-frame-fixed-position)) unfocus))) ((eq prop 'type) (let ((group-frame-type (window-get win 'type))) (mapcar (lambda (w) - (window-put w 'type group-frame-type)) unfocus) - (window-put focus 'type group-frame-type))) + (window-put w 'type group-frame-type)) unfocus))) ((eq prop 'depth) (let ((group-frame-depth (window-get win 'depth))) (mapcar (lambda (w) (window-put w 'depth group-frame-depth)) unfocus) - (window-put focus 'depth group-frame-depth))) + (raise-window win) + (set-input-focus win))) ((eq prop 'iconify) (mapcar (lambda (w) - (iconify-window w)) unfocus) - (iconify-window focus)) + (iconify-window w)) unfocus)) ((eq prop 'uniconify) (mapcar (lambda (w) - (uniconify-window w)) unfocus) - (uniconify-window focus)) + (uniconify-window w)) unfocus)) + ((eq prop 'maximized) + (let ((dim (window-frame-dimensions win)) + (pos (window-position win)) + (group-frame-maximized-vertically (window-get win 'maximized-vertically)) + (group-frame-maximized-horizontally (window-get win 'maximized-horizontally)) + (group-frame-maximized-fullscreen (window-get win 'maximized-fullscreen)) + (group-frame-unmaximized-type (window-get win 'unmaximized-type)) + (group-frame-unmaximized-geometry (window-get win 'unmaximized-geometry))) + (mapcar (lambda (w) + (window-put w 'maximized-vertically group-frame-maximized-vertically) + (window-put w 'maximized-horizontally group-frame-maximized-horizontally) + (window-put w 'maximized-fullscreen group-frame-maximized-fullscreen) + (window-put w 'unmaximized-type group-frame-unmaximized-type) + (window-put w 'unmaximized-geometry group-frame-unmaximized-geometry) + (tab-move-resize-frame-window-to w (car pos) (cdr pos) (car dim) (cdr dim))) unfocus))) ((eq prop 'sticky) (mapcar (lambda (w) - (make-window-sticky w)) unfocus) - (make-window-sticky focus)) + (make-window-sticky w)) unfocus)) ((eq prop 'unsticky) (mapcar (lambda (w) - (make-window-unsticky w)) unfocus) - (make-window-unsticky focus)) + (make-window-unsticky w)) unfocus)) ((eq prop 'shade) (mapcar (lambda (w) - (shade-window w)) unfocus) - (shade-window focus)) + (shade-window w)) unfocus)) ((eq prop 'unshade) (mapcar (lambda (w) - (unshade-window w)) unfocus) - (unshade-window focus)))) + (unshade-window w)) unfocus)))) (setq tab-refresh-lock t)))) ;; Entry points @@ -264,11 +270,20 @@ ;; adopt window settings for the new tab (group-frame-style (window-get win 'frame-style)) (group-frame-type (window-get win 'type)) + (group-frame-focus-mode (window-get win 'focus-mode)) + (group-frame-gravity (window-get win 'gravity)) (group-frame-sticky (window-get win 'sticky)) + (group-frame-sticky-viewport (window-get win 'sticky-viewport)) (group-frame-never-iconify (window-get win 'never-iconify)) (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))) + (group-frame-depth (window-get win 'depth)) + (group-frame-never-maximize (window-get win 'never-maximize)) + (group-frame-maximized-vertically (window-get win 'maximized-vertically)) + (group-frame-maximized-horizontally (window-get win 'maximized-horizontally)) + (group-frame-maximized-fullscreen (window-get win 'maximized-fullscreen)) + (group-frame-unmaximized-type (window-get win 'unmaximized-type)) + (group-frame-unmaximized-geometry (window-get win 'unmaximized-geometry))) (when (not (eq index index2)) ;; tabgroup to tabgroup (when (window-tabbed-p w) @@ -278,11 +293,20 @@ (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 'focus-mode group-frame-focus-mode) + (window-put w 'gravity group-frame-gravity) (window-put w 'title-position group-frame-title-position) (window-put w 'sticky group-frame-sticky) + (window-put w 'sticky-viewport group-frame-sticky-viewport) (window-put w 'never-iconify group-frame-never-iconify) (window-put w 'depth group-frame-depth) (window-put w 'fixed-position group-frame-fixed-position) + (window-put w 'never-maximize group-frame-never-maximize) + (window-put w 'maximized-vertically group-frame-maximized-vertically) + (window-put w 'maximized-horizontally group-frame-maximized-horizontally) + (window-put w 'maximized-fullscreen group-frame-maximized-fullscreen) + (window-put w 'unmaximized-type group-frame-unmaximized-type) + (window-put w 'unmaximized-geometry group-frame-unmaximized-geometry) ;; reframe w here, tab-refresh-group expectet ;; the same frame for w and win (reframe-window w) @@ -348,21 +372,23 @@ (define (before-move-resize win) "Releas win from the tabgroup and iconify the rest from the group." - (let* ((index (tab-window-group-index win)) - (wins (tab-group-window-list (nth index tab-groups))) - (tabs (remove win (tab-group-window-list (nth index tab-groups)))) - (default-window-animator 'none)) - (tab-delete-window-from-group win index) - (rebuild-frame win) - (setq tab-refresh-lock nil) - (mapcar (lambda (w) - (when (window-get w 'never-iconify) - (window-put w 'never-iconify nil) - (window-put w 'never-iconify-opaque t)) - (iconify-window w)) tabs) - (setq all-wins wins) - (setq current-win win)) - (setq tab-refresh-lock t)) + (when (not (window-get win 'fixed-position)) + (when (eq all-wins nil) + (let* ((index (tab-window-group-index win)) + (wins (tab-group-window-list (nth index tab-groups))) + (tabs (remove win (tab-group-window-list (nth index tab-groups)))) + (default-window-animator 'none)) + (tab-delete-window-from-group win index) + (rebuild-frame win) + (setq tab-refresh-lock nil) + (mapcar (lambda (w) + (when (window-get w 'never-iconify) + (window-put w 'never-iconify nil) + (window-put w 'never-iconify-opaque t)) + (iconify-window w)) tabs) + (setq all-wins wins) + (setq current-win win)) + (setq tab-refresh-lock t)))) (define (after-move-resize win) "Add all tabs to the tabgroup from win. (Releas and iconify by before-move-resize)" @@ -408,7 +434,7 @@ (tab-refresh-group win 'frame)) ((eq 'frame-style args) (tab-refresh-group win 'style) - (tab-refresh-group win 'reframe) + (tab-refresh-group win 'reframe-all) (tab-refresh-group win 'move)) ((eq 'type args) (tab-refresh-group win 'type) @@ -428,6 +454,8 @@ (add-hook 'unshade-window-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'unshade)))) (add-hook 'iconify-window-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'iconify)))) (add-hook 'uniconify-window-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'uniconify)))) + (add-hook 'window-maximized-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'maximized)))) + (add-hook 'window-unmaximized-hook (lambda (win) (if (window-tabbed-p win) (tab-refresh-group win 'maximized)))) (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))
Attachment:
signature.asc
Description: PGP signature