From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel 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 Message-ID: <877d30zcuv.fsf@gmail.com> References: <166116922729.31296.246705257169485409@vcs2.savannah.gnu.org> <20220822115347.97D6CC04F01@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13521"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Aug 22 14:24:21 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQ6Td-0003Jx-7D for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Aug 2022 14:24:21 +0200 Original-Received: from localhost ([::1]:51590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQ6Tb-0002U5-Mq for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Aug 2022 08:24:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ6ST-0001nu-12 for emacs-devel@gnu.org; Mon, 22 Aug 2022 08:23:09 -0400 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:40696) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQ6SR-0007n2-Ie for emacs-devel@gnu.org; Mon, 22 Aug 2022 08:23:08 -0400 Original-Received: by mail-wr1-x42e.google.com with SMTP id h5so12183525wru.7 for ; Mon, 22 Aug 2022 05:23:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:gmane-reply-to-list:references :in-reply-to:subject:cc:to:from:from:to:cc; bh=PEV4WVFJOX4hJcDGwYMmXs+Y/wU7oaDRDdwMpc3qeR0=; b=OOKFzOVnrOfZuTs/1wunulPPbkk7deftdec2u7ATbifbGrwlQA9LQwjT7qMWSjegpS 9V9nD6zcCZInY3mrTrvCENoiF9SKyF2CCnL0GlqteNDGGa0yFpFApb0e00WWpaC1SG3t jOhp01HMP3xHmzDIqJoDKYqban76bbknxwZ0/IW9JHW7q+DOMT7DMI0DBupiDbu//uED qtLs77Hpy1x/TmTsJAAYLFbMrvRgSqSKOSFArmMuHl/vFzXqOHM9s4GsybfpYR0v4N9q 0G4f8fFpErO0bV409Y+jL8QcZrVeZ54HjAN8qqFszihYEVEDbxTm95Y+skULparhORRT N5rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:gmane-reply-to-list:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=PEV4WVFJOX4hJcDGwYMmXs+Y/wU7oaDRDdwMpc3qeR0=; b=Hwbw6iDZtGQDsYZmSFn1vGkw+wQwvldQAjS8NdOtxYOGhPKYAELrVF5Maj+6gfdgxN /CsS+gT9vaX9BM8ih5qs9fiszHYaM8XwpliJVZNdJtL1pwYrDzh6NzxNQX94EL7Y41vC xRaDxQtlegj/wwF1rVGD8u7+177pBjXjlwDS3Y5MAN+ALqUjXpZAHTjl8h4NwFWo7OFK Fti1zi+0QmOldy5pCEWXA1/1ect9hQXdje+AtQr2tF/8dJr4cghDoYZ9bbCauZYxSbSL r52SUsMdeB2jUWtuWQJrNFfsepuEwwY5+deXRrjB7mZuQoLVzHOerNykitRFkrCqppTK oTMw== X-Gm-Message-State: ACgBeo1sPnnupVd5DnoDRRAI7nVtlfBr80pLGAvPxk6cwyuAMhbGhKSU vrjzg4vYa/8ChhK4Gaum7ho= X-Google-Smtp-Source: AA6agR7PaBIPnWENR5LjD9Df2pq1V1lsYU1B7NG0E9MxelfSKoDP5crO63AcQrlegSJ1TrpW8yn9Xw== X-Received: by 2002:a5d:64a6:0:b0:21f:b3b:5cc9 with SMTP id m6-20020a5d64a6000000b0021f0b3b5cc9mr10103827wrp.601.1661170985865; Mon, 22 Aug 2022 05:23:05 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb50:4c7d:a828:c41f:1269]) by smtp.gmail.com with ESMTPSA id b18-20020a5d6352000000b002252751629dsm11338753wrw.24.2022.08.22.05.23.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 05:23:05 -0700 (PDT) In-Reply-To: <20220822115347.97D6CC04F01@vcs2.savannah.gnu.org> (Lars Ingebrigtsen's message of "Mon, 22 Aug 2022 07:53:47 -0400 (EDT)") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=rpluim@gmail.com; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293797 Archived-At: >>>>> On Mon, 22 Aug 2022 07:53:47 -0400 (EDT), Lars Ingebrigtsen said: Lars> branch: master Lars> commit f421efdb5f03d5f7efc3f6893c280b27e54a33cb Lars> Author: Lars Ingebrigtsen Lars> Commit: Lars Ingebrigtsen 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 --