emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/exwm b6d6600 1/4: Add workspace support in per-applicat


From: Chris Feng
Subject: [elpa] externals/exwm b6d6600 1/4: Add workspace support in per-application configurations
Date: Fri, 23 Mar 2018 11:58:38 -0400 (EDT)

branch: externals/exwm
commit b6d660042e8f949890e6b4d5c397235d1653fdfe
Author: Chris Feng <address@hidden>
Commit: Chris Feng <address@hidden>

    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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]