GNU bug report logs - #37689
Fringe pixmaps, widgets, etc. look ridiculously tiny in hidpi screen

Previous Next

Package: emacs;

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

Date: Thu, 10 Oct 2019 06:30:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37689 in the body.
You can then email your comments to 37689 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 06:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carlos Pita <carlosjosepita <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 10 Oct 2019 06:30:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Fringe pixmaps, widgets, etc. look ridiculously tiny in hidpi screen
Date: Thu, 10 Oct 2019 03:28:55 -0300
[Message part 1 (text/plain, inline)]
Hi, this issue has been raised many times in reddit and other forums.
Support for hidpi (e.g. my screen is 3000x2000) is rather deficient.
Buttons, checkboxes and other widgets look minuscule. The decorations in
the Fringe are barely visible. I'm not sure whether the best strategy is to
offer manually scaled up pixmap variants or to automatically scale them up
even if the result ends up being a bit blurry. In any case, most screens in
sell today are mid or hi resolution, it's almost impossible to buy a decent
piece of new hardware with a good old 1366x768 screen. And emacs should
catchup.

I propose to make an inventory of all the things that should be fixed
towards hidpi support and maybe provide an external package patching
whatever could be patched as a temporary measure.

I'm using emacs 26.3 in Ubuntu 19.04. My DE is Gnome 3.32, scaling factor =
2.

Best regards
--
Carlos
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 08:14:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets,
 etc. look ridiculously tiny in hidpi screen
Date: Thu, 10 Oct 2019 11:12:50 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Thu, 10 Oct 2019 03:28:55 -0300
> 
> I propose to make an inventory of all the things that should be fixed towards hidpi support and maybe provide
> an external package patching whatever could be patched as a temporary measure.

Please go ahead with making such an inventory, and thanks.

> I'm using emacs 26.3 in Ubuntu 19.04. My DE is Gnome 3.32, scaling factor = 2.

Please also verify that the situation hasn't changed in Emacs 27.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 13:27:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Carlos Pita <carlosjosepita <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 15:26:45 +0200
>>>>> On Thu, 10 Oct 2019 11:12:50 +0300, Eli Zaretskii <eliz <at> gnu.org> said:

    >> From: Carlos Pita <carlosjosepita <at> gmail.com>
    >> Date: Thu, 10 Oct 2019 03:28:55 -0300
    >> 
    >> I propose to make an inventory of all the things that should be fixed towards hidpi support and maybe provide
    >> an external package patching whatever could be patched as a temporary measure.

    Eli> Please go ahead with making such an inventory, and thanks.

    >> I'm using emacs 26.3 in Ubuntu 19.04. My DE is Gnome 3.32, scaling factor = 2.

Is that a font scaling factor of 2 via the gnome-tweak-tool, or a 200%
scale factor via the 'display' settings? I have the latter, and
everything looks ok for me.

Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 13:37:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 10:36:26 -0300
[Message part 1 (text/plain, inline)]
Hi Eli,

> Please go ahead with making such an inventory, and thanks.

I've attached some cases. In general, this seems to be related to
hardcoded pixmaps. One option is to support at lease 1x, 1.5x and 2x
version, using the one that best accommodates to current resolution
(1.5x screens 1920x1080 are quite popular these days). Another options
is to patch the underlying renderer of these pixmaps so that it scales
them although I don't know if there is one single place to patch here.

> Please also verify that the situation hasn't changed in Emacs 27.

