emacs-devel
[Top][All Lists]
Advanced

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

Re: master f421efdb5f: Make the size of elements the same in pgtk and X


From: Robert Pluim
Subject: Re: master f421efdb5f: Make the size of elements the same in pgtk and X in tetris
Date: Mon, 22 Aug 2022 14:23:04 +0200

>>>>> On Mon, 22 Aug 2022 07:53:47 -0400 (EDT), Lars Ingebrigtsen 
>>>>> <larsi@gnus.org> said:

    Lars> branch: master
    Lars> commit f421efdb5f03d5f7efc3f6893c280b27e54a33cb
    Lars> Author: Lars Ingebrigtsen <larsi@gnus.org>
    Lars> Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Lars>     Make the size of elements the same in pgtk and X in tetris
    
    Lars>     * lisp/play/gamegrid.el (gamegrid-glyph-height-mm): Decrease
    Lars>     height a bit (since it wasn't really that height).
    Lars>     (gamegrid-calculate-glyph-size): Change calculation to work on
    Lars>     both X and pgtk (bug#49937).
    Lars>     (gamegrid-make-glyph): Inhibit image scaling.


That will always use the primary monitor. How about something like
this on top

diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index 3ad42114d0..bdc056e1dd 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -80,8 +80,12 @@ gamegrid-glyph-height-mm
 (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))

Robert
-- 



reply via email to

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