]> git.eshelyaron.com Git - emacs.git/commitdiff
Use the attributes of frame's monitor for gamegrid
authorRobert Pluim <rpluim@gmail.com>
Mon, 22 Aug 2022 12:33:02 +0000 (14:33 +0200)
committerRobert Pluim <rpluim@gmail.com>
Mon, 22 Aug 2022 13:22:07 +0000 (15:22 +0200)
* lisp/play/gamegrid.el (gamegrid-calculate-glyph-size): Use the
monitor where the current frame is displayed rather than the primary
monitor.

lisp/play/gamegrid.el

index 3ad42114d01c1af0d774276a1f5968d60d788dc3..bdc056e1ddf3de567af09e111bbeeb188a2f51f8 100644 (file)
@@ -80,8 +80,12 @@ directory will be used.")
 (defun gamegrid-calculate-glyph-size ()
   "Calculate appropriate glyph size in pixels based on display resolution.
 Return a multiple of 8 no less than 16."
-  (let ((atts (car (display-monitor-attributes-list)))
+  (let (atts
         y-pitch)
+    (dolist (mon (display-monitor-attributes-list))
+      (when-let ((frames (alist-get 'frames mon))
+                 (match (memq (selected-frame) frames)))
+        (setq atts mon)))
     (setq y-pitch (cond
                    (atts
                     (/ (nth 4 (assq 'geometry atts))