Yes, it's exactly the same.
[Expand widget.png (image/png, attachment)]
[Flymake fringe indicator.png (image/png, attachment)]
[Fringe wrap indicator.png (image/png, attachment)]
[Checkbox icons.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 13:38:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 10:37:37 -0300
> Is that a font scaling factor of 2 via the gnome-tweak-tool, or a 200%
> scale factor via the 'display' settings? I have the latter, and
> everything looks ok for me.

No font scaling factor, just the display scaling factor. Also, no
fractional scaling factor enabled.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 13:48:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 15:47:11 +0200
>>>>> On Thu, 10 Oct 2019 10:37:37 -0300, Carlos Pita <carlosjosepita <at> gmail.com> said:

    >> Is that a font scaling factor of 2 via the gnome-tweak-tool, or a 200%
    >> scale factor via the 'display' settings? I have the latter, and
    >> everything looks ok for me.

    Carlos> No font scaling factor, just the display scaling factor. Also, no
    Carlos> fractional scaling factor enabled.

Youʼre on a much more recent version of GTK than I am, so I suspect
that the way to query the display's scale factor has changed (again),
so weʼre not applying it.

Can you run emacs under gdb, put a breakpoint on 'xg_get_scale', and
see what it returns? (perhaps I should add an internal variable to
expose that, but I worry that people will abuse it).

Robert





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 14:22:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 16:21:16 +0200
>>>>> On Thu, 10 Oct 2019 10:36:26 -0300, Carlos Pita <carlosjosepita <at> gmail.com> said:

    Carlos> Hi Eli,
    >> Please go ahead with making such an inventory, and thanks.

    Carlos> I've attached some cases. In general, this seems to be related to
    Carlos> hardcoded pixmaps. One option is to support at lease 1x, 1.5x and 2x
    Carlos> version, using the one that best accommodates to current resolution
    Carlos> (1.5x screens 1920x1080 are quite popular these days). Another options
    Carlos> is to patch the underlying renderer of these pixmaps so that it scales
    Carlos> them although I don't know if there is one single place to patch here.

Perhaps we should convert those pixmaps to some scaleable format, and
then autoscale them?

Robert










Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 14:34:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 11:33:34 -0300
> Perhaps we should convert those pixmaps to some scaleable format, and
> then autoscale them?

That could be done, but does this render you request for me to debug
the scaling factor issue obsolete? Because it seems to imply that
these particular problems won't be fixed by a correct detection of
scale anyway, and pretty much everything else looks ok here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 14:38:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 11:37:00 -0300
Another option is to provide pixmaps at 1x and 2x. Scaling is trivial
at 2x and any of them will look reasonable well at 1.5x.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 15:07:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: carlosjosepita <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 18:05:41 +0300
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  37689 <at> debbugs.gnu.org
> Date: Thu, 10 Oct 2019 16:21:16 +0200
> 
> Perhaps we should convert those pixmaps to some scaleable format, and
> then autoscale them?

You mean, SVG?  We could do that, but we'd like images to display well
even if Emacs cannot display SVG.

Also, I think fringe bitmaps and other icons we use in the UI cannot
be scalable, we need to scale them ourselves.  Not that I'm an expert
on that (so don't take my words as definitive and/or final).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 15:07:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 18:06:30 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Thu, 10 Oct 2019 11:33:34 -0300
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 37689 <at> debbugs.gnu.org
> 
> > Perhaps we should convert those pixmaps to some scaleable format, and
> > then autoscale them?
> 
> That could be done, but does this render you request for me to debug
> the scaling factor issue obsolete?

No, please go ahead with debugging this, and thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 15:44:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 12:43:28 -0300
> No, please go ahead with debugging this, and thanks.

Ok, no problem, it looks fine to me:

3701   return scroll_bar_width_for_theme * xg_get_scale (f);
Value returned is $1 = 2




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 15:53:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 12:51:57 -0300
On Thu, Oct 10, 2019 at 12:05 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: Robert Pluim <rpluim <at> gmail.com>
> > Cc: Eli Zaretskii <eliz <at> gnu.org>,  37689 <at> debbugs.gnu.org
> > Date: Thu, 10 Oct 2019 16:21:16 +0200
> >
> > Perhaps we should convert those pixmaps to some scaleable format, and
> > then autoscale them?
>
> You mean, SVG?  We could do that, but we'd like images to display well
> even if Emacs cannot display SVG.
>
> Also, I think fringe bitmaps and other icons we use in the UI cannot
> be scalable, we need to scale them ourselves.  Not that I'm an expert
> on that (so don't take my words as definitive and/or final).

At least for the fringe part, what do you think of modifying
define-fringe-bitmap to take into account scaling factor?

For example, if scaling factor > 1.5 make everything x2, if > 2.5 then
x3, etc. It seems quite simple to achieve those integer scalings.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 16:02:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 13:01:41 -0300
> For example, if scaling factor > 1.5 make everything x2, if > 2.5 then
> x3, etc. It seems quite simple to achieve those integer scalings.

Or maybe, safer:

1. >= 3  then  3x
2. >= 2  then  2x
3. Otherwise 1x

This way you are sure that the icon will fit the fringe. And anyway
intermediate resolutions won't usually be 1.9x but 1.5x  instead
(although experimental fractional scaling configuration dialogs
currently offer 1.25x and 1.75x).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 17:37:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 20:35:45 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Thu, 10 Oct 2019 12:51:57 -0300
> Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> 
> At least for the fringe part, what do you think of modifying
> define-fringe-bitmap to take into account scaling factor?

Wouldn't that make the pixels show?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 10 Oct 2019 17:41:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 10 Oct 2019 14:39:47 -0300
> Wouldn't that make the pixels show?

Not more than in a low-dpi screen at 1x, since 4 pixels in a retina
like screen are more or less the same size than 1 "traditional" pixel.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Fri, 11 Oct 2019 03:28:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Fri, 11 Oct 2019 00:26:57 -0300
I tried to hack around this problem with an advice:

(defun my-define-fringe-bitmap-advice (fun bitmap bits &optional
height width align)
  (when (<= (or width 8) 8)
    (setq width (* (or width 8) 2)
          height (when height (* height 2))
          bits (vconcat (mapcan
                         (lambda (in)
                           (let ((out 0))
                             (dotimes (i 8 (list out out))
                               (setq out (+ out (lsh (* (logand in 1)
3) (* i 2)))
                                     in (/ in 2)))))
                         bits))))
  (funcall fun bitmap bits height width align))
(advice-add #'define-fringe-bitmap :around #'my-define-fringe-bitmap-advice)

It works well but too late I realized that many pixmaps are built-in
and don't go through define-fringe-bitmap at all :(.

Maybe it could still be useful as a prototype.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Fri, 11 Oct 2019 03:49:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Fri, 11 Oct 2019 00:48:02 -0300
If you accept to recompute the pixmap on-the-fly each time it's demanded, then

fringe.c:
   static struct fringe_bitmap *get_fringe_bitmap_data (int bn)

seems like a good place to do the transformation above.

In order to avoid rescaling it each time, the pixmap structure could
contain an extra field with its scaling factor (initially 1) that is
updated after the first rescaling so that get_fringe_bitmap_data knows
(by comparing this number to the system scaling factor) that it's not
necessary to rescale the pixmap afterwards.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sat, 12 Oct 2019 00:52:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Fri, 11 Oct 2019 21:51:02 -0300
> If you accept to recompute the pixmap on-the-fly each time

I've been thinking that in a multi-monitor / multi-dpi world this
(though maybe coupled with some caching strategy, as I proposed in my
previous email) might be the only sensible approach.

If you agree I might try implementing something like what my advice
above does, but inside get_fringe_bitmap_data, with caching and
generalizing it to more scaling factors; nevertheless, I would be
keeping the integer scaling simplification since fractional scaling,
specially for such tiny bitmaps, would require a lot of handcrafting.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sat, 12 Oct 2019 07:29:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sat, 12 Oct 2019 10:28:25 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Fri, 11 Oct 2019 21:51:02 -0300
> Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> 
> If you agree I might try implementing something like what my advice
> above does, but inside get_fringe_bitmap_data, with caching and
> generalizing it to more scaling factors; nevertheless, I would be
> keeping the integer scaling simplification since fractional scaling,
> specially for such tiny bitmaps, would require a lot of handcrafting.

Fine with me, thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sat, 12 Oct 2019 07:58:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sat, 12 Oct 2019 04:56:45 -0300
Hi Eli,

after debugging the C part of the code I've changed my mind regarding
what I'd said.

First, I realized that the default build wasn't using cairo, so I changed that.

Now I'm exploring how to change scale in xterm.c/x_cr_draw_image, I've
tried changing the scale of the cairo context, of the surface and of
the pattern, yet to no avail. I guess I will have to sit  down and
read about how all these parts interact instead of my current
hit-and-miss approach. But maybe this will fix other problems, for
example those small widgets in my screenshots.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sat, 12 Oct 2019 08:28:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sat, 12 Oct 2019 05:26:54 -0300
[Message part 1 (text/plain, inline)]
Ok, I have arrived at something, I still have to understand the
details but many things are correctly scaled, including widget images.

Icons in the fringe seems to be ok but yet:
1. So checkboxes are weirdly clipped, even if correctly scaled.
2. Not sure about this, but I believe there is a slight vertical misalignment.
3. Default fringe sizes are too small for hidpi screen, they should
change according to screen dpi.

I'm attaching a diff so that you can have an idea of what I am
changing and probably improve on that.
[scale.diff (text/x-patch, attachment)]
[Screenshot from 2019-10-12 05-25-09.png (image/png, attachment)]
[Screenshot from 2019-10-12 05-26-09.png (image/png, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 00:41:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sun, 13 Oct 2019 21:40:14 -0300
I've been reading some related code (fringe.c, xterm.c, etc) but at
this point I feel I need some feedback from you in order to advance:

1. In my previous posts I have open two alternative paths:

1.a. Do the scaling as downstream as possible. The problem with this
approach is that I will be fixing the problem only for one backend
(for example, Cairo). Also, I would have to "hack" some assumptions
done upstream (for example, to adjust x, y and scale of a rectangle
that is assumed to be of a different geometry by the caller). The
advantage of the approach is that not only fringe icons but any other
image that is rendered by the lowest level routine will be properly
scaled; but, that said, I noticed that in emacs 26.3 widgets are not
using x_cr_draw_image.

1.b. Do the scaling upstream (for example, in get_fringe_bitmap_data
as proposed above). One problem with this approach is that some
backend could already be scaling output itself (for example, by using
a toolkit that automatically scales according to the device
resolution... do you know if this is the case for windows, for
macos?). Also, it won't fix the widgets issue (anyway, as I said,
neither the "downstream" approach will do it in 26.3).

2. I'm clueless regarding were widgets (I mean checkboxes and things
like that) are rendered. With Cairo backend enabled, x_cr_draw_image
is never reached in 26.3, its only user is the fringe module, I've
checked this in the debugger and by inspecting the code. Not sure
about 27, since tweaking x_cr_draw_image did have a (weird) effect, as
the screenshots in my previous post show.

Any help or opinion regarding these issues will be much appreciated, I
really want to move this forward.

Best regards
--
Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 08:34:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 11:33:02 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Sun, 13 Oct 2019 21:40:14 -0300
> Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> 
> 1.a. Do the scaling as downstream as possible. The problem with this
> approach is that I will be fixing the problem only for one backend
> (for example, Cairo). Also, I would have to "hack" some assumptions
> done upstream (for example, to adjust x, y and scale of a rectangle
> that is assumed to be of a different geometry by the caller). The
> advantage of the approach is that not only fringe icons but any other
> image that is rendered by the lowest level routine will be properly
> scaled; but, that said, I noticed that in emacs 26.3 widgets are not
> using x_cr_draw_image.
> 
> 1.b. Do the scaling upstream (for example, in get_fringe_bitmap_data
> as proposed above). One problem with this approach is that some
> backend could already be scaling output itself (for example, by using
> a toolkit that automatically scales according to the device
> resolution... do you know if this is the case for windows, for
> macos?). Also, it won't fix the widgets issue (anyway, as I said,
> neither the "downstream" approach will do it in 26.3).

Granted, I prefer the second approach.  We should do as little code
duplication as possible.

I don't think individual backends do any scaling, but if some do, it
should be easy to disable the scaling in our code for those backends.

> 2. I'm clueless regarding were widgets (I mean checkboxes and things
> like that) are rendered. With Cairo backend enabled, x_cr_draw_image
> is never reached in 26.3, its only user is the fringe module, I've
> checked this in the debugger and by inspecting the code. Not sure
> about 27, since tweaking x_cr_draw_image did have a (weird) effect, as
> the screenshots in my previous post show.

I'm not sure I understand how this is related to the issue at hand.
Can you elaborate?

Also, what exactly do you mean by "rendered"?  In Emacs, there are
generally 2 stages of displaying any "display element" (a character,
an image, etc.): first, a backend-independent step of loading the
display element, determining its metrics, and performing the display
layout calculations derived from that; and then backend-dependent step
of actually delivering the display element to the glass.  Which one of
those did you have in mind?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 13:21:02 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Carlos Pita <carlosjosepita <at> gmail.com>, rpluim <at> gmail.com,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 14:19:55 +0100
On Mon, Oct 14, 2019 at 11:33:02AM +0300, Eli Zaretskii wrote:
> > From: Carlos Pita <carlosjosepita <at> gmail.com>
> > Date: Sun, 13 Oct 2019 21:40:14 -0300
> > Cc: Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> > 
> > 1.b. Do the scaling upstream (for example, in get_fringe_bitmap_data
> > as proposed above). One problem with this approach is that some
> > backend could already be scaling output itself (for example, by using
> > a toolkit that automatically scales according to the device
> > resolution... do you know if this is the case for windows, for
> > macos?). Also, it won't fix the widgets issue (anyway, as I said,
> > neither the "downstream" approach will do it in 26.3).
> 
> Granted, I prefer the second approach.  We should do as little code
> duplication as possible.
> 
> I don't think individual backends do any scaling, but if some do, it
> should be easy to disable the scaling in our code for those backends.

macOS automatically scales, so the UI code generally doesn’t need to
know that it’s running on a hi‐DPI screen. The only exception is
images where ideally the program presents an image that matches the
physical DPI of the screen, but the rest of the UI code behaves as if
the screen is half the DPI.

I think it should be easy to make it do the right thing here.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 14:01:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Alan Third <alan <at> idiocy.org>
Cc: carlosjosepita <at> gmail.com, rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 17:00:22 +0300
> Date: Mon, 14 Oct 2019 14:19:55 +0100
> From: Alan Third <alan <at> idiocy.org>
> Cc: Carlos Pita <carlosjosepita <at> gmail.com>, rpluim <at> gmail.com,
> 	37689 <at> debbugs.gnu.org
> 
> macOS automatically scales, so the UI code generally doesn’t need to
> know that it’s running on a hi‐DPI screen.

Do the fringe bitmaps look good after scaling?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 14:38:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Alan Third <alan <at> idiocy.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 11:37:03 -0300
> Granted, I prefer the second approach.  We should do as little code duplication as possible.

But we might be duplicating what backends already do.

> I don't think individual backends do any scaling

My understanding is that nowadays everything is up-scaled by the
toolkit, except for fonts that use more sophisticated algorithms to
fit the larger grid of available pixels. So an application using a
modern toolkit should be mostly unaware of screen resolution. In fact,
I've reported some hidpi bugs here and there and, in general, they
were in places where the application did make some explicit geometry
computation based on actual resolution. Or see how "supporting hidpi"
translates in many cases to "port from gtk2 to gtk3". Or look at my
screenshots above, do they look too big? Well, that's because they're
taken from a hidpi screen; now, you might be in a lowdpi one and then
it's obvious that they will look twice as big there; but even if
you're in a hidpi screen I bet you probably will see them doubling the
real thing, because many apps are unaware or ignore the original image
resolution and just let the toolkit show it at 2x. There are plenty of
questions (for both Linux and MacOS) around the web asking "why my
screenshots look too big?", as a cursory google search will show,
although I think the problem was eventually addressed in MacOS,
perhaps in core apps or perhaps in general. That might be the reason
why Alan says that "The only exception is images".

> I think it should be easy to make it do the right thing here.

If you had one single backend this would clearly simplify matters. But
when you had to support three ones, it isn't that clear. Nevertheless,
I think any approach that relies on emacs doing the scaling must be
*carefully* evaluated, because it would mean solving a hard problem
that even toolkits have a hard time to address. Consider for example
having different frames in different monitors each one with its own
dpi and geometry. Are you sure that all geometry/layout computations
for a frame are done by emacs on-the-fly so as they adapt when the
frame is moved from a monitor to another one? Is emacs doing all
geometry calculations itself from the actual device geometry and
resolution or is it most of a hodgepodge, with some things taken care
by the backend and other ones by emacs itself? How clear-cut is the
separation between the stages you mentioned (geometry calculation by
emacs and actual "delivery to the glass" by the backend)? Is it that
clear-cut for *all* supported backends?

Now, that said, I don't think it's a bad idea for emacs to deal with
these matters regardless of its backends (assuming it can force all
backends to work at 1x), since it provides its own toolkit (and its
own OS ;) ). What I would like to know is how close emacs is currently
to one and to the other approach.

