From 89be6630256ea8798d6e6d57f31980772416a242 Mon Sep 17 00:00:00 2001 From: Max Harmathy Date: Thu, 14 May 2020 12:19:40 +0200 Subject: [PATCH] Add patch for using WAYLAND_DISPLAY --- PKGBUILD | 9 ++++-- Use-WAYLAND_DISPLAY.patch | 64 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 Use-WAYLAND_DISPLAY.patch diff --git a/PKGBUILD b/PKGBUILD index 2525067..e456945 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ pkgbase=ibus pkgname=(ibus libibus) pkgver=1.5.22 -pkgrel=1 +pkgrel=2 pkgdesc="Next Generation Input Bus for Linux" arch=('x86_64') url="https://github.com/ibus/ibus/wiki" @@ -13,12 +13,15 @@ depends=('dconf' 'gtk2' 'gtk3' 'hicolor-icon-theme' 'libnotify' 'python-dbus' 'p makedepends=('gobject-introspection' 'vala' 'intltool' 'gnome-common' 'gtk-doc' 'qt5-base' 'cldr-emoji-annotation' 'unicode-character-database' 'unicode-emoji') options=('!emptydirs') -source=("$pkgbase-$pkgver.tar.gz::https://github.com/ibus/ibus/archive/$pkgver.tar.gz") -sha512sums=('972da51eb5702692f13b4f4cff51b3765890e5a91f936b9fa6b6cafaf00f4d078dc39f14bd00f3883203d295d826647c509024dd197d726d4def8d13d45d71b4') +source=("$pkgbase-$pkgver.tar.gz::https://github.com/ibus/ibus/archive/$pkgver.tar.gz" + "Use-WAYLAND_DISPLAY.patch") +sha512sums=('972da51eb5702692f13b4f4cff51b3765890e5a91f936b9fa6b6cafaf00f4d078dc39f14bd00f3883203d295d826647c509024dd197d726d4def8d13d45d71b4' + '0698e19a21e46232217a6b44638a606a87f54162cc6d6834d90da4e01f72f6959a851130a7191f0331a10fa830ef7b7995474828b5312efef7652fe5e42a43d8') prepare() { cd ibus-$pkgver sed -i 's|$(libibus) $(libibus_emoji_dialog)|$(libibus_emoji_dialog) $(libibus)|' ui/gtk3/Makefile.am + patch -p1 < "$startdir/Use-WAYLAND_DISPLAY.patch" } build() { diff --git a/Use-WAYLAND_DISPLAY.patch b/Use-WAYLAND_DISPLAY.patch new file mode 100644 index 0000000..f039378 --- /dev/null +++ b/Use-WAYLAND_DISPLAY.patch @@ -0,0 +1,64 @@ +From 0c77da82ea59bdeb0c50683ba6f7f2b92b15901c Mon Sep 17 00:00:00 2001 +From: Carlos Garnacho +Date: Wed, 11 Mar 2020 17:08:37 +0100 +Subject: [PATCH] src: Use WAYLAND_DISPLAY on Wayland sessions to make up IBus + socket name + +In Wayland sessions, GNOME Shell 3.36 is leveraging 2 X11 Display +connections so one is used to set up all services for a "X11 session" +before user applications connected to the other display might require it. +This allows seamlessly starting Xwayland on demand to X11 user applications. + +IBus here belongs to the first described connection, it is started +explicitly on that display by GNOME Shell as it is necessary to set up +ibus-x11 before any other X11 client might want to use it. + +However the use of this "secondary" display results in IBus daemon left +unable to talk to applications, as the socket name is dependent on the +DISPLAY envvar and ibus/applications don't agree on its content. + +For wayland sessions, make it look for WAYLAND_DISPLAY, as that'll have +the similar "per session bus" behavior that this seems to look after. + +Related: https://gitlab.gnome.org/GNOME/gnome-shell/issues/2341 +--- + src/ibusshare.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/src/ibusshare.c b/src/ibusshare.c +index 0d50d3f5..e0ef2ce0 100644 +--- a/src/ibusshare.c ++++ b/src/ibusshare.c +@@ -100,6 +100,7 @@ ibus_get_socket_path (void) + gchar *display; + gchar *displaynumber = "0"; + /* gchar *screennumber = "0"; */ ++ gboolean is_wayland = FALSE; + gchar *p; + + path = g_strdup (g_getenv ("IBUS_ADDRESS_FILE")); +@@ -108,13 +109,19 @@ ibus_get_socket_path (void) + } + + if (_display == NULL) { +- display = g_strdup (g_getenv ("DISPLAY")); ++ display = g_strdup (g_getenv ("WAYLAND_DISPLAY")); ++ if (display) ++ is_wayland = TRUE; ++ else ++ display = g_strdup (g_getenv ("DISPLAY")); + } + else { + display = g_strdup (_display); + } + +- if (display) { ++ if (is_wayland) { ++ displaynumber = display; ++ } else if (display) { + p = display; + hostname = display; + for (; *p != ':' && *p != '\0'; p++); +-- +2.26.2 + -- 2.26.2