From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#37752: Scaling factor inconsistencies between X with and without GTK Date: Tue, 15 Oct 2019 09:56:46 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="163747"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37752@debbugs.gnu.org To: Carlos Pita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 15 09:57:26 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iKHht-000gTf-VR for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Oct 2019 09:57:26 +0200 Original-Received: from localhost ([::1]:36528 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKHhs-00044C-Fp for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Oct 2019 03:57:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52614) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iKHhY-0003yv-Es for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2019 03:57:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iKHhW-0006Sk-G0 for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2019 03:57:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33839) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iKHhW-0006Sg-93 for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2019 03:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iKHhW-0008Ej-5j for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2019 03:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Oct 2019 07:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37752 X-GNU-PR-Package: emacs Original-Received: via spool by 37752-submit@debbugs.gnu.org id=B37752.157112621731649 (code B ref 37752); Tue, 15 Oct 2019 07:57:02 +0000 Original-Received: (at 37752) by debbugs.gnu.org; 15 Oct 2019 07:56:57 +0000 Original-Received: from localhost ([127.0.0.1]:42660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iKHhQ-0008EP-SM for submit@debbugs.gnu.org; Tue, 15 Oct 2019 03:56:57 -0400 Original-Received: from mail-wm1-f43.google.com ([209.85.128.43]:35645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iKHhP-0008EB-2S for 37752@debbugs.gnu.org; Tue, 15 Oct 2019 03:56:55 -0400 Original-Received: by mail-wm1-f43.google.com with SMTP id y21so19159080wmi.0 for <37752@debbugs.gnu.org>; Tue, 15 Oct 2019 00:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=gY4J6ctpeSnztV9n2IjqDQgHjUGYpBG80amT5QmnX5I=; b=bQKZud5HLKy/VUa0FlVxhGhloNqenOaG9IXA71FD+IyThovKNpjljUsoE9HMbjIkcn 22KrnwX5/7ph6puc80PKLopTrx7ErEpDn3+HOuO5lTXacniEfgXJfNvw0fCqMkrVseKG feK5+CvWVRHKY/K395lP1HA2dW8ueG0Kmt0eShap1ztfS8jPBv0oLdsdClgVDeb6+F1f ZP9NobwkhnVseODiuFrDarWVbdCG/rgcwGTfh/6tIJ7Ggs6IhHxw5wVEsC0DnsBYs7wI YiafzITjuGByIF8BR55POnirW/COi9+Y1WZ8SbR+qRJcyzgg5o+EMXbW6962XAmpDzSt Oe/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=gY4J6ctpeSnztV9n2IjqDQgHjUGYpBG80amT5QmnX5I=; b=U3EPWO3Q7cUgg731wgZkAzfUpE9ncuZboBT9EXUtC80txPJJD/AgQ1F2IlHK1LAliV VZeCTrLkIXTuxlmX04K3Pvre40p4DQi2NlIGUWXRXEx55DNtuNyvsn82WLkULLVECMyx /hrQ9s3e6ybWmw2ENTQ3KkKqvB5votzz5mKJcOyjM/ybgAKfl1tSBhpBHSWu14QLH68D BpwLkl1EaH+5X+3hb3TvMfITicW7d+NWLKFTdGxQOLgAM9D64wjbsN3ErLxmzSaGDbpB T8vNw+9dPIAOdL7tCbNlnJK4Aj9KhKo7Xme/tAR+LiB56pxWq+U0pzo5VTkpvbTIzv/j r7jQ== X-Gm-Message-State: APjAAAXie0Lz8f3LN1CMlFMdy3G/Rl5r0hGJNGS6n0cQIyfZ8hF8RbG2 luiteIwbmGlVskbhngc9S0eLiZclggk= X-Google-Smtp-Source: APXvYqxQQVU+ZZWSUoUAN+d9hbELzyJ+Es0gnrgFHCSi2WsqLxjsb+IMfIGp3dO3fcEOkgYtsOqqhA== X-Received: by 2002:a1c:6a0b:: with SMTP id f11mr19392974wmc.78.1571126208468; Tue, 15 Oct 2019 00:56:48 -0700 (PDT) Original-Received: from rpluim-mac ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id p85sm28517246wme.23.2019.10.15.00.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Oct 2019 00:56:47 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: (Carlos Pita's message of "Mon, 14 Oct 2019 21:21:54 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:169361 Archived-At: >>>>> On Mon, 14 Oct 2019 21:21:54 -0300, Carlos Pita said: Carlos> In many places in xterm.c you have code like: Carlos> #ifdef USE_GTK Carlos> scale =3D xg_get_scale (f); Carlos> #endif Carlos> Sometimes scale is only used in GTK specific code and that's ok. Carlos> But sometimes it's used in code that's not particular to GTK, f= or example: Carlos> int scale =3D 1; Carlos> #ifdef USE_GTK Carlos> scale =3D xg_get_scale (f); Carlos> #endif Carlos> FRAME_CR_SURFACE (f) =3D Carlos> cairo_image_surface_create (CAIRO_FORMAT_ARGB32, Carlos> scale * FRAME_PIXEL_WIDTH (f), Carlos> scale * FRAME_PIXEL_HEIGHT (f)); I can=CA=BCt find that code in master. Carlos> Besides, there is x_get_scale_factor, also defined in xterm.c, = which Carlos> computes the scaling factor in a GTK-independent way, and also Carlos> discriminates between x and y scaling factors. It's only used by Carlos> x_draw_underwave. Carlos> I would like to abstract both cases inside x_get_scale_factor, = that Carlos> would then use xg_get_scale if in GTK or compute just one scali= ng Carlos> factor (for x or for y) otherwise. Notice that given that the s= caling Carlos> factor is the ratio of the effective resolution to a base resol= ution Carlos> of 96 dpi *truncated down* to the nearest integer, AFAICS it's = almost Carlos> impossible to get different scaling factors for x and for y. Sure, that makes sense. Do you have a test case showing a display difference, or is this just code cleanup? Robert