> > 2. I'm clueless regarding were widgets (I mean checkboxes and things like that) are rendered.

> I'm not sure I understand how this is related to the issue at hand. Can you elaborate?

By widgets I was referring to the checkboxes, arrows and stuff that
you can see, for example, in a customize-face buffer. When changing
the scaling parameters in x_cr_render_image in emacs 26.3, fringe
bitmaps were affected but those aforementioned widgets weren't. In
emacs 27 they indeed were affected by the same changes in code, but
they looked weirdly distorted and clipped, as you can see in my
previous screenshot. So, in brief, I couldn't locate the C code path
for the rendering of this stuff, specially in emacs 26.3. And by
rendering I was indistinctly referring to both stages you describe.

Best regards
--
Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 14:55:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: alan <at> idiocy.org, rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 17:54:28 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Mon, 14 Oct 2019 11:37:03 -0300
> Cc: Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> 
> > > 2. I'm clueless regarding were widgets (I mean checkboxes and things like that) are rendered.
> 
> > I'm not sure I understand how this is related to the issue at hand. Can you elaborate?
> 
> By widgets I was referring to the checkboxes, arrows and stuff that
> you can see, for example, in a customize-face buffer. When changing
> the scaling parameters in x_cr_render_image in emacs 26.3, fringe
> bitmaps were affected but those aforementioned widgets weren't. In
> emacs 27 they indeed were affected by the same changes in code, but
> they looked weirdly distorted and clipped, as you can see in my
> previous screenshot. So, in brief, I couldn't locate the C code path
> for the rendering of this stuff, specially in emacs 26.3. And by
> rendering I was indistinctly referring to both stages you describe.

