1
0
forked from ports/opt

qt5: https://codereview.qt-project.org/c/qt/qtbase/+/299182 IBus: Use WAYLAND_DISPLAY on Wayland sessions to make up socket names

This commit is contained in:
Danny Rawlins 2020-05-24 23:45:31 +10:00
parent 928916a487
commit 7b9257ce5f
3 changed files with 83 additions and 3 deletions

View File

@ -1,6 +1,7 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/YHniSBzM38EM2TXXhR1uCsw21iCELOMN09/RZ1vBuMWra1dU0AR1PXwnTvCCe0gDcWt2F3TcNi4FfrGF1nxOwU=
SHA256 (Pkgfile) = a0b97bab515e8ffb451985fc1c4d46a3e6fe338caf201f2dee0747718ab8958a
RWSE3ohX2g5d/WV0ZwJTXSeYycMYVFBGFGD5jIcyH8dUJag+KSJmaIf8Mz/hcH8XuXGNw3VWCARJL4ekyBopwiut7V+KS63DAQY=
SHA256 (Pkgfile) = b44c091a27f6e74eaaf20e1568635f0987bf4bb84578c74d41c699916f68c797
SHA256 (.footprint) = 096374fcbe6517602c41115147d73f1d171327e94eb708881a55eb31b3fd025a
SHA256 (qt-everywhere-src-5.14.2.tar.xz) = c6fcd53c744df89e7d3223c02838a33309bd1c291fcb6f9341505fe99f7f19fa
SHA256 (qt5-logo.png) = ae1335ecd1cd2d17032184895ab298a636cdfa8121b0ed71307c4f2b23ec928e
SHA256 (qt5-base-QTBUG-82910.patch) = abb94453c9fe54fde4811bc5475b88796c8db1f5cd75ddc68918aff20139b1aa

View File

@ -8,11 +8,15 @@ name=qt5
version=5.14.2
release=1
source=(https://download.qt.io/official_releases/qt/${version::4}/$version/single/qt-everywhere-src-$version.tar.xz
qt5-logo.png)
qt5-logo.png
qt5-base-QTBUG-82910.patch)
build() {
cd qt-everywhere-src-$version
# https://codereview.qt-project.org/c/qt/qtbase/+/299182
patch -d qtbase -p1 -i $SRC/qt5-base-QTBUG-82910.patch
export PYTHON='/usr/bin/python3'
mkdir $SRC/bin
ln -s /usr/bin/python3 $SRC/bin/python

View File

@ -0,0 +1,75 @@
From 54aa63be9b74e8de72db9efbe6809ab1a97b29a7 Mon Sep 17 00:00:00 2001
From: Takao Fujiwara <takao.fujiwara1@gmail.com>
Date: Mon, 11 May 2020 21:14:01 +0900
Subject: [PATCH] IBus: Use WAYLAND_DISPLAY on Wayland sessions to make up
socket names
A recent change in IBus made it prefer the WAYLAND_DISPLAY envvar in
order to compose its socket path for Wayland sessions. This is because
DISPLAY is unreliable in those environment: It might not be there, there
might be several displays pointing to the same Xwayland server (as it's
the case in GNOME 3.36), or there might even be multiple Xwayland servers
(eg. to enforce inter-app isolation with X11 apps).
Fixes: QTBUG-82910
Pick-To: 5.15
Change-Id: I4883b5d06863ba284883dd95281bed2ce7203e29
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
---
.../ibus/qibusplatforminputcontext.cpp | 38 +++++++++++++++-------
1 file changed, 27 insertions(+), 11 deletions(-)
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 47ac54927bc..16c0ebfe213 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -712,19 +712,35 @@ void QIBusPlatformInputContextPrivate::createBusProxy()
QString QIBusPlatformInputContextPrivate::getSocketPath()
{
- QByteArray display(qgetenv("DISPLAY"));
- QByteArray host = "unix";
+ QByteArray display;
QByteArray displayNumber = "0";
+ bool isWayland = false;
+
+ if (qEnvironmentVariableIsSet("IBUS_ADDRESS_FILE")) {
+ QByteArray path = qgetenv("IBUS_ADDRESS_FILE");
+ return QString::fromLocal8Bit(path);
+ } else if (qEnvironmentVariableIsSet("WAYLAND_DISPLAY")) {
+ display = qgetenv("WAYLAND_DISPLAY");
+ isWayland = true;
+ } else {
+ display = qgetenv("DISPLAY");
+ }
+ QByteArray host = "unix";
+
+ if (isWayland) {
+ displayNumber = display;
+ } else {
+ int pos = display.indexOf(':');
+ if (pos > 0)
+ host = display.left(pos);
+ ++pos;
+ int pos2 = display.indexOf('.', pos);
+ if (pos2 > 0)
+ displayNumber = display.mid(pos, pos2 - pos);
+ else
+ displayNumber = display.mid(pos);
+ }
- int pos = display.indexOf(':');
- if (pos > 0)
- host = display.left(pos);
- ++pos;
- int pos2 = display.indexOf('.', pos);
- if (pos2 > 0)
- displayNumber = display.mid(pos, pos2 - pos);
- else
- displayNumber = display.mid(pos);
if (debug)
qDebug() << "host=" << host << "displayNumber" << displayNumber;
--
2.16.3