* Emacs --with-pgtk and use-package
@ 2022-03-24 11:52 Pankaj Jangid
2022-03-24 12:15 ` Po Lu
0 siblings, 1 reply; 8+ messages in thread
From: Pankaj Jangid @ 2022-03-24 11:52 UTC (permalink / raw)
To: help-gnu-emacs
Two events happened in my life: I started to use use-package to manage
pages and then a few days later I purchased a HiDPI monitor.
‘use-package’ made my ‘.emacs.d/init.el’ a lot cleaner and moreover it
can be customised to handle native dependency installation also. That
makes the init file really portable across all my GNU boxes.
Then I purchased a HiDPI monitor and everything looked so tiny in it. I
tried scale using ‘xrandr’ (i3 and hence X11). This made everything
blurry. I tried to use ‘sway’ (on wayland) and used scaling provided by
‘sway’. All gtk based applications looked good. Emacs was still
blurry. So I tried to build ‘--with-pgtk’. Now that scalling is working
fine in Emacs as well. But ‘use-package’ has stopped working.
I have two questions:
1. Is anyone else using Emacs --with-pgtk along with ‘use-package’? Are
you facing the same issue. The ‘use-package’ code is not executed. Even
when I do ‘C-x e’ locally around the ‘use-package’ call.
2. Is there any other solution to scaling problem without using pgtk?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs --with-pgtk and use-package
2022-03-24 11:52 Emacs --with-pgtk and use-package Pankaj Jangid
@ 2022-03-24 12:15 ` Po Lu
2022-03-24 13:12 ` Pankaj Jangid
0 siblings, 1 reply; 8+ messages in thread
From: Po Lu @ 2022-03-24 12:15 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: help-gnu-emacs
Pankaj Jangid <pankaj@codeisgreat.org> writes:
> Then I purchased a HiDPI monitor and everything looked so tiny in it. I
> tried scale using ‘xrandr’ (i3 and hence X11). This made everything
> blurry.
Scaling with xrandr is very undesirable on a HiDPI monitor, since it
just upscales the screen contents. I have no idea why people try it at
all these days. Most likely what you actually want is to tell programs
the DPI of the display, by setting the Xft.dpi X resource.
> I tried to use ‘sway’ (on wayland) and used scaling provided by
> ‘sway’. All gtk based applications looked good. Emacs was still
> blurry. So I tried to build ‘--with-pgtk’. Now that scalling is working
> fine in Emacs as well. But ‘use-package’ has stopped working.
That's a bug. Please try to determine why it stopped working.
> 2. Is there any other solution to scaling problem without using pgtk?
Yes, but it depends on what you did wrong earlier.
Thanks..
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs --with-pgtk and use-package
2022-03-24 12:15 ` Po Lu
@ 2022-03-24 13:12 ` Pankaj Jangid
2022-03-24 13:32 ` Po Lu
0 siblings, 1 reply; 8+ messages in thread
From: Pankaj Jangid @ 2022-03-24 13:12 UTC (permalink / raw)
To: help-gnu-emacs
Po Lu <luangruo@yahoo.com> writes:
> Scaling with xrandr is very undesirable on a HiDPI monitor, since it
> just upscales the screen contents. I have no idea why people try it at
> all these days. Most likely what you actually want is to tell programs
> the DPI of the display, by setting the Xft.dpi X resource.
Actually, I used xrandr to downscale. used Xft.dpi to tell clients to
about the DPIs. Normally it works in multiple of 96. So I specified 192
and then downscaled using xrandr --scale 1.25x1.25. This is to achieve
fractional scaling.
>> I tried to use ‘sway’ (on wayland) and used scaling provided by
>> ‘sway’. All gtk based applications looked good. Emacs was still
>> blurry. So I tried to build ‘--with-pgtk’. Now that scalling is working
>> fine in Emacs as well. But ‘use-package’ has stopped working.
>
> That's a bug. Please try to determine why it stopped working.
>
Will do.
>> 2. Is there any other solution to scaling problem without using pgtk?
>
> Yes, but it depends on what you did wrong earlier.
When I used ‘sway’, I found it lighter. May be just a feeling of
something new. But I want to give it a try for some time.
Resetting everything else to default settings and just specifying
output DP-2 scale 2
in the ‘sway’ config file. It works fine except that now everything is
too big. Other GTK apps scale well. But Emacs without pgtk is
pixelated. How to achieve smooth rendering of buffers and the menubar
items without building --with-pgtk?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs --with-pgtk and use-package
2022-03-24 13:12 ` Pankaj Jangid
@ 2022-03-24 13:32 ` Po Lu
2022-03-24 14:30 ` Pankaj Jangid
0 siblings, 1 reply; 8+ messages in thread
From: Po Lu @ 2022-03-24 13:32 UTC (permalink / raw)
To: Pankaj Jangid; +Cc: help-gnu-emacs
Pankaj Jangid <pankaj@codeisgreat.org> writes:
> Actually, I used xrandr to downscale. used Xft.dpi to tell clients to
> about the DPIs. Normally it works in multiple of 96. So I specified 192
> and then downscaled using xrandr --scale 1.25x1.25. This is to achieve
> fractional scaling.
Ah. I don't think there's any window system that really gets fractional
scaling right. AFAIR GNOME Shell is the only Wayland compositor that
even supports fractional scaling at all, but that information could be
several years out of data.
> Resetting everything else to default settings and just specifying
>
> output DP-2 scale 2
>
> in the ‘sway’ config file. It works fine except that now everything is
> too big. Other GTK apps scale well.
That isn't the fractional scale you want, so it explains why everything
is too big.
I don't think there's a way to get fractional scaling working on
GNU/Linux without some blurriness, but your best bet is probably GNOME
on Wayland with a PGTK build.
> But Emacs without pgtk is pixelated. How to achieve smooth rendering
> of buffers and the menubar items without building --with-pgtk?
That's impossible on Wayland, where a build without PGTK will run inside
Xwayland, which doesn't support scaling at all, so the resulting windows
are upscaled by the Wayland compositor.
Besides, PGTK is not supposed to break use-package at all.
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs --with-pgtk and use-package
2022-03-24 13:32 ` Po Lu
@ 2022-03-24 14:30 ` Pankaj Jangid
2022-03-24 16:19 ` Pankaj Jangid
0 siblings, 1 reply; 8+ messages in thread
From: Pankaj Jangid @ 2022-03-24 14:30 UTC (permalink / raw)
To: help-gnu-emacs
Po Lu <luangruo@yahoo.com> writes:
>> But Emacs without pgtk is pixelated. How to achieve smooth rendering
>> of buffers and the menubar items without building --with-pgtk?
>
> That's impossible on Wayland, where a build without PGTK will run inside
> Xwayland, which doesn't support scaling at all, so the resulting windows
> are upscaled by the Wayland compositor.
>
> Besides, PGTK is not supposed to break use-package at all.
>
Thanks for all the info. I’ll use PGTK build then and try to investigate
and file a bug for use-package.
Regards.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs --with-pgtk and use-package
2022-03-24 14:30 ` Pankaj Jangid
@ 2022-03-24 16:19 ` Pankaj Jangid
2022-03-25 0:55 ` Po Lu
0 siblings, 1 reply; 8+ messages in thread
From: Pankaj Jangid @ 2022-03-24 16:19 UTC (permalink / raw)
To: help-gnu-emacs
Pankaj Jangid <pankaj@codeisgreat.org> writes:
> Thanks for all the info. I’ll use PGTK build then and try to investigate
> and file a bug for use-package.
Extremely sorry for the noise. Following condition check was causing the
issue:
(use-package emacs
:when (memq window-system '(mac ns x))
:config
(load-theme 'modus-vivendi)
:bind ("<f5>" . modus-themes-toggle))
I did not use ‘pgtk’ in the above ":when" clause.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs --with-pgtk and use-package
2022-03-24 16:19 ` Pankaj Jangid
@ 2022-03-25 0:55 ` Po Lu
2022-03-25 8:52 ` Pankaj Jangid
0 siblings, 1 reply; 8+ messages in thread
From: Po Lu @ 2022-03-25 0:55 UTC (permalink / raw)
To: help-gnu-emacs
Pankaj Jangid <pankaj@codeisgreat.org> writes:
> Extremely sorry for the noise. Following condition check was causing the
> issue:
>
> (use-package emacs
> :when (memq window-system '(mac ns x))
> :config
> (load-theme 'modus-vivendi)
> :bind ("<f5>" . modus-themes-toggle))
>
> I did not use ‘pgtk’ in the above ":when" clause.
Thanks, people should probably be taught to use `display-graphic-p'
instead of manually testing the value of `window-system'.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Emacs --with-pgtk and use-package
2022-03-25 0:55 ` Po Lu
@ 2022-03-25 8:52 ` Pankaj Jangid
0 siblings, 0 replies; 8+ messages in thread
From: Pankaj Jangid @ 2022-03-25 8:52 UTC (permalink / raw)
To: help-gnu-emacs
Po Lu <luangruo@yahoo.com> writes:
>> (use-package emacs
>> :when (memq window-system '(mac ns x))
>> :config
>> (load-theme 'modus-vivendi)
>> :bind ("<f5>" . modus-themes-toggle))
>>
>> I did not use ‘pgtk’ in the above ":when" clause.
>
> Thanks, people should probably be taught to use `display-graphic-p'
> instead of manually testing the value of `window-system'.
Thanks. I’ve updated my config and will keep that in mind.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-03-25 8:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-24 11:52 Emacs --with-pgtk and use-package Pankaj Jangid
2022-03-24 12:15 ` Po Lu
2022-03-24 13:12 ` Pankaj Jangid
2022-03-24 13:32 ` Po Lu
2022-03-24 14:30 ` Pankaj Jangid
2022-03-24 16:19 ` Pankaj Jangid
2022-03-25 0:55 ` Po Lu
2022-03-25 8:52 ` Pankaj Jangid
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).