diff options
author | Gerry Boland <gerry.boland@canonical.com> | 2016-11-02 16:46:53 +0000 |
---|---|---|
committer | Matti Paaso <matti.paaso@qt.io> | 2017-01-24 05:52:52 +0000 |
commit | c28fde3fdac19fd5a5f614bb7983080031c924b3 (patch) | |
tree | 441d2d4ea4e1e17db49ed3b12c7c724cbc6db894 /src/plugins/platforms/mirclient/qmirclientclipboard.h | |
parent | 4b507e8257243e36f40089d57099c2d668c5884d (diff) |
Mirclient: update based on upstream development in lp:qtubuntu
This is based on revision 360 of lp:qtubuntu.
Main features/bugs fixed:
- fix QQuickWidget-based app rendering
- wire up Qt window types to Mir to enable desktop-based applications
to function with a window manager
- use QEGLPlatformContext and QEGLPBuffer instead of custom code
- correctly populate and update list of QScreens
- support for switching keyboard layouts
- improve window resizing to fix visual glitching
Change-Id: If816a858eb10b6356275d4b80c89a72562b3c29f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Matti Paaso <matti.paaso@qt.io>
Diffstat (limited to 'src/plugins/platforms/mirclient/qmirclientclipboard.h')
-rw-r--r-- | src/plugins/platforms/mirclient/qmirclientclipboard.h | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/plugins/platforms/mirclient/qmirclientclipboard.h b/src/plugins/platforms/mirclient/qmirclientclipboard.h index 1394498320..09e9bcdf38 100644 --- a/src/plugins/platforms/mirclient/qmirclientclipboard.h +++ b/src/plugins/platforms/mirclient/qmirclientclipboard.h @@ -45,7 +45,15 @@ #include <QMimeData> #include <QPointer> -class QDBusInterface; + +namespace com { + namespace ubuntu { + namespace content { + class Hub; + } + } +} + class QDBusPendingCallWatcher; class QMirClientClipboard : public QObject, public QPlatformClipboard @@ -61,31 +69,24 @@ public: bool supportsMode(QClipboard::Mode mode) const override; bool ownsMode(QClipboard::Mode mode) const override; - void requestDBusClipboardContents(); - private Q_SLOTS: - void onDBusClipboardGetContentsFinished(QDBusPendingCallWatcher*); - void onDBusClipboardSetContentsFinished(QDBusPendingCallWatcher*); - void updateMimeData(const QByteArray &serializedMimeData); + void onApplicationStateChanged(Qt::ApplicationState state); private: - void setupDBus(); - - QByteArray serializeMimeData(QMimeData *mimeData) const; - QMimeData *deserializeMimeData(const QByteArray &serializedMimeData) const; - - void setDBusClipboardContents(const QByteArray &clipboardContents); + void updateMimeData(); + void requestMimeData(); QMimeData *mMimeData; - bool mIsOutdated; - QPointer<QDBusInterface> mDBusClipboard; + enum { + OutdatedClipboard, // Our mimeData is outdated, need to fetch latest from ContentHub + SyncingClipboard, // Our mimeData is outdated and we are waiting for ContentHub to reply with the latest paste + SyncedClipboard // Our mimeData is in sync with what ContentHub has + } mClipboardState{OutdatedClipboard}; - QPointer<QDBusPendingCallWatcher> mPendingGetContentsCall; - QPointer<QDBusPendingCallWatcher> mPendingSetContentsCall; + com::ubuntu::content::Hub *mContentHub; - bool mUpdatesDisabled; - bool mDBusSetupDone; + QDBusPendingCallWatcher *mPasteReply{nullptr}; }; #endif // QMIRCLIENTCLIPBOARD_H |