Maybe I'm confused: I thought we were talking about fringe bitmaps.
But you seem to be talking about a more general issue.  I'm not sure
all of the graphic elements we show on our display should share the
same solution wrt hidpi; in particular, I think fonts don't need
anything to support that.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 15:08:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 12:06:45 -0300
> Maybe I'm confused: I thought we were talking about fringe bitmaps.
> But you seem to be talking about a more general issue.  I'm not sure

Yes, remember how all this started:

> make an inventory of all the things that should be fixed towards hidpi

Above I've been mostly talking about two things: i. fringe bitmaps and
ii. widgets (checkbox-like stuff). My main interest is in (i) since
I'm ok with text-only widgets but there is no replacement for fringe
bitmaps. Anyway, I would like to fix both things at the same time.
Moreover, there are other problems, which might be addressed by the
same changes or not, take for example tetris, which looks laughably
small in my screen.

So I could go and  change get_fringe_bitmap_data and hopefully fix the
fringe issue but:

i. This won't fix any other hidpi issues.
ii. This might introduce regressions in backends that I'm unable to
test (windows, macos) because they might be doing the scaling
themselves.

Therefore I believe a more nuanced understanding of how emacs is
approaching the matter, if there is any strategy at all, is in order.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 15:16:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: alan <at> idiocy.org, rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 18:15:09 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Mon, 14 Oct 2019 12:06:45 -0300
> Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> 
> Above I've been mostly talking about two things: i. fringe bitmaps and
> ii. widgets (checkbox-like stuff).

