diff options
author | Tomasz Olszak <olszak.tomasz@gmail.com> | 2013-07-18 21:51:09 +0000 |
---|---|---|
committer | Tomasz Olszak <olszak.tomasz@gmail.com> | 2014-12-15 21:29:04 +0100 |
commit | ddc14ead031699f1f3a1a7aece30634904ac44ad (patch) | |
tree | 1bfd57e2acae6153337274b835b4feff52192b79 | |
parent | 39e26746f6ca957c96b417a15f6edf7c8601b0c1 (diff) | |
download | qtbase-ddc14ead031699f1f3a1a7aece30634904ac44ad.tar.gz qtbase-ddc14ead031699f1f3a1a7aece30634904ac44ad.tar.bz2 qtbase-ddc14ead031699f1f3a1a7aece30634904ac44ad.zip |
Tizen - handling application lifecycle
Change-Id: I47763f2d42e400df3e0e60515468ada8c8546128
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Tomasz Olszak <olszak.tomasz@gmail.com>
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 33 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/xcb-plugin.pro | 2 |
5 files changed, 45 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 5510c3b1b4..7b2a37239a 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -1536,6 +1536,9 @@ static const char * xcb_atomnames = { "Rel Vert Wheel\0" "Rel Horiz Scroll\0" "Rel Vert Scroll\0" +#ifdef Q_OS_LINUX_TIZEN + "_X_ILLUME_DEACTIVATE_WINDOW\0" +#endif "_XSETTINGS_SETTINGS\0" "_COMPIZ_DECOR_PENDING\0" "_COMPIZ_DECOR_REQUEST\0" diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index f31ecf8e03..713955c04f 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -273,6 +273,9 @@ namespace QXcbAtom { RelHorizScroll, RelVertScroll, +#ifdef Q_OS_LINUX_TIZEN + _X_ILLUME_DEACTIVATE_WINDOW, +#endif _XSETTINGS_SETTINGS, _COMPIZ_DECOR_PENDING, diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 52269bafea..b901a5d3d8 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -88,6 +88,10 @@ #endif #endif +#ifdef Q_OS_LINUX_TIZEN +#include <aul/aul.h> +#endif // Q_OS_LINUX_TIZEN + #include <QtCore/QFileInfo> QT_BEGIN_NAMESPACE @@ -116,11 +120,37 @@ static bool runningUnderDebugger() } #endif +#ifdef Q_OS_LINUX_TIZEN +static int aul_handler(aul_type type, bundle *, void *) +{ + switch (type) { + case AUL_START: + QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive); + break; + case AUL_RESUME: + if (!QGuiApplication::topLevelWindows().isEmpty()) + QGuiApplication::topLevelWindows().first()->requestActivate(); + break; + case AUL_TERMINATE: + QCoreApplication::quit(); + break; + } + return 0; +} +#endif // Q_OS_LINUX_TIZEN + QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char **argv) : m_services(new QGenericUnixServices) , m_instanceName(0) { + qRegisterMetaType<QXcbWindow*>(); + +#ifdef Q_OS_LINUX_TIZEN + aul_launch_init(aul_handler, 0); + aul_launch_argv_handler(argc, argv); +#endif // Q_OS_LINUX_TIZEN + #ifdef XCB_USE_XLIB XInitThreads(); #endif @@ -302,6 +332,9 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const case ForeignWindows: return true; case SyncState: return true; case RasterGLSurface: return true; +#ifdef Q_OS_LINUX_TIZEN + case ApplicationState: return true; +#endif default: return QPlatformIntegration::hasCapability(cap); } } diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 5d3206b097..ab864c7fb7 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1822,6 +1822,10 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even || event->type == atom(QXcbAtom::WM_CHANGE_STATE)) { // Ignore _NET_WM_STATE, MANAGER which are relate to tray icons // and other messages. +#ifdef Q_OS_LINUX_TIZEN + } else if (event->type == atom(QXcbAtom::_X_ILLUME_DEACTIVATE_WINDOW)) { + QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationHidden); +#endif // Q_OS_LINUX_TIZEN } else if (event->type == atom(QXcbAtom::_COMPIZ_DECOR_PENDING) || event->type == atom(QXcbAtom::_COMPIZ_DECOR_REQUEST) || event->type == atom(QXcbAtom::_COMPIZ_DECOR_DELETE_PIXMAP)) { diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index f14fcde73f..72871b1cec 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -124,3 +124,5 @@ contains(QT_CONFIG, xkbcommon-qt): { LIBS += $$QMAKE_LIBS_XKBCOMMON QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON } + +tizen:LIBS += -laul |