In this fork, I'm working to make Emacs support pure-gtk3, in order to support Wayland.
You need cairo.
git clone https://github.com/masm11/emacs.git
cd emacs
./autogen.sh
./configure --with-pgtk --with-cairo --with-modules
make
Ignore warnings.
This repository contains PKGBUILD, so you can install by:
mkdir /tmp/emacs
cd /tmp/emacs
wget https://raw.githubusercontent.com/masm11/emacs/pgtk/PKGBUILD
makepkg -s
sudo pacman -U emacs-pgtk*.tar.xz
./src/emacs
If you want to know whether it is really running on wayland native, then run as follows:
GDK_BACKEND=wayland ./src/emacs
Of course, PGTK supports X11 and Wayland connections.
You can use GDK_BACKEND
environment variable and --display
option,
and you can do (make-frame-on-display display-name)
with display-name of
different backend from the first frame.
You can know which backend is used for a frame:
(pgtk-backend-display-class)
This returns "GdkWaylandDisplay"
for Wayland, or "GdkX11Display"
for X11.
Note: Segmentation fault may occur on multiple display environment.
I reimplemented child frames to resolve these issues: #46, #48, and #49.
In this new version, child frames don't extend beyond the parent frame.
X has the resource database, and you could store initial default values into it.
Gtk/Gdk can't handle it even if on X11, so I implemented similar feature using gsettings.
Saving:
(pgtk-set-resource "background" "gray")
Getting:
(x-get-resource "background" "Background")
If your emacs got failing to start, then edit your settings with dconf-editor
.
Your settings are saved under /org/gnu/emacs/defaults-by-name/<instance-name>/
and
/org/gnu/emacs/defaults-by-class/
. All are of string type.
Correct your mistakes.
Known problems:
Not implemented:
I may not develop them because I don't use them.
Edit src/pgtkterm.h to uncomment:
#define PGTK_DEBUG 1
It enables so much debugging outputs.
On gdb, you may want to do:
(gdb) handle SIGPIPE nostop noprint
You should be able to use input methods since GtkIMContext
is enabled
by default.
If you don't like GtkIMContext
, you can disable it by writing as follows
in ~/.emacs
:
(setq pgtk-use-im-context-on-new-connection nil)
We (@masm11 and @fejfighter) are going to push @fejfighter's fork to the fsf's repository, instead of my fork. @fejfighter's one is rebaseable and have English commit messages. See #23.
masm11.