unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: What is the proper way to scale fringe-bitmaps for high-DPI displays?
Date: Wed, 20 Mar 2019 15:34:26 -0400	[thread overview]
Message-ID: <59f034d0-3473-0a83-ccf6-1a6fe446964c@gmail.com> (raw)
In-Reply-To: <83pnqlsb8l.fsf@gnu.org>

On 2019-03-20 13:32, Eli Zaretskii wrote:
>> From: Clément Pit-Claudel <cpitclaudel@gmail.com>
>> Date: Wed, 20 Mar 2019 10:55:43 -0400
>>
>> Users on Flycheck are complaining about poor readability of our fringe bitmaps on high-DPI monitors, as the bitmaps look tiny on such screens.  An easy fix is to double the size of the bitmap, but it leaves users of low-DPI monitors in the cold.  A trickier fix would be to dynamically detect the current monitor's density, and pick the appropriate bitmap accordingly, but I'm not entirely sure how to do detect these high-DPI monitors:
>>
>> - x-display-monitor-attributes-list seems OK, but looks more complex than what we need (based on looking at the C code) — is it OK to call it repeatedly to figure out the current monitor's density for a given frame?
> 
> That'd be very inelegant, IMO.

Understood. Thanks for your input! (And for the quick answer)

> Instead, I think when a frame is created, we should record its
> high-DPI state in the frame structure, or maybe in the frame's
> parameters, and then use that when we prepare the fringe bitmaps for
> display.

That would be nice.  In fact, we already have code to detect high-DPI displays in C, in x_get_scale_factor in xterm.c (used to scale wavy underlines).  Would the way to go be to record the value returned by this function in the frame's parameters?
 
>> Also, how do applications typically deal with frames being moved from a low-DPI monitor to a high-DPI one? Is that an issue in practice?
> 
> If a frame can be moved from high-DPI to low-DPI, then I guess we will
> need to query the low-level interfaces which report that in
> update_frame or thereabouts.

Got it. Thanks!

I guess that another approach would be to support scalable images in the fringe, rather than bitmaps.  If the fringe image was SVG instead of a bitmap, for example, we could make it fill the whole width of the fringe.

Do you have a sense of how hard that would be?

Clément.



  reply	other threads:[~2019-03-20 19:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 14:55 What is the proper way to scale fringe-bitmaps for high-DPI displays? Clément Pit-Claudel
2019-03-20 17:32 ` Eli Zaretskii
2019-03-20 19:34   ` Clément Pit-Claudel [this message]
2019-03-20 19:44     ` Eli Zaretskii
2019-03-20 20:05       ` Clément Pit-Claudel
2019-03-20 20:17         ` Eli Zaretskii
2019-03-20 21:17           ` Clément Pit-Claudel
2019-03-21  3:32             ` Eli Zaretskii
2019-03-21 11:43               ` Daniel Pittman
2019-03-21 13:33                 ` Yuri Khan
2019-03-21 14:32                   ` Eli Zaretskii
2019-03-21 17:32                     ` Alex
2019-03-21 18:31                       ` Eli Zaretskii
2019-03-21 17:38                     ` Clément Pit-Claudel
2019-03-21 18:33                       ` Eli Zaretskii
2019-03-21 17:40               ` Clément Pit-Claudel
2019-03-20 19:37   ` Clément Pit-Claudel
2019-03-21 15:24   ` Dmitry Gutov
2019-03-21 16:02     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=59f034d0-3473-0a83-ccf6-1a6fe446964c@gmail.com \
    --to=cpitclaudel@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).