about summary refs log tree commit diff
path: root/exwm-randr.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2018-02-20T14·17+0800
committerChris Feng <chris.w.feng@gmail.com>2018-02-20T14·17+0800
commitc821f76dfef9d7592b263f8fea789b6da7fbddf4 (patch)
tree5de88d69d27cf572a89114d13af39373c7f5376d /exwm-randr.el
parentbfa35c0e388e5b4daf27aa162ecb6323f7716c85 (diff)
Use the 'exwm-randr-output' frame parameter to determine the output
* exwm-randr.el (exwm-randr--refresh): Always set the name of primary
output.

* exwm-workspace.el (exwm-workspace-switch)
(exwm-workspace-move-window): Use 'exwm-randr-output' frame parameter
to check if two frames are on the same output.
Diffstat (limited to 'exwm-randr.el')
-rw-r--r--exwm-randr.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/exwm-randr.el b/exwm-randr.el
index f49073c455..39edb7b1b9 100644
--- a/exwm-randr.el
+++ b/exwm-randr.el
@@ -89,7 +89,7 @@ the first one in result being the primary output."
 
 (defun exwm-randr--refresh ()
   "Refresh workspaces according to the updated RandR info."
-  (let (output-name geometry output-plist default-geometry)
+  (let (output-name geometry output-plist primary-output default-geometry)
     ;; Query all outputs
     (with-slots (config-timestamp outputs)
         (xcb:+request-unchecked+reply exwm--connection
@@ -115,8 +115,9 @@ the first one in result being the primary output."
                                             :x x :y y
                                             :width width :height height)
                     output-plist (plist-put output-plist output-name geometry))
-              (unless default-geometry ;assume the first output as primary
-                (setq default-geometry geometry)))))))
+              (unless primary-output
+                (setq primary-output output-name
+                      default-geometry geometry)))))))
     (exwm--log "(randr) outputs: %s" output-plist)
     (when output-plist
       (when exwm-workspace--fullscreen-frame-count
@@ -128,7 +129,7 @@ the first one in result being the primary output."
                (frame (elt exwm-workspace--list i)))
           (unless geometry
             (setq geometry default-geometry
-                  output nil))
+                  output primary-output))
           (set-frame-parameter frame 'exwm-randr-output output)
           (set-frame-parameter frame 'exwm-geometry geometry)))
       ;; Update workareas.