Japanese translation of message catalog for Sawfish Window-Manager
修订版 | e23fced1ad164e1d42b17f3246dcffa43b68faab (tree) |
---|---|
时间 | 2012-03-26 23:59:40 |
作者 | Christopher Roy Bratusek <nano@tuxf...> |
Commiter | Christopher Roy Bratusek |
tab-group feature
@@ -109,6 +109,7 @@ | ||
109 | 109 | (ignored boolean) |
110 | 110 | (group ,(lambda () |
111 | 111 | `(symbol ,@(delete-if-not symbolp (window-group-ids))))) |
112 | + (tab-group string) | |
112 | 113 | (ungrouped boolean) |
113 | 114 | (cycle-skip boolean) |
114 | 115 | (window-list-skip boolean) |
@@ -274,7 +275,7 @@ | ||
274 | 275 | (remove-window-matcher-core (list (cons rules (car props))) |
275 | 276 | (cdr props))) |
276 | 277 | ) |
277 | - | |
278 | + | |
278 | 279 | (define (remove-window-matcher-core rules props) |
279 | 280 | (let |
280 | 281 | ((remove-from (lambda (slot) |
@@ -515,6 +516,11 @@ | ||
515 | 516 | (set-screen-viewport col row) |
516 | 517 | (set-window-viewport w col row)))))) |
517 | 518 | |
519 | + (define-match-window-setter 'tab-group | |
520 | + (lambda (w prop value) | |
521 | + (declare (unused prop)) | |
522 | + (when value | |
523 | + (window-put w 'tab-group (intern value))))) | |
518 | 524 | |
519 | 525 | (define-match-window-setter 'window-name |
520 | 526 | (lambda (w prop value) |
@@ -535,7 +541,7 @@ | ||
535 | 541 | ((eq value 'fullscreen) |
536 | 542 | (window-put w 'queued-fullscreen-maximize t)) |
537 | 543 | ((eq value 'full-xinerama) |
538 | - (window-put w 'queued-fullxinerama-maximize)) | |
544 | + (window-put w 'queued-fullxinerama-maximize t)) | |
539 | 545 | ))) |
540 | 546 | |
541 | 547 | (define-match-window-setter 'keymap-trans |
@@ -73,7 +73,7 @@ | ||
73 | 73 | |
74 | 74 | ;; list of states in window-state-change-hook that should be tracked |
75 | 75 | (defvar window-history-states '(sticky ignored never-focus type maximized |
76 | - frame-style cycle-skip | |
76 | + frame-style cycle-skip tab-group | |
77 | 77 | window-list-skip title-position)) |
78 | 78 | |
79 | 79 | ;; property matched on |
@@ -55,6 +55,9 @@ | ||
55 | 55 | (define oldgroup nil) |
56 | 56 | (define tab-groups nil) |
57 | 57 | (define tab-refresh-lock t) |
58 | + (define release-window nil) | |
59 | + (define last-unmap-id nil) | |
60 | + (define in-tab-group-name nil) | |
58 | 61 | |
59 | 62 | (define (window-tabbed-p w) |
60 | 63 | (window-get w 'tabbed)) |
@@ -132,6 +135,8 @@ | ||
132 | 135 | |
133 | 136 | (define (tab-delete-window-from-tab-groups w) |
134 | 137 | "Find window's group and remove it." |
138 | + (if (not release-window) | |
139 | + (remove-from-tab-group w)) | |
135 | 140 | (when (window-tabbed-p w) |
136 | 141 | (tab-delete-window-from-group w (tab-window-group-index w)) |
137 | 142 | (window-put w 'fixed-position nil) |
@@ -268,7 +273,9 @@ sticky, unsticky, fixed-position." | ||
268 | 273 | (when (not (eq index index2)) |
269 | 274 | ;; tabgroup to tabgroup |
270 | 275 | (when (window-tabbed-p w) |
271 | - (tab-delete-window-from-tab-groups w)) | |
276 | + (setq release-window t) | |
277 | + (tab-delete-window-from-tab-groups w) | |
278 | + (setq release-window nil)) | |
272 | 279 | (setq tab-refresh-lock nil) |
273 | 280 | (if (window-get w 'shaded) (unshade-window w)) |
274 | 281 | (if (window-get win 'shaded) (unshade-window win)) |
@@ -303,7 +310,9 @@ sticky, unsticky, fixed-position." | ||
303 | 310 | |
304 | 311 | (define (tab-release-window w) |
305 | 312 | "Release the window from its group." |
313 | + (setq release-window t) | |
306 | 314 | (tab-delete-window-from-tab-groups w) |
315 | + (setq release-window nil) | |
307 | 316 | (tab-make-new-group w)) |
308 | 317 | |
309 | 318 | (define-command 'tab-release-window tab-release-window #:spec "%f") |
@@ -402,7 +411,27 @@ sticky, unsticky, fixed-position." | ||
402 | 411 | (tab-refresh-group win 'move) |
403 | 412 | (tab-refresh-group win 'frame)))) |
404 | 413 | |
414 | + (define (unmap-id win) | |
415 | + (setq last-unmap-id (window-id win))) | |
416 | + | |
417 | + (define (in-tab-group win) | |
418 | + "Add a new window as tab if have one (the first created if more as one) | |
419 | +of the windows the same 'tab-group property" | |
420 | + (when (window-get win 'tab-group) | |
421 | + (setq in-tab-group-name (append in-tab-group-name (cons (cons (window-id win) (window-get win 'tab-group))))) | |
422 | + (let ((open-win-tabgroup (get-window-by-id (car (rassoc (window-get win 'tab-group) in-tab-group-name))))) | |
423 | + (if (and open-win-tabgroup | |
424 | + (not (eq win open-win-tabgroup))) | |
425 | + (tab-group-window win open-win-tabgroup))))) | |
426 | + | |
427 | + (define (remove-from-tab-group win) | |
428 | + "Remove window from in-tab-group-name alist if it have a 'tab-group property" | |
429 | + (when (window-get win 'tab-group) | |
430 | + (setq in-tab-group-name (remove (assoc last-unmap-id in-tab-group-name) in-tab-group-name)))) | |
431 | + | |
405 | 432 | (unless batch-mode |
433 | + (add-hook 'after-add-window-hook in-tab-group) | |
434 | + (add-hook 'unmap-notify-hook unmap-id) | |
406 | 435 | (add-hook 'window-state-change-hook |
407 | 436 | (lambda (win args) |
408 | 437 | (when (window-tabbed-p win) |