all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carlos Pita <carlosjosepita@gmail.com>
To: 37752@debbugs.gnu.org
Subject: bug#37752: Scaling factor inconsistencies between X with and without GTK
Date: Mon, 14 Oct 2019 21:21:54 -0300	[thread overview]
Message-ID: <CAELgYheD=Z3__BQntdiiRNmuNAgi0M+MS8wJcpowv_47JJ7kaA@mail.gmail.com> (raw)

In many places in xterm.c you have code like:

#ifdef USE_GTK
  scale = xg_get_scale (f);
#endif

Sometimes scale is only used in GTK specific code and that's ok.

But sometimes it's used in code that's not particular to GTK, for example:

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

Besides, there is x_get_scale_factor, also defined in xterm.c, which
computes the scaling factor in a GTK-independent way, and also
discriminates between x and y scaling factors. It's only used by
x_draw_underwave.

I would like to abstract both cases inside x_get_scale_factor, that
would then use xg_get_scale if in GTK or compute just one scaling
factor (for x or for y) otherwise. Notice that given that the scaling
factor is the ratio of the effective resolution to a base resolution
of 96 dpi *truncated down* to the nearest integer, AFAICS it's almost
impossible to get different scaling factors for x and for y.

What do you think?

Best regards
--
Carlos





             reply	other threads:[~2019-10-15  0:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-15  0:21 Carlos Pita [this message]
2019-10-15  7:56 ` bug#37752: Scaling factor inconsistencies between X with and without GTK Robert Pluim
2019-10-15  8:09   ` Carlos Pita
2019-10-15  9:37     ` Robert Pluim
2019-10-15 22:40       ` Carlos Pita

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAELgYheD=Z3__BQntdiiRNmuNAgi0M+MS8wJcpowv_47JJ7kaA@mail.gmail.com' \
    --to=carlosjosepita@gmail.com \
    --cc=37752@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.