What you call "widgets" are images.  Fringes are also images, but
their format is fixed: they are always bitmaps.

> i. This won't fix any other hidpi issues.
> ii. This might introduce regressions in backends that I'm unable to
> test (windows, macos) because they might be doing the scaling
> themselves.
> 
> Therefore I believe a more nuanced understanding of how emacs is
> approaching the matter, if there is any strategy at all, is in order.

I think we covered all that, what is left is coding.  Right?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 15:34:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 12:32:58 -0300
> What you call "widgets" are images.  Fringes are also images, but
their format is fixed: they are always bitmaps.

> I think we covered all that, what is left is coding.  Right?

Well, I know they're images, I even known which images they are, I
just haven't spotted the place where they're actually dealt with in
the low level code and I was surprised that, being images, changes to
x_cr_render_image weren't having any effect on them (with the cairo
backend enabled, of course). To add to my confusion there are the
aforementioned differences between 26.3 and 27 in this regard. The
question of which code is dealing with these images (as opposed to
fringe bitmaps) was indeed left unanswered but, nevermind, I'll keep
looking for it myself. Any additional hint would be much appreciated,
though.

For the time being I will focus on fringe bitmaps and work under this
assumption (which I'm not sure is that mild as you seem to suggest):

> I don't think individual backends do any scaling, but if some do, it
> should be easy to disable the scaling in our code for those backends.

Later we can tackle "widgets" (which is the right name for them? They
are indeed defined in widget.el and wid-edit.el AFAICS).

Best regards
--
Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 16:53:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: alan <at> idiocy.org, rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 19:52:38 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Mon, 14 Oct 2019 12:32:58 -0300
> Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> 
> > What you call "widgets" are images.  Fringes are also images, but
> their format is fixed: they are always bitmaps.
> 
> > I think we covered all that, what is left is coding.  Right?
> 
> Well, I know they're images, I even known which images they are, I
> just haven't spotted the place where they're actually dealt with in
> the low level code

The image-handling code is in image.c.  The display engine in xdisp.c
uses that to perform layout calculations, and then the backends
actually display the images, e.g. look at x_draw_image_glyph_string
and its subroutines.  Fringe bitmaps use separate backend-dependent
code for the actual display, see x_draw_fringe_bitmap as one example.

> Later we can tackle "widgets" (which is the right name for them?

I suggest "images".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 20:01:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 16:59:58 -0300
Ok, while working on this I bumped into a new problem and I'm stuck again.

In order to scale things "upstream" I need the scaling factor, but the
functions that compute the scaling factor are static functions defined
"downstream" in each backend: x_get_scale_factor in w32term.c, in
xterm.c. Or, in other places, some code that is conditional to GTK
simply calls xg_get_scale.

Do you know of any backend-agnostic way to get the scaling factor for
a frame? I don't want to replicate complex backend dependant code in
fringe.c.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 23:44:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 20:42:59 -0300
I'm finding non-trivial difficulties that make me think this is not
the best approach.

I've already mentioned one above:

1. I need the scaling factor in fringe.c yet it's not part of the
redisplay_interface. Functions that compute scaling factor are backend
specific and static.

Also:

2. init_fringe_bitmap does non-trivial manipulations to the original
bit sequence (nibble swapping, shifting, casting) to produce a
platform/backend-specific representation. redisplay_interface is
ill-defined in this regard, bitmap representation is not part of the
interface. For some backends init_fringe_bitmap even compresses shorts
to chars if width < 8, so I can't reliably detect row limits in a
platform/backend-agnostic way, which I need in order to scale the
bitmap.

3. The unsigned short representation is unfortunate. For 3x we need at
least int64_t. Then we need to modify all that backend-dependent
nibble swapping, shifting and casting that gives me the creeps.
Finally backends would have to be adapted to take an int64_t array as
input.

Given those considerable difficulties, I propose to scale bitmaps in
two stages instead:

a. At the level of fringe.c we only modify the geometry (width,
height) of the image, so that calculations that are independent of the
bitmap itself are correctly done. This way we can keep the unsigned
short representation, we don't need to touch that complex
platform/backend-dependent bit and we don't need to query the scaling
factor, thus solving points 1, 2 and 3 above.

b. Then each backend should set a transformation matrix or something
like that so that the bitmap is scaled to the appropriate resolution.
I already know how to do that for Cairo, it's trivial.

Eli, what do you think?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Mon, 14 Oct 2019 23:50:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 20:49:14 -0300
> factor, thus solving points 1, 2 and 3 above.

Sorry, problem 1 is still unsolved by the proposed approach, not
without extending redisplay_interface.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Tue, 15 Oct 2019 01:51:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Mon, 14 Oct 2019 22:50:11 -0300
> > factor, thus solving points 1, 2 and 3 above.
>
> Sorry, problem 1 is still unsolved by the proposed approach, not
> without extending redisplay_interface.

Also, the scaling factor should probably be exposed to frame.c, since
it sets a default width of 8 that assumes a standard dpi monitor:

gui_set_left/right_fringe (struct frame *f, Lisp_Object new_value,
Lisp_Object old_value)
  ...
  new_width = (RANGED_FIXNUMP (-INT_MAX, new_value, INT_MAX)
       ? eabs (XFIXNUM (new_value)) : 8);

I've reached a point from where I'm unable to continue ahead on my
own, except for writing a private patch targeting my specific
resolution and backend. I would like to contribute but I see no way
without extending the interface and that's far beyond than what I can
decide.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Tue, 15 Oct 2019 09:28:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: alan <at> idiocy.org, rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Tue, 15 Oct 2019 12:27:38 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Mon, 14 Oct 2019 20:42:59 -0300
> Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> 
> I'm finding non-trivial difficulties that make me think this is not
> the best approach.
> 
> I've already mentioned one above:
> 
> 1. I need the scaling factor in fringe.c yet it's not part of the
> redisplay_interface. Functions that compute scaling factor are backend
> specific and static.

Adding them to frame redisplay interface would solve this.

> 2. init_fringe_bitmap does non-trivial manipulations to the original
> bit sequence (nibble swapping, shifting, casting) to produce a
> platform/backend-specific representation. redisplay_interface is
> ill-defined in this regard, bitmap representation is not part of the
> interface. For some backends init_fringe_bitmap even compresses shorts
> to chars if width < 8, so I can't reliably detect row limits in a
> platform/backend-agnostic way, which I need in order to scale the
> bitmap.

The code in init_fringe_bitmap obviously need some refactoring to rely
on redisplay interface.  You could make such refactoring part of the
job, or you could leave the current code intact and use its results.
I don't think I understand the difficulty of detecting row limits, but
you could begin by doing that for one platform, and then asking others
to do the same for other platforms.

> 3. The unsigned short representation is unfortunate. For 3x we need at
> least int64_t. Then we need to modify all that backend-dependent
> nibble swapping, shifting and casting that gives me the creeps.
> Finally backends would have to be adapted to take an int64_t array as
> input.

Couldn't we use the existing image-scaling code for that?  It is
implemented in each backend already.

> a. At the level of fringe.c we only modify the geometry (width,
> height) of the image, so that calculations that are independent of the
> bitmap itself are correctly done. This way we can keep the unsigned
> short representation, we don't need to touch that complex
> platform/backend-dependent bit and we don't need to query the scaling
> factor, thus solving points 1, 2 and 3 above.
> 
> b. Then each backend should set a transformation matrix or something
> like that so that the bitmap is scaled to the appropriate resolution.
> I already know how to do that for Cairo, it's trivial.
> 
> Eli, what do you think?

I don't think I understand what will stage (a) do under this proposal.
Stage (b) is already implemented, you just need to use it, and you
need to tell the transformation code the correct scale factor.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Tue, 15 Oct 2019 09:32:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: alan <at> idiocy.org, rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Tue, 15 Oct 2019 12:30:31 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Mon, 14 Oct 2019 22:50:11 -0300
> Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>, 37689 <at> debbugs.gnu.org
> 
> Also, the scaling factor should probably be exposed to frame.c, since
> it sets a default width of 8 that assumes a standard dpi monitor:
> 
> gui_set_left/right_fringe (struct frame *f, Lisp_Object new_value,
> Lisp_Object old_value)
>   ...
>   new_width = (RANGED_FIXNUMP (-INT_MAX, new_value, INT_MAX)
>        ? eabs (XFIXNUM (new_value)) : 8);
> 
> I've reached a point from where I'm unable to continue ahead on my
> own, except for writing a private patch targeting my specific
> resolution and backend. I would like to contribute but I see no way
> without extending the interface and that's far beyond than what I can
> decide.

Extending the frame redisplay interface is a no-brainer, please go
ahead.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Tue, 15 Oct 2019 23:02:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Tue, 15 Oct 2019 20:01:37 -0300
I decided to follow a more incremental strategy because I feel this is
getting unwieldy.

I split the issue in three parts for now:

1. Expose scale factor in the rif (patch in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37770)
2. Implement image scaling in Cairo and maybe X11 backends (this ticket)
3. Some code cleanups / refactors pertaining the initialization
sequence of backends (patch in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37755)

1 is a must-have for 2, 3 is a nice-to-have.

I'm writing a proper patch for 2 on top of my patch for 1 that I will
be attaching here soon.

Are you ok with this strategy? It's not the one-hack-to-rule-them-all
approach envisioned at the beginning but it simplify things a lot for
anyone wanting to make macos and win backends actually scale their
bitmaps, which shouldn't be difficult at all (or even necessary, I
still have doubts regarding macos). Plus it hopefully brings some code
improvements and a necessary API.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Wed, 16 Oct 2019 04:26:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Wed, 16 Oct 2019 01:25:31 -0300
[Message part 1 (text/plain, inline)]
Tags: patch

Here is a patch to be applied on top of
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37770.

I tried to postpone scaling calculations whenever possible so as to be
prepared for a multi-monitor/multi-dpi future. Of course, this is at
the expense of fetching scaling factors every time, but I believe it
is a reasonable price to pay.
[0001-Make-fringe-honour-scale-factor-in-Cairo-backend.patch (text/x-patch, attachment)]

Added tag(s) patch. Request was from Carlos Pita <carlosjosepita <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 16 Oct 2019 04:28:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Wed, 16 Oct 2019 09:18:02 GMT) Full text and rfc822 format available.

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

