• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Japanese translation of message catalog for Sawfish Window-Manager


Commit MetaInfo

Revisión62e3dd52f9e3e866aeeda95687dac38cea242676 (tree)
Tiempo1999-08-02 21:55:29
Autorjohn <john>
Commiterjohn

Log Message

(transients-on-parents-workspace): new variable

(merge-next-workspace, merge-previous-workspace, insert-workspace): new
commands, in the workspace menu

(popup-workspace-list, popup-window-list): new commands

Cambiar Resumen

Diferencia incremental

--- a/lisp/sawfish/wm/workspace.jl
+++ b/lisp/sawfish/wm/workspace.jl
@@ -36,6 +36,10 @@ workspace.")
3636 (defvar raise-windows-on-uniconify t
3737 "When non-nil, windows are raised after being uniconified.")
3838
39+(defvar transients-on-parents-workspace nil
40+ "When non-nil transient windows are opened on the same workspace as
41+their parent window.")
42+
3943 ;; List of all workspaces; a workspace is `(workspace WINDOWS...)'.
4044 ;; Each window has its `workspace' property set to the workspace it's
4145 ;; a member of. [src/gnome.c accesses this variable]
@@ -46,7 +50,10 @@ workspace.")
4650
4751 (defvar static-workspace-menus
4852 '(("Next" next-workspace)
49- ("Previous" previous-workspace)))
53+ ("Previous" previous-workspace)
54+ ("Insert" insert-workspace)
55+ ("Merge next" merge-next-workspace)
56+ ("Merge previous" merge-previous-workspace)))
5057
5158
5259 ;; Low level functions
@@ -64,18 +71,41 @@ workspace.")
6471 ;; usually called from the add-window-hook
6572 (defun ws-add-window (w)
6673 (unless (window-get w 'sticky)
67- (if (null ws-current-workspace)
68- (progn
69- ;; initialisation
70- (setq ws-current-workspace (list 'workspace w))
71- (setq ws-workspaces (list ws-current-workspace))
72- (call-hook 'add-workspace-hook (list ws-current-workspace)))
73- (rplacd ws-current-workspace
74- (nconc (delq w (cdr ws-current-workspace)) (list w))))
75- (window-put w 'workspace ws-current-workspace)
76- (unless (window-visible-p w)
77- (show-window w))
78- (call-hook 'add-to-workspace-hook (list w))))
74+ (let
75+ (parent)
76+ (if (and transients-on-parents-workspace
77+ (window-transient-p w)
78+ (setq parent (get-window-by-id (window-transient-p w)))
79+ (window-get parent 'workspace)
80+ (not (eq (window-get parent 'workspace) ws-current-workspace)))
81+ ;; put the window on its parents workspace
82+ (ws-add-window-to-space w (window-get parent 'workspace))
83+ (if (null ws-current-workspace)
84+ (progn
85+ ;; initialisation
86+ (setq ws-current-workspace (list 'workspace w))
87+ (setq ws-workspaces (list ws-current-workspace))
88+ (call-hook 'add-workspace-hook (list ws-current-workspace)))
89+ (rplacd ws-current-workspace
90+ (nconc (delq w (cdr ws-current-workspace)) (list w))))
91+ (window-put w 'workspace ws-current-workspace)
92+ (unless (window-visible-p w)
93+ (show-window w))
94+ (call-hook 'add-to-workspace-hook (list w))))))
95+
96+;; called from the map-notify hook
97+(defun ws-window-mapped (w)
98+ (let
99+ (parent)
100+ (when (and transients-on-parents-workspace
101+ (window-transient-p w)
102+ (not (window-get w 'sticky))
103+ (setq parent (get-window-by-id (window-transient-p w)))
104+ (window-get parent 'workspace)
105+ (not (eq (window-get w 'workspace)
106+ (window-get parent 'workspace))))
107+ (ws-remove-window w)
108+ (ws-add-window-to-space w (window-get parent 'workspace)))))
79109
80110 (defun ws-remove-window (w)
81111 (let
@@ -108,6 +138,15 @@ workspace.")
108138 (call-hook 'add-workspace-hook (list space))
109139 space))
110140
141+(defun ws-insert-workspace ()
142+ (if (null ws-workspaces)
143+ (ws-add-workspace t)
144+ (let
145+ ((space (list 'workspace))
146+ (join (memq ws-current-workspace ws-workspaces)))
147+ (rplacd join (cons space (cdr join)))
148+ space)))
149+
111150 (defun ws-find-next-workspace (&optional cycle)
112151 (when (cdr ws-workspaces)
113152 (let
@@ -135,6 +174,18 @@ workspace.")
135174 (show-window w))) (cdr ws-current-workspace))
136175 (call-hook 'enter-workspace-hook (list ws-current-workspace)))))
137176
177+(defun ws-merge-workspaces (src dest)
178+ ;; XXX doing this causes a nasty flicker of windows that
179+ ;; XXX get unmapped, moved, then re-mapped
180+ (when (eq ws-current-workspace src)
181+ (ws-switch-workspace dest))
182+ (while (cdr src)
183+ (let
184+ ((w (nth 1 src)))
185+ (ws-remove-window w)
186+ (ws-add-window-to-space w dest)))
187+ (setq ws-workspaces (delq src ws-workspaces)))
188+
138189
139190 ;; Menu constructors
140191
@@ -155,6 +206,10 @@ workspace.")
155206 (setq i (1+ i)))
156207 (nconc (nreverse menu) (list nil) static-workspace-menus)))
157208
209+(defun popup-workspace-list ()
210+ (interactive)
211+ (popup-menu (workspace-menu)))
212+
158213 (defun window-menu ()
159214 (let
160215 (menu space win name)
@@ -182,6 +237,10 @@ workspace.")
182237 (setq menu (cons nil menu))))
183238 (nreverse menu)))
184239
240+(defun popup-window-list ()
241+ (interactive)
242+ (popup-menu (window-menu)))
243+
185244
186245 ;; Commands
187246
@@ -221,7 +280,6 @@ will be created."
221280 (ws-remove-window window)
222281 (ws-add-window-to-space window space)))
223282
224-
225283 (defun next-workspace-window ()
226284 "Focus on the next window of the current workspace"
227285 (interactive)
@@ -238,6 +296,25 @@ will be created."
238296 (when (and space (not (eq space ws-current-workspace)))
239297 (ws-switch-workspace space))))
240298
299+(defun merge-next-workspace ()
300+ "Delete the current workspace. Its member windows are relocated to the next
301+workspace."
302+ (interactive)
303+ (when (> (length ws-workspaces) 1)
304+ (ws-merge-workspaces ws-current-workspace (ws-find-next-workspace t))))
305+
306+(defun merge-previous-workspace ()
307+ "Delete the current workspace. Its member windows are relocated to the next
308+workspace."
309+ (interactive)
310+ (when (> (length ws-workspaces) 1)
311+ (ws-merge-workspaces ws-current-workspace (ws-find-previous-workspace t))))
312+
313+(defun insert-workspace ()
314+ "Create a new workspace following the current workspace."
315+ (interactive)
316+ (ws-switch-workspace (ws-insert-workspace)))
317+
241318
242319 ;; Iconification (but without icons)
243320
@@ -283,4 +360,5 @@ will be created."
283360 (unless (memq 'ws-add-window add-window-hook)
284361 (add-hook 'add-window-hook 'ws-add-window t)
285362 (add-hook 'destroy-notify-hook 'ws-remove-window t)
363+ (add-hook 'map-notify-hook 'ws-window-mapped t)
286364 (mapc 'ws-add-window (managed-windows)))
--- a/lisp/workspace.jl
+++ b/lisp/workspace.jl
@@ -36,6 +36,10 @@ workspace.")
3636 (defvar raise-windows-on-uniconify t
3737 "When non-nil, windows are raised after being uniconified.")
3838
39+(defvar transients-on-parents-workspace nil
40+ "When non-nil transient windows are opened on the same workspace as
41+their parent window.")
42+
3943 ;; List of all workspaces; a workspace is `(workspace WINDOWS...)'.
4044 ;; Each window has its `workspace' property set to the workspace it's
4145 ;; a member of. [src/gnome.c accesses this variable]
@@ -46,7 +50,10 @@ workspace.")
4650
4751 (defvar static-workspace-menus
4852 '(("Next" next-workspace)
49- ("Previous" previous-workspace)))
53+ ("Previous" previous-workspace)
54+ ("Insert" insert-workspace)
55+ ("Merge next" merge-next-workspace)
56+ ("Merge previous" merge-previous-workspace)))
5057
5158
5259 ;; Low level functions
@@ -64,18 +71,41 @@ workspace.")
6471 ;; usually called from the add-window-hook
6572 (defun ws-add-window (w)
6673 (unless (window-get w 'sticky)
67- (if (null ws-current-workspace)
68- (progn
69- ;; initialisation
70- (setq ws-current-workspace (list 'workspace w))
71- (setq ws-workspaces (list ws-current-workspace))
72- (call-hook 'add-workspace-hook (list ws-current-workspace)))
73- (rplacd ws-current-workspace
74- (nconc (delq w (cdr ws-current-workspace)) (list w))))
75- (window-put w 'workspace ws-current-workspace)
76- (unless (window-visible-p w)
77- (show-window w))
78- (call-hook 'add-to-workspace-hook (list w))))
74+ (let
75+ (parent)
76+ (if (and transients-on-parents-workspace
77+ (window-transient-p w)
78+ (setq parent (get-window-by-id (window-transient-p w)))
79+ (window-get parent 'workspace)
80+ (not (eq (window-get parent 'workspace) ws-current-workspace)))
81+ ;; put the window on its parents workspace
82+ (ws-add-window-to-space w (window-get parent 'workspace))
83+ (if (null ws-current-workspace)
84+ (progn
85+ ;; initialisation
86+ (setq ws-current-workspace (list 'workspace w))
87+ (setq ws-workspaces (list ws-current-workspace))
88+ (call-hook 'add-workspace-hook (list ws-current-workspace)))
89+ (rplacd ws-current-workspace
90+ (nconc (delq w (cdr ws-current-workspace)) (list w))))
91+ (window-put w 'workspace ws-current-workspace)
92+ (unless (window-visible-p w)
93+ (show-window w))
94+ (call-hook 'add-to-workspace-hook (list w))))))
95+
96+;; called from the map-notify hook
97+(defun ws-window-mapped (w)
98+ (let
99+ (parent)
100+ (when (and transients-on-parents-workspace
101+ (window-transient-p w)
102+ (not (window-get w 'sticky))
103+ (setq parent (get-window-by-id (window-transient-p w)))
104+ (window-get parent 'workspace)
105+ (not (eq (window-get w 'workspace)
106+ (window-get parent 'workspace))))
107+ (ws-remove-window w)
108+ (ws-add-window-to-space w (window-get parent 'workspace)))))
79109
80110 (defun ws-remove-window (w)
81111 (let
@@ -108,6 +138,15 @@ workspace.")
108138 (call-hook 'add-workspace-hook (list space))
109139 space))
110140
141+(defun ws-insert-workspace ()
142+ (if (null ws-workspaces)
143+ (ws-add-workspace t)
144+ (let
145+ ((space (list 'workspace))
146+ (join (memq ws-current-workspace ws-workspaces)))
147+ (rplacd join (cons space (cdr join)))
148+ space)))
149+
111150 (defun ws-find-next-workspace (&optional cycle)
112151 (when (cdr ws-workspaces)
113152 (let
@@ -135,6 +174,18 @@ workspace.")
135174 (show-window w))) (cdr ws-current-workspace))
136175 (call-hook 'enter-workspace-hook (list ws-current-workspace)))))
137176
177+(defun ws-merge-workspaces (src dest)
178+ ;; XXX doing this causes a nasty flicker of windows that
179+ ;; XXX get unmapped, moved, then re-mapped
180+ (when (eq ws-current-workspace src)
181+ (ws-switch-workspace dest))
182+ (while (cdr src)
183+ (let
184+ ((w (nth 1 src)))
185+ (ws-remove-window w)
186+ (ws-add-window-to-space w dest)))
187+ (setq ws-workspaces (delq src ws-workspaces)))
188+
138189
139190 ;; Menu constructors
140191
@@ -155,6 +206,10 @@ workspace.")
155206 (setq i (1+ i)))
156207 (nconc (nreverse menu) (list nil) static-workspace-menus)))
157208
209+(defun popup-workspace-list ()
210+ (interactive)
211+ (popup-menu (workspace-menu)))
212+
158213 (defun window-menu ()
159214 (let
160215 (menu space win name)
@@ -182,6 +237,10 @@ workspace.")
182237 (setq menu (cons nil menu))))
183238 (nreverse menu)))
184239
240+(defun popup-window-list ()
241+ (interactive)
242+ (popup-menu (window-menu)))
243+
185244
186245 ;; Commands
187246
@@ -221,7 +280,6 @@ will be created."
221280 (ws-remove-window window)
222281 (ws-add-window-to-space window space)))
223282
224-
225283 (defun next-workspace-window ()
226284 "Focus on the next window of the current workspace"
227285 (interactive)
@@ -238,6 +296,25 @@ will be created."
238296 (when (and space (not (eq space ws-current-workspace)))
239297 (ws-switch-workspace space))))
240298
299+(defun merge-next-workspace ()
300+ "Delete the current workspace. Its member windows are relocated to the next
301+workspace."
302+ (interactive)
303+ (when (> (length ws-workspaces) 1)
304+ (ws-merge-workspaces ws-current-workspace (ws-find-next-workspace t))))
305+
306+(defun merge-previous-workspace ()
307+ "Delete the current workspace. Its member windows are relocated to the next
308+workspace."
309+ (interactive)
310+ (when (> (length ws-workspaces) 1)
311+ (ws-merge-workspaces ws-current-workspace (ws-find-previous-workspace t))))
312+
313+(defun insert-workspace ()
314+ "Create a new workspace following the current workspace."
315+ (interactive)
316+ (ws-switch-workspace (ws-insert-workspace)))
317+
241318
242319 ;; Iconification (but without icons)
243320
@@ -283,4 +360,5 @@ will be created."
283360 (unless (memq 'ws-add-window add-window-hook)
284361 (add-hook 'add-window-hook 'ws-add-window t)
285362 (add-hook 'destroy-notify-hook 'ws-remove-window t)
363+ (add-hook 'map-notify-hook 'ws-window-mapped t)
286364 (mapc 'ws-add-window (managed-windows)))