From b6d660042e8f949890e6b4d5c397235d1653fdfe Mon Sep 17 00:00:00 2001 From: Chris Feng Date: Fri, 23 Mar 2018 23:49:39 +0800 Subject: [PATCH] Add workspace support in per-application configurations * exwm-manage.el (exwm-manage-configurations) (exwm-manage--manage-window): Allow to specify which workspace an applications should be created on. --- exwm-manage.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/exwm-manage.el b/exwm-manage.el index 3e47f74..f440710 100644 --- a/exwm-manage.el +++ b/exwm-manage.el @@ -69,6 +69,7 @@ You can still make the X windows floating afterwards." (const :tag "Char-mode" char-mode) (const :tag "Prefix keys" prefix-keys) (const :tag "Simulation keys" simulation-keys) + (const :tag "Workspace" workspace) ;; For forward compatibility. (other)) :value-type (sexp :tag "Value" nil)))) @@ -202,7 +203,6 @@ You can still make the X windows floating afterwards." (exwm--update-hints id) (exwm-manage--update-geometry id) (exwm-manage--update-mwm-hints id) - (setq exwm--configurations (exwm-manage--get-configurations)) ;; No need to manage (please check OverrideRedirect outside) (when (or (not @@ -266,6 +266,10 @@ You can still make the X windows floating afterwards." (let ((kill-buffer-query-functions nil)) (kill-buffer (current-buffer))) (throw 'return 'ignored)) + (setq exwm--configurations (exwm-manage--get-configurations)) + (let ((index (plist-get exwm--configurations 'workspace))) + (when (and index (< index (length exwm-workspace--list))) + (setq exwm--frame (elt exwm-workspace--list index)))) ;; Manage the window (exwm--log "Manage #x%x" id) (xcb:+request exwm--connection ;remove border @@ -290,7 +294,8 @@ You can still make the X windows floating afterwards." ;; User has specified whether it should be floating. (if (plist-get exwm--configurations 'floating) (exwm-floating--set-floating id) - (exwm-floating--unset-floating id)) + (with-selected-window (frame-selected-window exwm--frame) + (exwm-floating--unset-floating id))) ;; Try to determine if it should be floating. (if (and (not exwm-manage-force-tiling) (or exwm-transient-for exwm--fixed-size @@ -299,7 +304,8 @@ You can still make the X windows floating afterwards." (memq xcb:Atom:_NET_WM_WINDOW_TYPE_DIALOG exwm-window-type))) (exwm-floating--set-floating id) - (exwm-floating--unset-floating id))) + (with-selected-window (frame-selected-window exwm--frame) + (exwm-floating--unset-floating id)))) (if (plist-get exwm--configurations 'char-mode) (exwm-input-release-keyboard id) (exwm-input-grab-keyboard id))