From: martin rudalics <rudalics <at> gmx.at>
To: Carlos Pita <carlosjosepita <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: Alan Third <alan <at> idiocy.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Wed, 16 Oct 2019 11:16:54 +0200
> +#define WINDOW_SCALE_FACTOR(W)							\

Please just call it WINDOW_FRAME_SCALE_FACTOR or FRAME_SCALE_FACTOR.
WINDOW_SCALE_FACTOR implies that it could be different for different
windows on the same frame.

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Wed, 16 Oct 2019 16:32:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Alan Third <alan <at> idiocy.org>,
 37689 <at> debbugs.gnu.org, Robert Pluim <rpluim <at> gmail.com>
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Wed, 16 Oct 2019 13:31:06 -0300
[Message part 1 (text/plain, inline)]
> Please just call it WINDOW_FRAME_SCALE_FACTOR or FRAME_SCALE_FACTOR.
> WINDOW_SCALE_FACTOR implies that it could be different for different
> windows on the same frame.

Good point, I've changed the name to WINDOW_FRAME_SCALE_FACTOR.

I've a bad feeling towards the conditional hidden behind that macro,
though. It's necessary because WINDOW_LEFT/RIGHT_FRINGE_WIDTH are
being called in contexts where the rif is still unavailable; so
knowing of no other sensible default, I just defaulted to 1. Now,
there is a bad smell in these requests for geometry parameters in
places where the exact geometry may still be unknown (although I
believe geometry is indeed known because, even if there isn't a rif,
cursory debugging shows that there already is a frame in all
problematic cases). So either these usages asume geometry is not
dependent on the current screen or, less problematically and more
probably, the rif is being initialized too late. A careful inspection
of every use place is a lot of work (I might be doing some of it next
weekend, though) so for now I'm just returning a sane default so that
we can safely move forward.
[0001-Make-fringe-honour-scale-factor-in-Cairo-backend.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Wed, 16 Oct 2019 16:41:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Alan Third <alan <at> idiocy.org>,
 37689 <at> debbugs.gnu.org, Robert Pluim <rpluim <at> gmail.com>
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Wed, 16 Oct 2019 13:40:25 -0300
[Message part 1 (text/plain, inline)]
Sorry, this is the right patch.
[0001-Make-fringe-honour-scale-factor-in-Cairo-backend.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Wed, 16 Oct 2019 19:02:02 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Alan Third <alan <at> idiocy.org>,
 37689 <at> debbugs.gnu.org, Robert Pluim <rpluim <at> gmail.com>
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Wed, 16 Oct 2019 16:01:30 -0300
[Message part 1 (text/plain, inline)]
Improved the commit message to hopefully match CONTRIBUTING rules.
[0001-Make-fringe-honour-scale-factor-in-Cairo-backend-Bug.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 17 Oct 2019 08:14:01 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>,
 Alan Third <alan <at> idiocy.org>, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 17 Oct 2019 10:13:12 +0200
>>>>> On Wed, 16 Oct 2019 16:01:30 -0300, Carlos Pita <carlosjosepita <at> gmail.com> said:

    Carlos> Improved the commit message to hopefully match
    Carlos> CONTRIBUTING rules.

Much better. Small comment below:

* sec/window.h (WINDOW_FRAME_SCALE_FACTOR): New helper macro to get
scale factor.
(WINDOW_LEFT_FRINGE_WIDTH,WINDOW_RIGHT_FRINGE_WIDTH): Use it.

(ie split the discussion of the new macro from the description of
where itʼs used).  And itʼs 'src/window.h', which tells me you
probably didnʼt use C-x 4 A or similar :-)

Robert




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Thu, 17 Oct 2019 11:49:01 GMT) Full text and rfc822 format available.

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

From: Alan Third <alan <at> idiocy.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: carlosjosepita <at> gmail.com, rpluim <at> gmail.com, 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 17 Oct 2019 12:48:23 +0100
On Mon, Oct 14, 2019 at 05:00:22PM +0300, Eli Zaretskii wrote:
> > Date: Mon, 14 Oct 2019 14:19:55 +0100
> > From: Alan Third <alan <at> idiocy.org>
> > Cc: Carlos Pita <carlosjosepita <at> gmail.com>, rpluim <at> gmail.com,
> > 	37689 <at> debbugs.gnu.org
> > 
> > macOS automatically scales, so the UI code generally doesn’t need to
> > know that it’s running on a hi‐DPI screen.
> 
> Do the fringe bitmaps look good after scaling?

They look absolutely fine to me.
-- 
Alan Third




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sun, 20 Oct 2019 16:33:04 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sun, 20 Oct 2019 19:03:10 +0300
>> > Perhaps we should convert those pixmaps to some scaleable format, and
>> > then autoscale them?
>>
>> You mean, SVG?  We could do that, but we'd like images to display well
>> even if Emacs cannot display SVG.
>>
>> Also, I think fringe bitmaps and other icons we use in the UI cannot
>> be scalable, we need to scale them ourselves.  Not that I'm an expert
>> on that (so don't take my words as definitive and/or final).
>
> At least for the fringe part, what do you think of modifying
> define-fringe-bitmap to take into account scaling factor?
>
> For example, if scaling factor > 1.5 make everything x2, if > 2.5 then
> x3, etc. It seems quite simple to achieve those integer scalings.

Funnily enough, the current fringe bitmaps are too big for me,
so I had to customize them using smaller bitmaps copied from somewhere.
I guess it should be possible to do the same to provide x2 scaled bitmaps:

  (define-fringe-bitmap 'light-down-arrow [32 32 32 32 32 32 168 112 32] nil nil 'bottom)
  (define-fringe-bitmap 'light-up-arrow [32 112 168 32 32 32 32 32 32] nil nil 'top)
  (define-fringe-bitmap 'light-top-left-angle [254 254 128 128 128] nil nil 'top)
  (define-fringe-bitmap 'light-bottom-left-angle [128 128 128 254 254] nil  nil 'bottom)
  (define-fringe-bitmap 'light-left-bracket [254 254 128 128 128 0 0 0 0 128 128 128 254 254] nil nil 'center)
  (define-fringe-bitmap 'light-right-curly-arrow [96 16 8 8 72 80 96 120] nil nil 'bottom)
  (define-fringe-bitmap 'light-left-curly-arrow [8 16 16 16 18 10 6 30] nil nil 'top)
  (define-fringe-bitmap 'light-right-arrow [16 8 252 8 16] nil 11 'center)
  (define-fringe-bitmap 'light-left-arrow [32 64 254 64 32] nil nil 'center)
  (setq-default fringe-indicator-alist
                '((truncation . (light-left-arrow light-right-arrow))
                  (continuation . (light-left-curly-arrow light-right-curly-arrow))
                  (overlay-arrow . right-triangle)
                  (up . light-up-arrow)
                  (down . light-down-arrow)
                  (top . (light-top-left-angle top-right-angle))
                  (bottom . (light-bottom-left-angle bottom-right-angle
                             top-right-angle light-top-left-angle))
                  (top-bottom . (light-left-bracket right-bracket
                                 top-right-angle light-top-left-angle))
                  (empty-line . empty-line)
                  (unknown . question-mark)))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sun, 20 Oct 2019 17:38:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sun, 20 Oct 2019 14:37:15 -0300
Hi Juri,

> I guess it should be possible to do the same to provide x2 scaled bitmaps:
>
>   (define-fringe-bitmap 'light-down-arrow [32 32 32 32 32 32 168 112 32] nil nil 'bottom)

This is indeed a cool workaround if you can override the builtin
bitmaps. But anyway it won't address the problem of having different
frames with different dpis nor the need to expose a "scale factor api"
to fix not only this but other hidpi-related issues.

> Funnily enough, the current fringe bitmaps are too big for me,

Too big as in "twice as big as expected" or in "too big for my taste"?

Best regards
--
Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sun, 20 Oct 2019 18:56:01 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sun, 20 Oct 2019 21:52:32 +0300
>> I guess it should be possible to do the same to provide x2 scaled bitmaps:
>>
>>   (define-fringe-bitmap 'light-down-arrow [32 32 32 32 32 32 168 112 32] nil nil 'bottom)
>
> This is indeed a cool workaround if you can override the builtin
> bitmaps.

Actually, this doesn't override the builtin bitmaps.
The name of the builtin bitmap is 'down-arrow',
but this defines a new bitmap 'light-down-arrow'.
You can use any name you want, e.g. 'down-arrow-2x'.

> But anyway it won't address the problem of having different
> frames with different dpis nor the need to expose a "scale factor api"
> to fix not only this but other hidpi-related issues.

Maybe the value of 'fringe-indicator-alist' should be frame-local?
Then depending on the exposed scale-factor, each frame could use
own set of bitmaps defined by frame-local 'fringe-indicator-alist'.

>> Funnily enough, the current fringe bitmaps are too big for me,
>
> Too big as in "twice as big as expected" or in "too big for my taste"?

I use a small 10px font, so the customized bitmaps fit the font size.
So maybe fridge bitmap size should depend on the font size, not scale?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sun, 20 Oct 2019 19:19:01 GMT) Full text and rfc822 format available.

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

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689 <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sun, 20 Oct 2019 16:17:56 -0300
[Message part 1 (text/plain, inline)]
>
>
> Maybe the value of 'fringe-indicator-alist' should be frame-local?
>

