-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IBus: Support the portal, needed for Flatpak environment
Following commit 35ce6247 in IBus, IBus input plugin now connects to session bus and use IBus portal to create input context when running in Flatpak environment or IBUS_USE_PORTAL is set. [ChangeLog][plugins][ibus] Support IBus portal. Qt programs in Flatpak environment can now trigger IBus input method. Change-Id: I561f5f873d709b8abeae554d804daa058f9f6e16 Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Takao Fujiwara <[email protected]>
- Loading branch information
Showing
5 changed files
with
140 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/plugins/platforminputcontexts/ibus/interfaces/org.freedesktop.IBus.Portal.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" | ||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> | ||
<node> | ||
<interface name="org.freedesktop.IBus.Portal"> | ||
<method name="CreateInputContext"> | ||
<arg name="name" direction="in" type="s"/> | ||
<arg name="context" direction="out" type="o"/> | ||
</method> | ||
</interface> | ||
</node> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/plugins/platforminputcontexts/ibus/qibusproxyportal.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* This file was generated by qdbusxml2cpp version 0.8 | ||
* Command line was: qdbusxml2cpp -N -p qibusproxyportal -c QIBusProxyPortal interfaces/org.freedesktop.IBus.Portal.xml | ||
* | ||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. | ||
* | ||
* This is an auto-generated file. | ||
* This file may have been hand-edited. Look for HAND-EDIT comments | ||
* before re-generating it. | ||
*/ | ||
|
||
#include "qibusproxyportal.h" | ||
|
||
/* | ||
* Implementation of interface class QIBusProxyPortal | ||
*/ | ||
|
||
QIBusProxyPortal::QIBusProxyPortal(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) | ||
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) | ||
{ | ||
} | ||
|
||
QIBusProxyPortal::~QIBusProxyPortal() | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* This file was generated by qdbusxml2cpp version 0.8 | ||
* Command line was: qdbusxml2cpp -N -p qibusproxyportal -c QIBusProxyPortal interfaces/org.freedesktop.IBus.Portal.xml | ||
* | ||
* qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd. | ||
* | ||
* This is an auto-generated file. | ||
* Do not edit! All changes made to it will be lost. | ||
*/ | ||
|
||
#ifndef QIBUSPROXYPORTAL_H | ||
#define QIBUSPROXYPORTAL_H | ||
|
||
#include <QtCore/QObject> | ||
#include <QtCore/QByteArray> | ||
#include <QtCore/QList> | ||
#include <QtCore/QMap> | ||
#include <QtCore/QString> | ||
#include <QtCore/QStringList> | ||
#include <QtCore/QVariant> | ||
#include <QtDBus/QtDBus> | ||
|
||
/* | ||
* Proxy class for interface org.freedesktop.IBus.Portal | ||
*/ | ||
class QIBusProxyPortal: public QDBusAbstractInterface | ||
{ | ||
Q_OBJECT | ||
public: | ||
static inline const char *staticInterfaceName() | ||
{ return "org.freedesktop.IBus.Portal"; } | ||
|
||
public: | ||
QIBusProxyPortal(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr); | ||
|
||
~QIBusProxyPortal(); | ||
|
||
public Q_SLOTS: // METHODS | ||
inline QDBusPendingReply<QDBusObjectPath> CreateInputContext(const QString &name) | ||
{ | ||
QList<QVariant> argumentList; | ||
argumentList << QVariant::fromValue(name); | ||
return asyncCallWithArgumentList(QStringLiteral("CreateInputContext"), argumentList); | ||
} | ||
|
||
Q_SIGNALS: // SIGNALS | ||
}; | ||
|
||
#endif |