GNU bug report logs - #37752
Scaling factor inconsistencies between X with and without GTK

Previous Next

Package: emacs;

Reported by: Carlos Pita <carlosjosepita <at> gmail.com>

Date: Tue, 15 Oct 2019 00:23:01 UTC

Severity: normal

Done: Carlos Pita <carlosjosepita <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 37752 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: 37752 <at> debbugs.gnu.org
Subject: Re: bug#37752: Scaling factor inconsistencies between X with and
 without GTK
Date: Tue, 15 Oct 2019 09:56:46 +0200
>>>>> On Mon, 14 Oct 2019 21:21:54 -0300, Carlos Pita <carlosjosepita <at> gmail.com> said:

    Carlos> In many places in xterm.c you have code like:
    Carlos> #ifdef USE_GTK
    Carlos>   scale = 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, for example:

    Carlos> int scale = 1;
    Carlos> #ifdef USE_GTK
    Carlos>   scale = xg_get_scale (f);
    Carlos> #endif
    Carlos> FRAME_CR_SURFACE (f) =
    Carlos>     cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
    Carlos>       scale * FRAME_PIXEL_WIDTH (f),
    Carlos>       scale * FRAME_PIXEL_HEIGHT (f));

I canʼt 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 scaling
    Carlos> factor (for x or for y) otherwise. Notice that given that the scaling
    Carlos> factor is the ratio of the effective resolution to a base resolution
    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




This bug report was last modified 5 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.