about summary refs log tree commit diff
path: root/exwm-randr.el
diff options
context:
space:
mode:
Diffstat (limited to 'exwm-randr.el')
-rw-r--r--exwm-randr.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/exwm-randr.el b/exwm-randr.el
index 106ed6f83a..f488bd9ded 100644
--- a/exwm-randr.el
+++ b/exwm-randr.el
@@ -123,8 +123,9 @@ corresponding monitors whenever the monitors are active.
                                         :width width
                                         :height height)
                 monitor-plist (plist-put monitor-plist monitor-name geometry))
-          ;; Save primary monitor when available.
-          (when (/= 0 primary)
+          ;; Save primary monitor when available (fallback to the first one).
+          (when (or (/= 0 primary)
+                    (not primary-monitor))
             (setq primary-monitor monitor-name)))))
     (exwm--log "Primary monitor: %s" primary-monitor)
     (exwm--log "Monitors: %s" monitor-plist)