Frames can be moved from one display to another with a different dpi.


> >> Funnily enough, the current fringe bitmaps are too big for me,
> >
> > Too big as in "twice as big as expected" or in "too big for my taste"?
>
> I use a small 10px font, so the customized bitmaps fit the font size.
>


Ah ok, great, so that's not a scale factor issue.

So maybe fridge bitmap size should depend on the font size, not scale?
>

10px fonts are not 10px at other scale factor than 1x. In general you don't
have to change the size of your fonts when duplicating your screen
resolution, even if your fonts were given in px size, because the toolkit
scales them for you under the assumption of some standard ~96dpi base which
allows pixels to be treated as something more than a "number of tiny dots,
whatever their size is" measure.

What can be done is to adjust everything else in emacs to the effective
(not nominal) pixel size of the default face (then scale factor would be
the effective to nominal pixel size ratio of this font). I believe
something like that is done in some places, it's sensible given that emacs
is mostly a grid of characters. But anyway this is clearly not the approach
taken for the fringe and some parts of emacs have geometry not so tightly
coupled to font size, although I would indeed expect high correlation. And
some toolkits (for example, gtk) offer a separate scale factor for font
size, which is then applied on top of the general scale factor and seen
mostly as an accessibility feature.

>
[Message part 2 (text/html, inline)]

