this post was submitted on 14 Nov 2023
3 points (100.0% liked)

Emacs

313 readers
2 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

I have rebuilt Emacs 29 with PGTK in order to get Emacs running natively and to fix the fonts, and i already have another emacs 29 build (Lucid) installed with i use On X.
I was surprised to see Emacs on wayland was running slower than its counterpart on Xwayland. Also the fonts issue was not fixed.
While zooming in makes the fonts look better. On X i don't have this issue.
Below is screenshots of fonts on Wayland - Xwayland and X

On wayland (PGTK)

Xwayland (Lucid)

Xorg (Lucid)

top 19 comments
sorted by: hot top controversial new old
[–] Expensive_Pain@alien.top 2 points 1 year ago

All the screenshots look blurry to me.

Btw, if you are upscaling XWayland windows, have you tried disabling that and then using a higher font size in Emacs?

[–] rileyrgham@alien.top 2 points 1 year ago (3 children)

Recently I was reading #emacs and saw that some claim pgtk, or native wayland, is bodged and not feature complete. Is that right? If so, which is the best toolkit to compile from source with to run under XWayland?

[–] Thaodan@alien.top 1 points 1 year ago

It's feature complete but limited because Wayland is limited.

For example there's no way for Emacs to know which frames are currently visible.

[–] 7890yuiop@alien.top 1 points 1 year ago (1 children)

The author of the emacs pgtk code says that no one who has X installed should use pgtk -- he's stated on several occasions that if you have X at all then you should use a supported X toolkit in Emacs for best results.

I've seen counter-arguments that pgtk is still beneficial if you happen to have a "high DPI display", but I believe that's the only argument I've ever seen for using pgtk under X.

I always build --with-x-toolkit=lucid myself, and can happily vouch for that one. I don't use Wayland, though.

[–] Thaodan@alien.top 1 points 1 year ago

The issue is that the pure GTK port doesn't have those functions that are based on Xlib such as frame properties that come from X11. Some feature specific to X11 that can be implemented purely with GTK are not implemented such as outer window id's (I have a patch for that). So in theory the pure GTK windowing system could replace the GTK with X11 calls if it optionally allows the call of functions that depend on X11 if requested.

Pure GTK also allows the use of GTK input methods besides the better high dpi scaling.

load more comments (1 replies)
[–] cradlemann@alien.top 1 points 1 year ago (1 children)
[–] Ybenel@alien.top 1 points 1 year ago (1 children)

What's your font config? Using any anti aliasing or hinting?

[–] StrangeAstronomer@alien.top 1 points 1 year ago (2 children)

I like the vertical bars outlining the function structures - how is that done?

[–] Ybenel@alien.top 1 points 1 year ago

I'm using highlight-indent-guides

(use-package! highlight-indent-guides
  :init
  (add-hook 'prog-mode-hook 'highlight-indent-guides-mode)
  (setq highlight-indent-guides-method 'character
        highlight-indent-guides-delay 0
        highlight-indent-guides-responsive 'stack
        highlight-indent-guides-auto-enabled nil))
[–] JohnDoe365@alien.top 1 points 1 year ago

I recommend using https://github.com/jdtsmith/indent-bars it's a good deal faster than any of the other indent-bar solutions. AFAIK Emacs 29 is required and some caveats do apply.

[–] noi-gai@alien.top 1 points 1 year ago (1 children)

Having had a hidpi monitor for ages, PGTK has been so great and so incredibly better at rendering fonts, menus, bars, etc, tan any X toolkit, and managing scaling correctly, that I switched while still was an alpha version in someone's github. The worst problem is that pixmaps are shown 1:1, pixel by pixel (being impossible to distinguish on a high dpi display), while the text is properly scaled, it's unusable.

Never looked back. Well, no, I've tried the X version a few times and it sucked, as I remembered.

[–] JohnDoe365@alien.top 1 points 1 year ago

As there seems to be quite a lot of hate for Wayland and PGTK I too can confess that all reasons of u/noi-gai are also my experiences for using Emacs on Linux. If there wouldn't be Wayland scaling support with PGTK I wont use Emacs GUI any longer, as everyting would be blurry.

Now I do not know what I miss by not using X as I do not wander back and forth but stick to Wayland since years. Oh I do miss proper GTK integration, but this is only ever going to happen with multithreading-support.

[–] phr46@alien.top 1 points 1 year ago (1 children)

I have a NVIDIA graphics card (GTX 1080), and a 4K monitor which I'd like to use with 150% fractional scaling. My experience is:
- GNOME worked, but the fractional scaling made the fonts blurry. 100% or 200% looks sharp, but 150% is bad.
- KDE, and various tiling wm compositors I tried, looked ok but had issues with flickering. I'd type something, and the cursor would often "move backwards" and look like I've deleted a bunch of characters, and then jump back forward.
- Hyprland was the only one where Emacs worked perfectly. But then I got flickering in games.
So I'm just sticking to X, probably until I get another PC.

BTW, WSL uses Wayland as well, and I couldn't run Emacs on that either. Input lag when I maximize the window, as in this, but the workarounds there didn't solve it. I ended running it in XWayland in WSL and that worked fine.

[–] paretoOptimalDev@alien.top 1 points 1 year ago

Hyprland works perfectly on my laptop, but on my PC the mouse cursor doesn't show up :/

[–] Ybenel@alien.top 1 points 1 year ago

While you might not notice the difference between the screenshots. If you download the full resolution images (X and Wayland or Xwayland) You'll see the difference.
its like its cut and not drawn properly. This issue is only on Emacs.

[–] noooit@alien.top 1 points 1 year ago

Same. Clipboard sharing with other apps won't work either. I think it's better to build emacs without pgtk. There are no benefits.

[–] Expensive_Pain@alien.top 1 points 1 year ago (1 children)

If you're not on a high DPI display, then all I can think is that some font hinting/autoaliasing settings must be out of wack.

[–] Ybenel@alien.top 1 points 1 year ago

i think i am, like you said its probably a font hinting/autoaliasing issue.
Do you know of any solutions i could try?