summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@pelagicore.com>2019-07-31 15:08:51 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2019-07-31 15:12:44 +0200
commit3bc3dc4c8e912beb18aec7ab84af40c0129d84c0 (patch)
tree1e967824b381dce5935255936b9db6a2c18def0e
parent2907a594a7d83f814ef9f8446d904409a18248d0 (diff)
parent45b32a94a10479cb1355edeb0db3c87c41935742 (diff)
Merge "Merge remote-tracking branch 'gerrit/5.13' into dev"
-rw-r--r--.qmake.conf2
-rw-r--r--application-manager.pro6
-rw-r--r--doc/QtApplicationManagerDoc1
-rw-r--r--doc/doc.pro4
-rw-r--r--examples/applicationmanager/applicationmanager.pro4
-rw-r--r--examples/applicationmanager/minidesk/doc/src/minidesk.qdoc2
-rw-r--r--qmake-features/am-config.prf2
-rw-r--r--src/application-lib/application-lib.pro1
-rw-r--r--src/common-lib/common-lib.pro1
-rw-r--r--src/crypto-lib/crypto-lib.pro1
-rw-r--r--src/dbus-lib/dbus-lib.pro1
-rw-r--r--src/installer-lib/installer-lib.pro1
-rw-r--r--src/intent-client-lib/intent-client-lib.pro1
-rw-r--r--src/intent-server-lib/intent-server-lib.pro1
-rw-r--r--src/intent-server-lib/intentserver.cpp8
-rw-r--r--src/launcher-lib/launcher-lib.pro1
-rw-r--r--src/main-lib/main-lib.pro5
-rw-r--r--src/main-lib/main.cpp22
-rw-r--r--src/main-lib/windowframetimer.h4
-rw-r--r--src/manager-lib/application.cpp28
-rw-r--r--src/manager-lib/application.h19
-rw-r--r--src/manager-lib/applicationdatabase.cpp2
-rw-r--r--src/manager-lib/applicationipcinterface.cpp23
-rw-r--r--src/manager-lib/applicationmanager.cpp32
-rw-r--r--src/manager-lib/applicationmodel.cpp53
-rw-r--r--src/manager-lib/manager-lib.pro1
-rw-r--r--src/manager-lib/processstatus.cpp76
-rw-r--r--src/manager-lib/qmlinprocessruntime.h2
-rw-r--r--src/monitor-lib/monitor-lib.pro4
-rw-r--r--src/notification-lib/notification-lib.pro1
-rw-r--r--src/package-lib/package-lib.pro1
-rw-r--r--src/shared-main-lib/frametimer.h4
-rw-r--r--src/shared-main-lib/gpustatus.h3
-rw-r--r--src/shared-main-lib/shared-main-lib.pro13
-rw-r--r--src/shared-main-lib/sharedmain.cpp11
-rw-r--r--src/src.pro4
-rw-r--r--src/tools/launcher-qml/launcher-qml.cpp12
-rw-r--r--src/tools/testrunner/testrunner.pro2
-rw-r--r--src/window-lib/touchemulation.cpp10
-rw-r--r--src/window-lib/window-lib.pro1
-rw-r--r--src/window-lib/window.cpp3
-rw-r--r--src/window-lib/windowitem.cpp52
-rw-r--r--src/window-lib/windowmanager.cpp2
-rw-r--r--tests/qml/qml.pro4
-rw-r--r--tests/qml/windowmapping/tst_windowmapping.qml1
45 files changed, 274 insertions, 158 deletions
diff --git a/.qmake.conf b/.qmake.conf
index e23399e2..4a22cc51 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -6,6 +6,8 @@ SOURCE_DIR=$$PWD
BUILD_DIR=$$shadowed($$PWD)
QMAKEFEATURES=$$SOURCE_DIR/qmake-features
+CMAKE_MODULE_TESTS = -
+
# Load the am-coverage feature in every pro file
# This makes sure we compile everything with coverage data
# when the coverage target gets executed
diff --git a/application-manager.pro b/application-manager.pro
index 38694938..b4b39fb9 100644
--- a/application-manager.pro
+++ b/application-manager.pro
@@ -22,11 +22,13 @@ else:contains(QT_BUILD_PARTS, "examples"):CONFIG += enable-examples
load(configure)
qtCompileTest(libarchive)
qtCompileTest(libyaml)
- !headless:qtCompileTest(touchemulation)
+ !headless:qtHaveModule(gui):qtCompileTest(touchemulation)
}
qtHaveModule(waylandcompositor):CONFIG += am_compatible_compositor
+load(am-config)
+
force-single-process:force-multi-process:error("You cannot both specify force-single-process and force-multi-process")
force-multi-process:!headless:!am_compatible_compositor:error("You forced multi-process mode, but the QtCompositor module is not available")
@@ -34,8 +36,6 @@ if(linux|force-libcrypto) {
!if(contains(QT_CONFIG,"openssl")|contains(QT_CONFIG,"openssl-linked")|contains(QT_CONFIG,"ssl")):error("Qt was built without OpenSSL support.")
}
-load(am-config)
-
!config_libyaml|no-system-libyaml {
force-system-libyaml:error("Could not find a system installation for libyaml.")
else:SUBDIRS += 3rdparty/libyaml/libyaml.pro
diff --git a/doc/QtApplicationManagerDoc b/doc/QtApplicationManagerDoc
index 2b2b4aab..333bf5a6 100644
--- a/doc/QtApplicationManagerDoc
+++ b/doc/QtApplicationManagerDoc
@@ -1,4 +1,5 @@
// needed for the new clang based qdoc parser in Qt 5.11
+#include <QtAppManNotification/QtAppManNotification>
#include <QtAppManApplication/QtAppManApplication>
#include <QtAppManCommon/QtAppManCommon>
#include <QtAppManCrypto/QtAppManCrypto>
diff --git a/doc/doc.pro b/doc/doc.pro
index e2288769..e7a91a4c 100644
--- a/doc/doc.pro
+++ b/doc/doc.pro
@@ -2,7 +2,9 @@ TEMPLATE = aux
# setup the correct include paths for qdoc
CONFIG += force_qt
-QT *= core network quick
+QT = core network
+qtHaveModule(quick):QT *= quick
+qtHaveModule(dbus): QT *= dbus
# needed for the new clang based qdoc parser in Qt 5.11
!prefix_build:INCLUDEPATH *= $$[QT_INSTALL_HEADERS]
diff --git a/examples/applicationmanager/applicationmanager.pro b/examples/applicationmanager/applicationmanager.pro
index 8231c457..49cc2c82 100644
--- a/examples/applicationmanager/applicationmanager.pro
+++ b/examples/applicationmanager/applicationmanager.pro
@@ -1,3 +1,7 @@
+load(am-config)
+
+requires(!headless)
+
TEMPLATE = subdirs
SUBDIRS = \
diff --git a/examples/applicationmanager/minidesk/doc/src/minidesk.qdoc b/examples/applicationmanager/minidesk/doc/src/minidesk.qdoc
index d24e956d..e44e5854 100644
--- a/examples/applicationmanager/minidesk/doc/src/minidesk.qdoc
+++ b/examples/applicationmanager/minidesk/doc/src/minidesk.qdoc
@@ -83,7 +83,7 @@ The \c appman binary (executable file) is usually located in the Qt installation
The \l{QtApplicationManager.SystemUI} module has to be imported to access the application manager
APIs. The System UI window has a fixed size and linen background color. Instead of a \l{Rectangle},
the root element could also be a \l{Window}. On top of the background, we display a
-\l{applicationmanager/minidesk/system-ui/Readme.qml}{Readme} element with information on the
+\c Readme element with information on the
features available. At the bottom left there is a textual indication for whether the
application manager runs in single-process or multi-process mode.
diff --git a/qmake-features/am-config.prf b/qmake-features/am-config.prf
index 3ddfe8b2..113013e7 100644
--- a/qmake-features/am-config.prf
+++ b/qmake-features/am-config.prf
@@ -5,6 +5,8 @@ CONFIG *= no_private_qt_headers_warning hide_symbols
CONFIG -= app_bundle qml_debug
CONFIG += exceptions
+!qtHaveModule(gui):CONFIG *= headless
+
DEFINES += QT_MESSAGELOGCONTEXT
win32-msvc*:QMAKE_CXXFLAGS += /FS /wd4290 /DNOMINMAX /D_CRT_SECURE_NO_WARNINGS
diff --git a/src/application-lib/application-lib.pro b/src/application-lib/application-lib.pro
index e17ce0fe..1f75472d 100644
--- a/src/application-lib/application-lib.pro
+++ b/src/application-lib/application-lib.pro
@@ -9,6 +9,7 @@ QT_FOR_PRIVATE *= \
appman_common-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
HEADERS += \
applicationinfo.h \
diff --git a/src/common-lib/common-lib.pro b/src/common-lib/common-lib.pro
index 2ee3a8eb..f3f99251 100644
--- a/src/common-lib/common-lib.pro
+++ b/src/common-lib/common-lib.pro
@@ -15,6 +15,7 @@ versionAtLeast(QT.geniviextras.VERSION, 1.1.0) {
}
CONFIG *= static internal_module
+CONFIG -= create_cmake
include($$SOURCE_DIR/3rdparty/libyaml.pri)
contains(DEFINES, "AM_USE_LIBBACKTRACE"):include($$SOURCE_DIR/3rdparty/libbacktrace.pri)
diff --git a/src/crypto-lib/crypto-lib.pro b/src/crypto-lib/crypto-lib.pro
index 375d1091..3f246568 100644
--- a/src/crypto-lib/crypto-lib.pro
+++ b/src/crypto-lib/crypto-lib.pro
@@ -8,6 +8,7 @@ QT = core
QT_FOR_PRIVATE *= appman_common-private
CONFIG *= static internal_module
+CONFIG -= create_cmake
SOURCES += \
cryptography.cpp \
diff --git a/src/dbus-lib/dbus-lib.pro b/src/dbus-lib/dbus-lib.pro
index cc39bf5b..567fb0f3 100644
--- a/src/dbus-lib/dbus-lib.pro
+++ b/src/dbus-lib/dbus-lib.pro
@@ -10,6 +10,7 @@ QT_FOR_PRIVATE *= \
appman_manager-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
CONFIG = dbus-adaptors-xml $$CONFIG
HEADERS += \
diff --git a/src/installer-lib/installer-lib.pro b/src/installer-lib/installer-lib.pro
index 0ebda484..c61ad7fd 100644
--- a/src/installer-lib/installer-lib.pro
+++ b/src/installer-lib/installer-lib.pro
@@ -13,6 +13,7 @@ QT_FOR_PRIVATE *= \
appman_manager-private
CONFIG *= static internal_module
+CONFIG -= create_cmake
include($$SOURCE_DIR/3rdparty/libarchive.pri)
include($$SOURCE_DIR/3rdparty/libz.pri)
diff --git a/src/intent-client-lib/intent-client-lib.pro b/src/intent-client-lib/intent-client-lib.pro
index e1dcabb4..dc495719 100644
--- a/src/intent-client-lib/intent-client-lib.pro
+++ b/src/intent-client-lib/intent-client-lib.pro
@@ -9,6 +9,7 @@ QT_FOR_PRIVATE *= \
appman_common-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
HEADERS += \
intenthandler.h \
diff --git a/src/intent-server-lib/intent-server-lib.pro b/src/intent-server-lib/intent-server-lib.pro
index 5dadab01..19ebf29c 100644
--- a/src/intent-server-lib/intent-server-lib.pro
+++ b/src/intent-server-lib/intent-server-lib.pro
@@ -9,6 +9,7 @@ QT_FOR_PRIVATE *= \
appman_common-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
HEADERS += \
intent.h \
diff --git a/src/intent-server-lib/intentserver.cpp b/src/intent-server-lib/intentserver.cpp
index 62fdaa2f..0ba11e2f 100644
--- a/src/intent-server-lib/intentserver.cpp
+++ b/src/intent-server-lib/intentserver.cpp
@@ -83,7 +83,7 @@ QT_BEGIN_NAMESPACE_AM
*/
/*! \qmlsignal IntentServer::intentListChanged()
- Emitted when either a new \a intent gets added to or an existing \a intent is remove from the
+ Emitted when either a new intent gets added to or an existing intent is remove from the
intentList.
*/
@@ -285,14 +285,14 @@ IntentList IntentServer::intentList() const
return convertToQml(all());
}
-/*! \qmlmethod Intent IntentServer::find(string intentId, string applicationId, var parameters = {})
+/*! \qmlmethod Intent IntentServer::find(string intentId, string applicationId, var parameters)
This method exposes the same functionality that is used internally to match incoming Intent
requests for the intent identified by \a intentId and targeted for the application identified by
\a applicationId.
Although you could iterate over the intentList yourself in JavaScript, this function has the
- added benefit of also checking the \a parameters against any given \l{Intent::parameterMatch}
- {parameter matches}.
+ added benefit of also checking the optionally provided \a parameters against any given
+ \l{Intent::parameterMatch}{parameter matches}.
If no matching Intent is found, the function will return an \l{Intent::valid}{invalid} Intent.
*/
diff --git a/src/launcher-lib/launcher-lib.pro b/src/launcher-lib/launcher-lib.pro
index f0f8dcb8..df00d155 100644
--- a/src/launcher-lib/launcher-lib.pro
+++ b/src/launcher-lib/launcher-lib.pro
@@ -15,6 +15,7 @@ QT_FOR_PRIVATE *= \
appman_intent_client-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
DBUS_INTERFACES += ../dbus-lib/io.qt.applicationmanager.intentinterface.xml
diff --git a/src/main-lib/main-lib.pro b/src/main-lib/main-lib.pro
index 364812b7..73a972c3 100644
--- a/src/main-lib/main-lib.pro
+++ b/src/main-lib/main-lib.pro
@@ -24,6 +24,7 @@ QT *= \
!disable-external-dbus-interfaces:qtHaveModule(dbus):QT *= dbus appman_dbus-private
CONFIG *= static internal_module
+CONFIG -= create_cmake
win32:LIBS += -luser32
@@ -33,12 +34,16 @@ HEADERS += \
configuration.h \
main.h \
defaultconfiguration.h \
+
+!headless:HEADERS += \
windowframetimer.h \
SOURCES += \
main.cpp \
configuration.cpp \
defaultconfiguration.cpp \
+
+!headless:SOURCES += \
windowframetimer.cpp \
load(qt_module)
diff --git a/src/main-lib/main.cpp b/src/main-lib/main.cpp
index 7738f9da..07cace4b 100644
--- a/src/main-lib/main.cpp
+++ b/src/main-lib/main.cpp
@@ -76,6 +76,7 @@
# include <QGuiApplication>
# include <QQuickView>
# include <QQuickItem>
+# include <QTouchDevice>
# include <private/qopenglcontext_p.h>
#endif
@@ -127,6 +128,7 @@
# endif
# include "touchemulation.h"
# include "windowframetimer.h"
+# include "gpustatus.h"
#endif
#include "configuration.h"
@@ -140,7 +142,6 @@
// monitor-lib
#include "cpustatus.h"
-#include "gpustatus.h"
#include "iostatus.h"
#include "memorystatus.h"
#include "monitormodel.h"
@@ -431,6 +432,8 @@ void Main::loadApplicationDatabase(const QString &databasePath, bool recreateDat
if (singleApp.isEmpty()) {
if (!QFile::exists(databasePath)) // make sure to create a database on the first run
recreateDatabase = true;
+ if (QFileInfo(databasePath).size() == 0) // cope with Windows' 0-byte left-overs
+ recreateDatabase = true;
if (recreateDatabase) {
const QString dbDir = QFileInfo(databasePath).absolutePath();
@@ -630,8 +633,10 @@ void Main::setupQmlEngine(const QStringList &importPaths, const QString &quickCo
// monitor-lib
qmlRegisterType<CpuStatus>("QtApplicationManager", 2, 0, "CpuStatus");
+#if !defined(AM_HEADLESS)
qmlRegisterType<WindowFrameTimer>("QtApplicationManager", 2, 0, "FrameTimer");
qmlRegisterType<GpuStatus>("QtApplicationManager", 2, 0, "GpuStatus");
+#endif
qmlRegisterType<IoStatus>("QtApplicationManager", 2, 0, "IoStatus");
qmlRegisterType<MemoryStatus>("QtApplicationManager", 2, 0, "MemoryStatus");
qmlRegisterType<MonitorModel>("QtApplicationManager", 2, 0, "MonitorModel");
@@ -697,16 +702,25 @@ void Main::setupWindowManager(const QString &waylandSocketName, bool slowAnimati
void Main::setupTouchEmulation(bool enableTouchEmulation)
{
+#if defined(AM_HEADLESS)
+ Q_UNUSED(enableTouchEmulation)
+#else
if (enableTouchEmulation) {
if (TouchEmulation::isSupported()) {
- TouchEmulation::createInstance();
- qCDebug(LogGraphics) << "Touch emulation is enabled: all mouse events will be converted "
- "to touch events.";
+ if (QTouchDevice::devices().isEmpty()) {
+ TouchEmulation::createInstance();
+ qCDebug(LogGraphics) << "Touch emulation is enabled: all mouse events will be "
+ "converted to touch events.";
+ } else {
+ qCDebug(LogGraphics) << "Touch emulation is disabled, because at least one touch "
+ "input device was detected";
+ }
} else {
qCWarning(LogGraphics) << "Touch emulation cannot be enabled. Either it was disabled at "
"build time or the platform does not support it.";
}
}
+#endif
}
void Main::loadQml(bool loadDummyData) Q_DECL_NOEXCEPT_EXPR(false)
diff --git a/src/main-lib/windowframetimer.h b/src/main-lib/windowframetimer.h
index e81d3386..098cacff 100644
--- a/src/main-lib/windowframetimer.h
+++ b/src/main-lib/windowframetimer.h
@@ -42,6 +42,8 @@
#pragma once
+#if !defined(AM_HEADLESS)
+
#include <QtAppManSharedMain/frametimer.h>
#include <QtAppManCommon/global.h>
@@ -72,3 +74,5 @@ private:
};
QT_END_NAMESPACE_AM
+
+#endif // !AM_HEADLESS
diff --git a/src/manager-lib/application.cpp b/src/manager-lib/application.cpp
index 23560cf2..bc2c7e4f 100644
--- a/src/manager-lib/application.cpp
+++ b/src/manager-lib/application.cpp
@@ -244,15 +244,20 @@
Starts the application. The optional argument \a document will be supplied to the application as
is - most commonly this is used to refer to a document to display.
- \sa ApplicationManager::startApplication
+ Returns a \c bool value indicating success. See the full documentation at
+ ApplicationManager::startApplication for more information.
*/
/*!
\qmlmethod bool ApplicationObject::debug(string debugWrapper, string document)
- Same as start() with the difference that it is started via the given \a debugWrapper.
+ Same as start() with the difference that it is started via the given \a debugWrapper. The
+ optional argument \a document will be supplied to the application as is - most commonly this is
+ used to refer to a document to display.
+
Please see the \l{Debugging} page for more information on how to setup and use these debug-wrappers.
- \sa ApplicationManager::debugApplication
+ Returns a \c bool value indicating success. See the full documentation at
+ ApplicationManager::debugApplication for more information.
*/
/*!
\qmlmethod ApplicationObject::stop(bool forceKill)
@@ -368,19 +373,26 @@ QString AbstractApplication::name(const QString &language) const
return info()->name(language);
}
-void AbstractApplication::start(const QString &documentUrl)
+bool AbstractApplication::start(const QString &documentUrl)
{
- emit requests.startRequested(documentUrl);
+ if (requests.startRequested)
+ return requests.startRequested(documentUrl);
+ else
+ return false;
}
-void AbstractApplication::debug(const QString &debugWrapper, const QString &documentUrl)
+bool AbstractApplication::debug(const QString &debugWrapper, const QString &documentUrl)
{
- emit requests.debugRequested(debugWrapper, documentUrl);
+ if (requests.debugRequested)
+ return requests.debugRequested(debugWrapper, documentUrl);
+ else
+ return false;
}
void AbstractApplication::stop(bool forceKill)
{
- emit requests.stopRequested(forceKill);
+ if (requests.stopRequested)
+ requests.stopRequested(forceKill);
}
QVector<AbstractApplication *> AbstractApplication::fromApplicationInfoVector(
diff --git a/src/manager-lib/application.h b/src/manager-lib/application.h
index d66226ca..0b081329 100644
--- a/src/manager-lib/application.h
+++ b/src/manager-lib/application.h
@@ -54,15 +54,14 @@ QT_BEGIN_NAMESPACE_AM
class AbstractRuntime;
class Application;
-// A place to collect signals used internally by appman without polluting
-// AbstractApplication's public QML API.
-class ApplicationRequests : public QObject
+// A place to collect functions used internally by appman without polluting
+// Application's public QML API.
+class ApplicationRequests
{
- Q_OBJECT
-signals:
- void startRequested(const QString &documentUrl);
- void debugRequested(const QString &debugWrapper, const QString &documentUrl);
- void stopRequested(bool forceKill);
+public:
+ std::function<bool(const QString &documentUrl)> startRequested;
+ std::function<bool(const QString &debugWrapper, const QString &documentUrl)> debugRequested;
+ std::function<void(bool forceKill)> stopRequested;
};
class AbstractApplication : public QObject
@@ -103,8 +102,8 @@ public:
AbstractApplication(AbstractApplicationInfo *info);
- Q_INVOKABLE void start(const QString &documentUrl = QString());
- Q_INVOKABLE void debug(const QString &debugWrapper, const QString &documentUrl = QString());
+ Q_INVOKABLE bool start(const QString &documentUrl = QString());
+ Q_INVOKABLE bool debug(const QString &debugWrapper, const QString &documentUrl = QString());
Q_INVOKABLE void stop(bool forceKill = false);
virtual Application *nonAliased() = 0;
diff --git a/src/manager-lib/applicationdatabase.cpp b/src/manager-lib/applicationdatabase.cpp
index 1b336a9b..a6fb8ef3 100644
--- a/src/manager-lib/applicationdatabase.cpp
+++ b/src/manager-lib/applicationdatabase.cpp
@@ -167,6 +167,8 @@ void ApplicationDatabase::write(const QVector<AbstractApplication *> &apps) Q_DE
if (ds.status() != QDataStream::Ok)
throw Exception(*d->file, "could not write to application database");
+
+ d->file->flush();
}
void ApplicationDatabase::invalidate()
diff --git a/src/manager-lib/applicationipcinterface.cpp b/src/manager-lib/applicationipcinterface.cpp
index 9db2b956..9b9ec477 100644
--- a/src/manager-lib/applicationipcinterface.cpp
+++ b/src/manager-lib/applicationipcinterface.cpp
@@ -68,14 +68,15 @@
\inqmlmodule QtApplicationManager.SystemUI
\brief The definition of an IPC interface between the ApplicationManager and applications.
- Using ApplicationIPCInterface items, you can define an IPC interface between your System-UI and
- your applications. The actual interface will be all the properties, signals and functions
- defined within this item. It is however also possible to use this item to wrap already existing
- QtObject or even \l QObject instances by setting the serviceObject property: this will expose
- all properties, signals and functions of the serviceObject instead of the one's in this item.
-
- Please see the ApplicationIPCManager::registerInterface for an in-depth explanation on how these
- IPC interfaces are set up.
+ Using ApplicationIPCInterface items, you can define an IPC interface between the System UI and
+ your applications. The actual interface consists of all the properties, signals, and functions
+ that you define within this item. However, it's also possible to use this item to wrap an
+ existing QtObject or even \l QObject instances by setting the serviceObject property. This way,
+ you can expose all properties, signals, and functions of the serviceObject instead of the ones
+ in this item.
+
+ For an in-depth explanation on how to set up these IPC interfaces, see
+ ApplicationIPCManager::registerInterface().
*/
QT_BEGIN_NAMESPACE_AM
@@ -107,9 +108,9 @@ bool ApplicationIPCInterface::isValidForApplication(AbstractApplication *app) co
/*!
\qmlproperty QtObject ApplicationIPCInterface::serviceObject
- This property holds the pointer to the object which is exposed on the IPC. By default this
- will return the ApplicationIPCInterface object itself, but setting this property can be used
- to wrap already existing objects in order to expose them as IPC interfaces to applications.
+ This property holds the pointer to the object which is exposed via IPC. By default, this
+ property returns the ApplicationIPCInterface object itself. However, you can set this property
+ to wrap existing objects in order to expose them as IPC interfaces to applications.
*/
QObject *ApplicationIPCInterface::serviceObject() const
{
diff --git a/src/manager-lib/applicationmanager.cpp b/src/manager-lib/applicationmanager.cpp
index 38312931..734198bc 100644
--- a/src/manager-lib/applicationmanager.cpp
+++ b/src/manager-lib/applicationmanager.cpp
@@ -901,9 +901,16 @@ bool ApplicationManager::startApplication(const QString &id, const QString &docu
/*!
\qmlmethod bool ApplicationManager::debugApplication(string id, string debugWrapper, string document)
- Instructs the application manager to start the application just like startApplication. The
- application is started via the given \a debugWrapper though. Please see the \l{Debugging} page
- for more information on how to setup and use these debug-wrappers.
+ Instructs the application manager to start the application identified by its unique \a id, just
+ like startApplication. The application is started via the given \a debugWrapper though. The
+ optional argument \a document will be supplied to the application as is - most commonly this is
+ used to refer to a document to display.
+
+ Returns a \c bool value indicating success. See the full documentation at
+ ApplicationManager::startApplication for more information.
+
+ Please see the \l{Debugging} page for more information on how to setup and use these
+ debug-wrappers.
\sa ApplicationObject::debug
*/
@@ -1664,20 +1671,17 @@ void ApplicationManager::addApplication(AbstractApplication *app)
{
QQmlEngine::setObjectOwnership(app, QQmlEngine::CppOwnership);
- connect (&app->requests, &ApplicationRequests::startRequested,
- this, [this, app](const QString &documentUrl) {
- startApplication(app->id(), documentUrl);
- });
+ app->requests.startRequested = [this, app](const QString &documentUrl) {
+ return startApplication(app->id(), documentUrl);
+ };
- connect (&app->requests, &ApplicationRequests::debugRequested,
- this, [this, app](const QString &debugWrapper, const QString &documentUrl) {
- debugApplication(app->id(), debugWrapper, documentUrl);
- });
+ app->requests.debugRequested = [this, app](const QString &debugWrapper, const QString &documentUrl) {
+ return debugApplication(app->id(), debugWrapper, documentUrl);
+ };
- connect (&app->requests, &ApplicationRequests::stopRequested,
- this, [this, app](bool forceKill) {
+ app->requests.stopRequested = [this, app](bool forceKill) {
stopApplication(app->id(), forceKill);
- });
+ };
d->apps << app;
}
diff --git a/src/manager-lib/applicationmodel.cpp b/src/manager-lib/applicationmodel.cpp
index 9e18a833..5fd46ebd 100644
--- a/src/manager-lib/applicationmodel.cpp
+++ b/src/manager-lib/applicationmodel.cpp
@@ -58,18 +58,19 @@
\inqmlmodule QtApplicationManager.SystemUI
\brief A proxy model for the ApplicationManager singleton.
- The ApplicationModel type provides a customizable model of applications. It can be used to
- tailor the ApplicationManager model to your needs (the ApplicationManager singleton is itself
- a model that includes all available applications). It supports filtering and sorting.
- Since this model is based on the ApplicationManager model, the latter will be referred to as
- the \e source model. The ApplicationModel includes the same \l {ApplicationManager Roles}
+ The ApplicationModel type provides a customizable model that can be used to tailor the
+ ApplicationManager model to your needs. The ApplicationManager singleton is a model itself,
+ that includes all available applications. In contrast, the ApplicationModel supports filtering
+ and sorting.
+
+ Since the ApplicationModel is based on the ApplicationManager model, the latter is referred
+ to as the \e source model. The ApplicationModel includes the same \l {ApplicationManager Roles}
{roles} as the ApplicationManager model.
- \note If a model with all applications is needed, ApplicationManager should be used directly,
- since it performs slightly better.
+ \note If you require a model with all applications, with no filtering whatsoever, you should
+ use the ApplicationManager directly, as it has better performance.
- As an example, the following code snippet will show all icons of non-aliased applications in a
- list:
+ The following code snippet displays all the icons of non-aliased applications in a list:
\qml
import QtQuick 2.6
@@ -99,31 +100,31 @@
/*!
\qmlproperty var ApplicationModel::filterFunction
- A JavaScript function callback that will be invoked for each application in the
- ApplicationManager source model. It gets one parameter of type ApplicationObject and must return
- a bool. If the passed application should be included in this model the function must return
- \c true and \c false otherwise.
+ A JavaScript function callback that is invoked for each application in the ApplicationManager
+ source model. This function gets one ApplicationObject parameter and must return a Boolean.
+ If the application passed should be included in this model, then the function must return
+ \c true; \c false otherwise.
- \note The filter will be reevaluated when this function is changed. However, dynamic properties
- (like \c isRunning) used in this function will not trigger a reevaluation when the property
- changes. Changes in the source model will be reflected, though. Since the type is derived from
+ \note Whenever this function is changed, the filter is reevaluated. However, dynamic properties
+ used in this function, like \c isRunning, don't trigger a reevaluation when those properties
+ change. Changes in the source model are reflected. Since the type is derived from
QSortFilterProxyModel, the \l {QSortFilterProxyModel::invalidate()}{invalidate()} slot can be
- used to force a reevalution.
+ used to force a reevaluation.
*/
/*!
\qmlproperty var ApplicationModel::sortFunction
- A JavaScript function callback that will be invoked to sort the applications in this model. It
- gets two parameters of type ApplicationObject and must return a bool. If the first application
- should have a smaller index in this model than the second, the function must return \c true
- and \c false otherwise.
+ A JavaScript function callback that is invoked to sort the applications in this model. This
+ function gets two ApplicationObject parameters and must return a Boolean. If the first
+ application should have a smaller index in this model than the second, the function must return
+ \c true; \c false otherwise.
- \note Sorting will be done whenever this function is changed. However, dynamic properties
- (like \c isRunning) used in this function will not trigger sorting when the property changes.
- Changes in the source model will be reflected, though. Since the type is derived from
+ \note Whenever this function is changed, the model is sorted. However, dynamic properties
+ used in this function, like \c isRunning, don't trigge a sort when when those properties change.
+ Changes in the source model are reflected. Since the type is derived from
QSortFilterProxyModel, the \l {QSortFilterProxyModel::invalidate()}{invalidate()} slot can be
- used to force a reevalution.
+ used to force a sort.
*/
@@ -240,7 +241,7 @@ int ApplicationModel::mapToSource(int ourIndex) const
}
/*!
- \qmlmethod int ApplicationModel::mapFromSource(int sourceIndex)
+ \qmlmethod int ApplicationModel::mapFromSource(int index)
Maps an application's \a index from the ApplicationManager model to the corresponding index in
this model. Returns \c -1 if the specified \a index is invalid.
diff --git a/src/manager-lib/manager-lib.pro b/src/manager-lib/manager-lib.pro
index 7e357c28..170792bd 100644
--- a/src/manager-lib/manager-lib.pro
+++ b/src/manager-lib/manager-lib.pro
@@ -16,6 +16,7 @@ QT_FOR_PRIVATE *= \
appman_monitor-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
multi-process {
QT *= dbus
diff --git a/src/manager-lib/processstatus.cpp b/src/manager-lib/processstatus.cpp
index 89ab9b56..8d6e88c4 100644
--- a/src/manager-lib/processstatus.cpp
+++ b/src/manager-lib/processstatus.cpp
@@ -56,11 +56,11 @@
\qmltype ProcessStatus
\inqmlmodule QtApplicationManager.SystemUI
\ingroup system-ui
- \brief Provides information on the status of an application process.
+ \brief Provides information about the status of an application process.
ProcessStatus provides information about the process of a given application.
- You can use it alongside a Timer for instance to periodically query the status of an
+ You can use it alongside a Timer, for instance, to periodically query the status of an
application process.
\qml
@@ -88,8 +88,8 @@
}
\endqml
- You can also use this component as a MonitorModel data source if you want to plot its
- previous values over time:
+ You can also use this type as a data source for MonitorModel, if you want to plot its previous
+ values over time:
\qml
import QtQuick 2.11
@@ -104,7 +104,9 @@
}
\endqml
- These are the supported keys in the memory properties (\c memoryVirtual, \c memoryRss and \c memoryPss):
+ \target supported-keys
+ The following are the keys supported in the memory properties (\c memoryVirtual, \c memoryRss,
+ and \c memoryPss):
\table
\header
@@ -112,14 +114,14 @@
\li Description
\row
\li \c total
- \li The amount of memory used in total in bytes.
+ \li The total amount of memory used, in bytes.
\row
\li \c text
- \li The amount of memory used by the code section in bytes.
+ \li The amount of memory used by the code section, in bytes.
\row
\li \c heap
- \li The amount of memory used by the heap in bytes. This is private, dynamically allocated
- memory (for example through \c malloc or \c mmap on Linux).
+ \li The amount of memory used by the heap, in bytes. The heap is private, dynamically
+ allocated memory, for example through \c malloc or \c mmap on Linux.
\endtable
*/
@@ -147,7 +149,7 @@ ProcessStatus::ProcessStatus(QObject *parent)
/*!
\qmlmethod ProcessStatus::update
- Updates the properties cpuLoad, memoryVirtual, memoryRss and memoryPss.
+ Updates the cpuLoad, memoryVirtual, memoryRss, and memoryPss properties.
*/
void ProcessStatus::update()
{
@@ -161,7 +163,7 @@ void ProcessStatus::update()
\qmlproperty string ProcessStatus::applicationId
Holds the \l{ApplicationObject::id}{ID} of the \l{ApplicationObject}{application} whose process
- is to be monitored. This ID must be one that is known to the application-manager
+ is to be monitored. This ID must be one that is known to the application manager
(\l{ApplicationManager::applicationIds}{applicationIds()} provides a list of valid IDs). There
is one exception: if you want to monitor the System UI's process, set the ID to an empty
string. In single-process mode, the System UI process is the only valid process, since all
@@ -225,10 +227,11 @@ void ProcessStatus::determinePid()
\qmlproperty int ProcessStatus::processId
\readonly
- This property holds the OS specific process identifier (PID) that is monitored. This can be
- used by external tools for example. The property is 0, if there is no process associated with
- the \l applicationId. In particular, if the application-manager runs in single-process mode,
- only the System-UI (identified by an empty \l applicationId) will have an associated process.
+ This property holds the OS-specific process identifier (PID) that is monitored. It can be
+ used by external tools, for example. The property is 0, if there is no process associated with
+ the \l applicationId. In particular, if the application manager runs in single-process mode,
+ only the System UI has an associated process. The System UI is always identified by an empty
+ \l applicationId.
*/
qint64 ProcessStatus::processId() const
{
@@ -239,9 +242,9 @@ qint64 ProcessStatus::processId() const
\qmlproperty real ProcessStatus::cpuLoad
\readonly
- The process's CPU utilization when update() was last called. A value of 0 means
- that the process was idle, a value of 1 means it fully used the equivalent of one core
- (which may be split over several ones).
+ This property holds the process' CPU utilization during the previous measurement interval, when
+ update() was last called. A value of 0 means the process was idle; a value of 1 means the process used
+ the equivalent of one core, which may be split across several cores.
\sa ProcessStatus::update
*/
@@ -271,13 +274,13 @@ void ProcessStatus::fetchMemoryReadings()
\qmlproperty var ProcessStatus::memoryVirtual
\readonly
- A map of the process's virtual memory usage. See ProcessStatus description for a list of supported keys.
- The total amount of virtual memory is provided through \c memoryVirtual.total for
- example.
+ A map of the process's virtual memory usage. For example, the total amount of virtual memory
+ is provided through \c memoryVirtual.total. For more information, see the table of
+ \l{supported-keys}{supported keys}.
- The value of this property is updated when ProcessStatus::update is called.
+ Calling ProcessStatus::update() updates the value of this property.
- \sa ProcessStatus::update
+ \sa ProcessStatus::update()
*/
QVariantMap ProcessStatus::memoryVirtual() const
{
@@ -288,12 +291,13 @@ QVariantMap ProcessStatus::memoryVirtual() const
\qmlproperty var ProcessStatus::memoryRss
\readonly
- A map of the process's RSS (Resident Set Size) memory usage. This is the amount of memory that is
- actually mapped to physical RAM. See ProcessStatus description for a list of supported keys.
+ A map of the process' Resident Set Size (RSS) memory usage. This is the amount of memory that
+ is actually mapped to physical RAM. For more information, see the table of
+ \l{supported-keys}{supported keys}.
- The value of this property is updated when ProcessStatus::update is called.
+ Calling ProcessStatus::update() updates the value of this property.
- \sa ProcessStatus::update
+ \sa ProcessStatus::update()
*/
QVariantMap ProcessStatus::memoryRss() const
{
@@ -304,16 +308,16 @@ QVariantMap ProcessStatus::memoryRss() const
\qmlproperty var ProcessStatus::memoryPss
\readonly
- A map of the process's PSS (Proportional Set Size) memory usage. This is the
- proportional share of the RSS value above. For instance if two processes share 2 MB
- the RSS value will be 2 MB for each process and the PSS value 1 MB for each process.
- As the name implies, the code section of shared libraries is generally shared between
- processes. Memory may also be shared by other means provided by the OS (e.g. through
- \c mmap on Linux). See ProcessStatus description for a list of supported keys.
+ A map of the process' Proportional Set Size (PSS) memory usage. This is the proportional share
+ of the RSS value in ProcessStatus::memoryRss. For instance, if two processes share 2 MB, then
+ the RSS value is 2 MB for each process; the PSS value is 1 MB for each process. As the name
+ implies, the code section of shared libraries is generally shared between processes. Memory
+ may also be shared by other means provided by the OS, for example, through \c mmap on Linux.
+ For more information, see the table of \l{supported-keys}{supported keys}.
- The value of this property is updated when ProcessStatus::update is called.
+ Calling ProcessStatus::update() updates the value of this property.
- \sa ProcessStatus::update
+ \sa ProcessStatus::update()
*/
QVariantMap ProcessStatus::memoryPss() const
{
@@ -324,7 +328,7 @@ QVariantMap ProcessStatus::memoryPss() const
\qmlproperty list<string> ProcessStatus::roleNames
\readonly
- Names of the roles provided by ProcessStatus when used as a MonitorModel data source.
+ Names of the roles that ProcessStatus provides when used as a data source for MonitorModel.
\sa MonitorModel
*/
diff --git a/src/manager-lib/qmlinprocessruntime.h b/src/manager-lib/qmlinprocessruntime.h
index 4315bae1..72a96a09 100644
--- a/src/manager-lib/qmlinprocessruntime.h
+++ b/src/manager-lib/qmlinprocessruntime.h
@@ -82,7 +82,9 @@ public:
public slots:
bool start() override;
void stop(bool forceKill = false) override;
+#if !defined(AM_HEADLESS)
void stopIfNoVisibleSurfaces();
+#endif
signals:
void aboutToStop(); // used for the ApplicationInterface
diff --git a/src/monitor-lib/monitor-lib.pro b/src/monitor-lib/monitor-lib.pro
index 8d87e102..7de7329e 100644
--- a/src/monitor-lib/monitor-lib.pro
+++ b/src/monitor-lib/monitor-lib.pro
@@ -4,12 +4,14 @@ MODULE = appman_monitor
load(am-config)
-QT = core gui
+QT = core
+!headless: QT *= gui
QT_FOR_PRIVATE *= \
appman_common-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
linux:HEADERS += \
sysfsreader.h \
diff --git a/src/notification-lib/notification-lib.pro b/src/notification-lib/notification-lib.pro
index 1092fba5..eb7d1edc 100644
--- a/src/notification-lib/notification-lib.pro
+++ b/src/notification-lib/notification-lib.pro
@@ -9,6 +9,7 @@ qtHaveModule(qml):QT *= qml
QT_FOR_PRIVATE *= appman_common-private
CONFIG *= static internal_module
+CONFIG -= create_cmake
HEADERS += \
notification.h \
diff --git a/src/package-lib/package-lib.pro b/src/package-lib/package-lib.pro
index 6e73504f..d38aa343 100644
--- a/src/package-lib/package-lib.pro
+++ b/src/package-lib/package-lib.pro
@@ -11,6 +11,7 @@ QT_FOR_PRIVATE *= \
appman_application-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
include($$SOURCE_DIR/3rdparty/libarchive.pri)
include($$SOURCE_DIR/3rdparty/libz.pri)
diff --git a/src/shared-main-lib/frametimer.h b/src/shared-main-lib/frametimer.h
index b7a00d78..384f9a09 100644
--- a/src/shared-main-lib/frametimer.h
+++ b/src/shared-main-lib/frametimer.h
@@ -42,6 +42,8 @@
#pragma once
+#if !defined(AM_HEADLESS)
+
#include <QElapsedTimer>
#include <QObject>
#include <QPointer>
@@ -132,3 +134,5 @@ private:
};
QT_END_NAMESPACE_AM
+
+#endif // !AM_HEADLESS
diff --git a/src/shared-main-lib/gpustatus.h b/src/shared-main-lib/gpustatus.h
index 9cc308b6..e7e23f7c 100644
--- a/src/shared-main-lib/gpustatus.h
+++ b/src/shared-main-lib/gpustatus.h
@@ -42,6 +42,8 @@
#pragma once
+#if !defined(AM_HEADLESS)
+
#include <QtAppManCommon/global.h>
#include <QtAppManMonitor/systemreader.h>
@@ -78,3 +80,4 @@ private:
QT_END_NAMESPACE_AM
+#endif // !AM_HEADLESS
diff --git a/src/shared-main-lib/shared-main-lib.pro b/src/shared-main-lib/shared-main-lib.pro
index 964f0d0c..f71ce690 100644
--- a/src/shared-main-lib/shared-main-lib.pro
+++ b/src/shared-main-lib/shared-main-lib.pro
@@ -11,13 +11,12 @@ QT *= \
appman_monitor-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
HEADERS += \
sharedmain.h \
qmllogger.h \
cpustatus.h \
- frametimer.h \
- gpustatus.h \
iostatus.h \
memorystatus.h \
monitormodel.h \
@@ -26,10 +25,16 @@ SOURCES += \
sharedmain.cpp \
qmllogger.cpp \
cpustatus.cpp \
- frametimer.cpp \
- gpustatus.cpp \
iostatus.cpp \
memorystatus.cpp \
monitormodel.cpp \
+!headless:HEADERS += \
+ frametimer.h \
+ gpustatus.h \
+
+!headless:SOURCES += \
+ frametimer.cpp \
+ gpustatus.cpp \
+
load(qt_module)
diff --git a/src/shared-main-lib/sharedmain.cpp b/src/shared-main-lib/sharedmain.cpp
index 4a5b91b9..647eb91f 100644
--- a/src/shared-main-lib/sharedmain.cpp
+++ b/src/shared-main-lib/sharedmain.cpp
@@ -49,7 +49,6 @@
#include <QVariant>
#include <QFileInfo>
#include <QLibrary>
-#include <QIcon>
#include <QStandardPaths>
#include <QQmlDebuggingEnabler>
#include <QQmlComponent>
@@ -59,6 +58,7 @@
#if !defined(AM_HEADLESS)
# include <QGuiApplication>
+# include <QIcon>
# include <private/qopenglcontext_p.h>
#endif
@@ -123,8 +123,13 @@ int &SharedMain::preConstructor(int &argc)
void SharedMain::setupIconTheme(const QStringList &themeSearchPaths, const QString &themeName)
{
+#if defined(AM_HEADLESS)
+ Q_UNUSED(themeSearchPaths)
+ Q_UNUSED(themeName)
+#else
QIcon::setThemeSearchPaths(themeSearchPaths);
QIcon::setThemeName(themeName);
+#endif
}
void SharedMain::setupQmlDebugging(bool qmlDebugging)
@@ -158,7 +163,9 @@ void SharedMain::setupLogging(bool verbose, const QStringList &loggingRules, con
void SharedMain::setupOpenGL(const QVariantMap &openGLConfiguration)
{
-#if !defined(AM_HEADLESS)
+#if defined(AM_HEADLESS)
+ Q_UNUSED(openGLConfiguration)
+#else
QString profileName = openGLConfiguration.value(qSL("desktopProfile")).toString();
int majorVersion = openGLConfiguration.value(qSL("esMajorVersion"), -1).toInt();
int minorVersion = openGLConfiguration.value(qSL("esMinorVersion"), -1).toInt();
diff --git a/src/src.pro b/src/src.pro
index c1b427ee..63e95d48 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -104,7 +104,9 @@ SUBDIRS = \
qtHaveModule(qml):qtHaveModule(dbus):SUBDIRS += \
launcher_lib \
- # This tool links against everything to extract the Qml type information
+
+ # This tool links against everything to extract the Qml type information
+ qtHaveModule(qml):qtHaveModule(dbus):!headless:SUBDIRS += \
tools_dumpqmltypes \
multi-process:qtHaveModule(qml):qtHaveModule(dbus):SUBDIRS += \
diff --git a/src/tools/launcher-qml/launcher-qml.cpp b/src/tools/launcher-qml/launcher-qml.cpp
index ff52ea11..9ff121a7 100644
--- a/src/tools/launcher-qml/launcher-qml.cpp
+++ b/src/tools/launcher-qml/launcher-qml.cpp
@@ -94,8 +94,10 @@
// shared-main-lib
#include "cpustatus.h"
-#include "frametimer.h"
-#include "gpustatus.h"
+#if !defined(AM_HEADLESS)
+# include "frametimer.h"
+# include "gpustatus.h"
+#endif
#include "iostatus.h"
#include "memorystatus.h"
#include "monitormodel.h"
@@ -185,16 +187,20 @@ Controller::Controller(LauncherMain *a, bool quickLaunched, const QString &direc
// monitor-lib
qmlRegisterType<CpuStatus>("QtApplicationManager", 2, 0, "CpuStatus");
+#if !defined(AM_HEADLESS)
qmlRegisterType<FrameTimer>("QtApplicationManager", 2, 0, "FrameTimer");
qmlRegisterType<GpuStatus>("QtApplicationManager", 2, 0, "GpuStatus");
+#endif
qmlRegisterType<IoStatus>("QtApplicationManager", 2, 0, "IoStatus");
qmlRegisterType<MemoryStatus>("QtApplicationManager", 2, 0, "MemoryStatus");
qmlRegisterType<MonitorModel>("QtApplicationManager", 2, 0, "MonitorModel");
// monitor-lib
qmlRegisterType<CpuStatus>("QtApplicationManager", 1, 0, "CpuStatus");
+#if !defined(AM_HEADLESS)
qmlRegisterType<FrameTimer>("QtApplicationManager", 1, 0, "FrameTimer");
qmlRegisterType<GpuStatus>("QtApplicationManager", 1, 0, "GpuStatus");
+#endif
qmlRegisterType<IoStatus>("QtApplicationManager", 1, 0, "IoStatus");
qmlRegisterType<MemoryStatus>("QtApplicationManager", 1, 0, "MemoryStatus");
qmlRegisterType<MonitorModel>("QtApplicationManager", 1, 0, "MonitorModel");
@@ -369,6 +375,7 @@ void Controller::startApplication(const QString &baseDir, const QString &qmlFile
LauncherMain::instance(), &LauncherMain::setSlowAnimations);
}
+#if !defined(AM_HEADLESS)
// Going through the LauncherMain instance here is a bit weird, and should be refactored
// sometime. Having the flag there makes sense though, because this class can also be used for
// custom launchers.
@@ -379,6 +386,7 @@ void Controller::startApplication(const QString &baseDir, const QString &qmlFile
// we need to catch all show events to apply the slow-animations
QCoreApplication::instance()->installEventFilter(this);
+#endif
QStringList startupPluginFiles = variantToStringList(m_configuration.value(qSL("plugins")).toMap().value(qSL("startup")));
auto startupPlugins = loadPlugins<StartupInterface>("startup", startupPluginFiles);
diff --git a/src/tools/testrunner/testrunner.pro b/src/tools/testrunner/testrunner.pro
index aa4817bd..c097dba8 100644
--- a/src/tools/testrunner/testrunner.pro
+++ b/src/tools/testrunner/testrunner.pro
@@ -1,5 +1,7 @@
include(../appman/appman.pro)
+requires(!headless)
+
TARGET = appman-qmltestrunner
DEFINES += AM_TESTRUNNER
diff --git a/src/window-lib/touchemulation.cpp b/src/window-lib/touchemulation.cpp
index 0d0fb89a..6b989069 100644
--- a/src/window-lib/touchemulation.cpp
+++ b/src/window-lib/touchemulation.cpp
@@ -41,6 +41,7 @@
****************************************************************************/
#include <QtAppManCommon/global.h>
+#include <QGuiApplication>
#include "touchemulation.h"
#if defined(AM_ENABLE_TOUCH_EMULATION)
# include "touchemulation_x11_p.h"
@@ -66,7 +67,8 @@ TouchEmulation *TouchEmulation::createInstance()
qFatal("TouchEmulation::createInstance() was called a second time.");
#if defined(AM_ENABLE_TOUCH_EMULATION)
- s_instance = new TouchEmulationX11();
+ if (isSupported())
+ s_instance = new TouchEmulationX11();
#endif
return s_instance;
@@ -75,10 +77,10 @@ TouchEmulation *TouchEmulation::createInstance()
bool TouchEmulation::isSupported()
{
#if defined(AM_ENABLE_TOUCH_EMULATION)
- return true;
-#else
- return false;
+ if (QGuiApplication::platformName() == qL1S("xcb"))
+ return true;
#endif
+ return false;
}
QT_END_NAMESPACE_AM
diff --git a/src/window-lib/window-lib.pro b/src/window-lib/window-lib.pro
index e1e84db4..a5a43177 100644
--- a/src/window-lib/window-lib.pro
+++ b/src/window-lib/window-lib.pro
@@ -12,6 +12,7 @@ QT_FOR_PRIVATE *= \
appman_manager-private \
CONFIG *= static internal_module
+CONFIG -= create_cmake
multi-process:!headless {
HEADERS += \
diff --git a/src/window-lib/window.cpp b/src/window-lib/window.cpp
index 91857565..13bc7053 100644
--- a/src/window-lib/window.cpp
+++ b/src/window-lib/window.cpp
@@ -61,6 +61,7 @@
\qmlmethod bool WindowObject::setWindowProperty(string name, var value)
Sets the application window's shared property identified by \a name to the given \a value.
+ Returns \c true when successful.
These properties are shared between the System-UI and the client application: in single-process
mode simply via a QVariantMap; in multi-process mode the sharing is done via Qt's extended
@@ -91,7 +92,7 @@
/*!
\qmlmethod var WindowObject::resize(Size size)
- Resizes the WindowObject to the given size, in pixels. Usually you don't have to call
+ Resizes the WindowObject to the given \a size, in pixels. Usually you don't have to call
this yourself as WindowItem takes care of it by default.
\sa WindowObject::size, WindowItem::objectFollowsItemSize
diff --git a/src/window-lib/windowitem.cpp b/src/window-lib/windowitem.cpp
index bb92dba2..5a00bceb 100644
--- a/src/window-lib/windowitem.cpp
+++ b/src/window-lib/windowitem.cpp
@@ -65,20 +65,21 @@
\ingroup system-ui
\brief An Item that renders a given WindowObject.
- In order to render a WindowObject inside the System-UI, you must specify where and how it should
- be done. This is achieved by placing a WindowItem in the scene, which is a regular QML Item, and
- assigning the desired WindowObject to it.
+ To render a WindowObject inside the System UI, you must specify where and how it should be
+ done using a WindowItem. A WindowItem is a regular QML Item, that you place in the scene
+ and assign the desired WindowObject to it.
- The WindowObject will then be rendered in the System-UI scene according to the WindowItem's geometry,
- opacity, visibility, transformations, etc.
+ The WindowObject is then rendered in the System UI scene according to the WindowItem's
+ geometry, opacity, visibility, transformations, and so on.
- The relationship between WindowObjects and WindowItems is similar to the one between image files
- and Image items. The former is the content and the latter defines how it's rendered in a QML scene.
+ The relationship between WindowObjects and WindowItems is similar to the one between image
+ files and Image items. The former is the content; the latter defines how it's rendered in a
+ QML scene.
- It's possible to assign the same WindowObject to multiple WindowItems, which will result in it being
- rendered multiple times.
+ It's possible to assign the same WindowObject to multiple WindowItems, so it can be rendered
+ multiple times.
- The implicit size of a WindowItem is the size of the WindowObject it is displaying.
+ The implicit size of a WindowItem is the size of the WindowObject it displays.
\sa WindowObject
*/
@@ -86,19 +87,22 @@
/*!
\qmlproperty WindowObject WindowItem::window
- The window surface to be displayed.
+ The window surface to display.
*/
/*!
\qmlproperty bool WindowItem::primary
+ \readonly
- Returns whether this is the primary view of the set WindowObject.
- The primary WindowItem will be the one sending input events and defining the size of the WindowObject.
+ Returns whether this is the primary view of the WindowObject set.
- A WindowObject can have only one primary WindowItem. If multiple WindowItems are rendering the same
- WindowObject, making one primary will automatically turn the primary property of all others to false.
+ The primary WindowItem is the one sending input events and defining the size of the
+ WindowObject. A WindowObject can have only one primary WindowItem. If multiple WindowItems
+ are rendering the same WindowObject, making one primary automatically sets the primary
+ property of all other WindowItems to false.
- The first WindowItem to display a window is by default the primary one.
+ By default, the first WindowItem that gets a particular WindowObject assigned will be the
+ primary WindowItem for that WindowObject.
\sa makePrimary
*/
@@ -106,14 +110,14 @@
/*!
\qmlproperty bool WindowItem::objectFollowsItemSize
- If true, WindowItem will resize the WindowObject it's displaying to match its own size.
- If false, resizing the WindowItem will have no effect on the size of the WindowObject
- being displayed. This property is true by default.
+ If true, WindowItem resizes the WindowObject it's displaying to match its own size.
+ If false, resizing the WindowItem has no effect on the size of the WindowObject being
+ displayed. By default, this property is true.
- You should to set it to false when you want the WindowItem size to be determined by the
- WindowObject's size. In this case, in addition to setting this property to false, either
- don't specify a width and height (as the item's implicit size is its WindowObject's size)
- or explicitly set it to match WindowObject's size.
+ Set this property to false when you want the WindowItem size to be determined by the
+ WindowObject's size. Additionally, don't specify a width and height to maintain the
+ item's implicit size as its WindowObject's size, or explicitly set it to match the
+ WindowObject's size.
\sa WindowObject::resize
*/
@@ -121,7 +125,7 @@
/*!
\qmlmethod void WindowItem::makePrimary
- Make it the primary WindowItem of the window it is displaying.
+ Make the currently displayed window the primary WindowItem.
\sa primary
*/
diff --git a/src/window-lib/windowmanager.cpp b/src/window-lib/windowmanager.cpp
index 97a0f5a7..ea9a3027 100644
--- a/src/window-lib/windowmanager.cpp
+++ b/src/window-lib/windowmanager.cpp
@@ -545,7 +545,7 @@ void WindowManager::setupInProcessRuntime(AbstractRuntime *runtime)
runtime->setInProcessQmlEngine(d->qmlEngine);
connect(runtime, &AbstractRuntime::inProcessSurfaceItemReady,
- this, &WindowManager::inProcessSurfaceItemCreated, Qt::QueuedConnection);
+ this, &WindowManager::inProcessSurfaceItemCreated);
}
}
diff --git a/tests/qml/qml.pro b/tests/qml/qml.pro
index f38d31cf..8a0cd59f 100644
--- a/tests/qml/qml.pro
+++ b/tests/qml/qml.pro
@@ -1,3 +1,7 @@
+load(am-config)
+
+requires(!headless)
+
TEMPLATE = subdirs
SUBDIRS = \
simple \
diff --git a/tests/qml/windowmapping/tst_windowmapping.qml b/tests/qml/windowmapping/tst_windowmapping.qml
index 5e5d0f45..00a6e582 100644
--- a/tests/qml/windowmapping/tst_windowmapping.qml
+++ b/tests/qml/windowmapping/tst_windowmapping.qml
@@ -292,6 +292,7 @@ TestCase {
function test_window_properties() {
var app = ApplicationManager.application("test.winmap.amwin");
+ windowPropertyChangedSpy.clear();
app.start();
tryCompare(WindowManager, "count", 1);