Reply sent to Carlos Pita <carlosjosepita <at> gmail.com>:
You have taken responsibility. (Thu, 24 Oct 2019 17:11:02 GMT) Full text and rfc822 format available.

Notification sent to Carlos Pita <carlosjosepita <at> gmail.com>:
bug acknowledged by developer. (Thu, 24 Oct 2019 17:11:02 GMT) Full text and rfc822 format available.

Message #159 received at 37689-close <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>,
 37689-close <at> debbugs.gnu.org
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Thu, 24 Oct 2019 14:09:44 -0300
I'm closing this issue in order to prevent wasting your time in
useless reviews, because I'm working in a rather different solution as
described in my last comment to #37770. Hopefully I will be posting a
new patch as soon as I get that working, but it has shown to be a
difficult task to undertake... Nevertheless I'm learning a lot about
the internals.

Best regards
--
Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#37689; Package emacs. (Sat, 26 Oct 2019 10:46:02 GMT) Full text and rfc822 format available.

Message #162 received at 37689-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Carlos Pita <carlosjosepita <at> gmail.com>
Cc: rpluim <at> gmail.com, 37689-done <at> debbugs.gnu.org, juri <at> linkov.net
Subject: Re: bug#37689: Fringe pixmaps, widgets, etc. look ridiculously tiny
 in hidpi screen
Date: Sat, 26 Oct 2019 13:45:09 +0300
> From: Carlos Pita <carlosjosepita <at> gmail.com>
> Date: Thu, 24 Oct 2019 14:09:44 -0300
> Cc: Eli Zaretskii <eliz <at> gnu.org>, Robert Pluim <rpluim <at> gmail.com>, 37689-close <at> debbugs.gnu.org
> 
> I'm closing this issue in order to prevent wasting your time in
> useless reviews, because I'm working in a rather different solution as
> described in my last comment to #37770.

Thanks, but what about bug#37755?  Should we still discuss the changes
there?  Are they independent of what you are working on in bug#37770?




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 23 Nov 2019 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 149 days ago.

Previous Next


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