Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pgtk to the snapshot build #45

Closed
wants to merge 1 commit into from

Conversation

efouladi
Copy link

No description provided.

@alexmurray
Copy link
Owner

Thanks for the PR but as far as I know pgtk is still not recommended when running under X - and since the emacs snap is designed to run under both X and Wayland then I don't think it is appropriate to enable this for all users.

Instead if there is some particular benefit to using pgtk on Wayland, then perhaps we could look at building emacs both with and without pgtk enabled (and having each then compiled into a separate binary), ship both these binaries inside the snap and choose which one to actually run at runtime by detecting if the session is using Wayland.

@alexmurray alexmurray closed this Sep 26, 2022
@efouladi
Copy link
Author

Thanks, I wasn't aware of the issues with pgtk under X.

@kollienne
Copy link

Instead if there is some particular benefit to using pgtk on Wayland, then perhaps we could look at building emacs both with and without pgtk enabled (and having each then compiled into a separate binary), ship both these binaries inside the snap and choose which one to actually run at runtime by detecting if the session is using Wayland.

pgtk is (currently) required for fractional scaling to work in Wayland, that might justify the effort?

@alexmurray
Copy link
Owner

Unfortunately I don't have the time to look at this at the moment - but I would be more than happy to include something like this if anyone wants to submit a PR. Thanks.

@grolongo
Copy link

Hey @alexmurray, thanks a lot for providing the Emacs snaps and also maildir-utils, those are super convenient to use.

If I can add an extra point, having pgtk enabled by default would also be a big benefit for people like me who have to use Windows at work and rely on WSL2 with WSLg.

Your snaps work fine without pgtk, but when I build Emacs 29 myself with the --with-pgtk flag, the fonts rendering is better, startup is faster by ~10ms, window resize works as expected (without pgtk you can't resize the window if you try to drag it from bottom right corner of the window) and it overall feels more native/responsive.

I've noticed quiet a few Emacs devs using WSL and compiling Emacs with pgtk from various blogs, so I thought it would be great to see it already included in some snap version of Emacs directly.

@alexmurray
Copy link
Owner

alexmurray commented Nov 28, 2022

So we either need to look at shipping a single emacs snap build that has binaries compiled with and without pgtk and then dynamically selecting which one to use on load - OR we have a separate branch in the repo which enables pgtk and then build this via a separate snap recipe in Launchpad which finally publishes to a separate track in the Snap Store - then when installing the snap users can either install the regular one snap install emacs --channel latest/stable or they can choose pgtk as: snap install emacs --channel pgtk/stable - I'll ask about creating a separate track over in forum.snapcraft.io

EDITED to add: forum request is at https://forum.snapcraft.io/t/track-request-for-emacs-snap/32886

@grolongo
Copy link

The second option sounds the best to me. It avoids having two binaries at the same time and also you won't have to implement some code to figure out which precise environment the snap is running in.
It also gives the end user more flexibility to choose which one to run if for some reason someone wants to explicitly use Emacs with pgtk in X or without pgtk in Wayland since that won't be hard coded.
Not sure how you should name the channel, maybe latest/edge/pgtk since it's only in 29 and not officially stable yet.
Just read the forum request and sounds good to me, pgtk as a separate branch for now then merge it later if/when bugs get ironed out.

ps: do we need to do something on the forum to vote for your request?

@alexmurray
Copy link
Owner

Ok the track is now created and I have a simple build that enables pgtk and pushes to the new track - however it dies on startup since the version of gsettings-desktop-schemas in Ubuntu 20.04 (as the snap is core20 based) is too old - so I am now trying to port the emacs snap to core22 (however this is another huge can of worms to deal with as per https://snapcraft.io/blog/the-new-classic-confinement-in-snaps-even-the-classics-need-a-change). So at this stage having a working pgtk build of the emacs snap is looking quite challenging.

@grolongo
Copy link

grolongo commented Dec 2, 2022

Hey Alex, I can confirm I have the same error on startup using Ubuntu 22.10 (GNOME/Wayland):

(emacs:3613): GLib-GIO-ERROR **: 09:46:42.394: Settings schema 'org.gnome.settings-daemon.plugins.xsettings' does not contain a key named 'antialiasing'

Good news though, I also tried your build on WSL with WSLg and I don't have a single problem so far.

@alexmurray
Copy link
Owner

It may depend on what host environment you are using - but I am glad it works at least in some cases. I'll keep working towards a proper solution and will update this issue when I get something going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants