diff options
author | Bernd Weimer <bernd.weimer@pelagicore.com> | 2017-12-21 10:09:51 +0100 |
---|---|---|
committer | Robert Griebl <robert.griebl@pelagicore.com> | 2018-01-11 21:40:37 +0000 |
commit | e3a69de57b2b948a618e7cc48eabcbfccb098278 (patch) | |
tree | cd96050022f6c26650c3a5a0aad5086d4a93ebf1 | |
parent | 9e9446bab80664aa707d8360ef8956ca6851b32d (diff) | |
download | qtapplicationmanager-e3a69de57b2b948a618e7cc48eabcbfccb098278.tar.gz |
Allow to enable Wayland ping-pong again
Added auto test, as well.
Change-Id: I459e94ac399776d9d12c86106a029e322516c222
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
-rw-r--r-- | src/window-lib/windowmanager.cpp | 7 | ||||
-rw-r--r-- | tests/qml/windowmapping/apps/test.winmap.ping/icon.png | bin | 0 -> 1486 bytes | |||
-rw-r--r-- | tests/qml/windowmapping/apps/test.winmap.ping/info.yaml | 9 | ||||
-rw-r--r-- | tests/qml/windowmapping/apps/test.winmap.ping/ping.qml | 54 | ||||
-rw-r--r-- | tests/qml/windowmapping/tst_windowmapping.qml | 15 |
5 files changed, 81 insertions, 4 deletions
diff --git a/src/window-lib/windowmanager.cpp b/src/window-lib/windowmanager.cpp index 0dc9661e..2502c158 100644 --- a/src/window-lib/windowmanager.cpp +++ b/src/window-lib/windowmanager.cpp @@ -809,16 +809,15 @@ void WindowManager::waylandSurfaceMapped(WindowSurface *surface) if (index == -1) { WaylandWindow *w = new WaylandWindow(app, surface); setupWindow(w); + // switch on Wayland ping/pong + if (d->watchdogEnabled) + w->enablePing(true); } else { QModelIndex modelIndex = QAbstractListModel::index(index); emit dataChanged(modelIndex, modelIndex, QVector<int>() << IsMapped); emit windowReady(index, d->windows.at(index)->windowItem()); } - // switch on Wayland ping/pong -- currently disabled, since it is a bit unstable - //if (d->watchdogEnabled) - // w->enablePing(true); - if (app) { //We only take focus for applications. surface->takeFocus(); // otherwise we will never get keyboard focus in the client diff --git a/tests/qml/windowmapping/apps/test.winmap.ping/icon.png b/tests/qml/windowmapping/apps/test.winmap.ping/icon.png Binary files differnew file mode 100644 index 00000000..c1397153 --- /dev/null +++ b/tests/qml/windowmapping/apps/test.winmap.ping/icon.png diff --git a/tests/qml/windowmapping/apps/test.winmap.ping/info.yaml b/tests/qml/windowmapping/apps/test.winmap.ping/info.yaml new file mode 100644 index 00000000..3f4e822e --- /dev/null +++ b/tests/qml/windowmapping/apps/test.winmap.ping/info.yaml @@ -0,0 +1,9 @@ +formatVersion: 1 +formatType: am-application +--- +id: 'test.winmap.ping' +icon: 'icon.png' +code: 'ping.qml' +runtime: 'qml' +name: + en: 'Wayland ping-pong' diff --git a/tests/qml/windowmapping/apps/test.winmap.ping/ping.qml b/tests/qml/windowmapping/apps/test.winmap.ping/ping.qml new file mode 100644 index 00000000..f6a579fd --- /dev/null +++ b/tests/qml/windowmapping/apps/test.winmap.ping/ping.qml @@ -0,0 +1,54 @@ +/**************************************************************************** +** +** Copyright (C) 2017 Pelagicore AG +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Pelagicore Application Manager. +** +** $QT_BEGIN_LICENSE:LGPL-QTAS$ +** Commercial License Usage +** Licensees holding valid commercial Qt Automotive Suite licenses may use +** this file in accordance with the commercial license agreement provided +** with the Software or, alternatively, in accordance with the terms +** contained in a written agreement between you and The Qt Company. For +** licensing terms and conditions see https://www.qt.io/terms-conditions. +** For further information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +** SPDX-License-Identifier: LGPL-3.0 +** +****************************************************************************/ + +import QtQuick 2.4 +import QtApplicationManager 1.0 + +ApplicationManagerWindow { + Timer { + id: tim + interval: 0 + running: true + onTriggered: { + while (true); // application hangs + } + } +} diff --git a/tests/qml/windowmapping/tst_windowmapping.qml b/tests/qml/windowmapping/tst_windowmapping.qml index fc826ebf..e639008e 100644 --- a/tests/qml/windowmapping/tst_windowmapping.qml +++ b/tests/qml/windowmapping/tst_windowmapping.qml @@ -265,6 +265,21 @@ TestCase { compare(windowLostSpy.count, 1); } + function test_wayland_ping_pong() { + appId = "test.winmap.ping"; + if (ApplicationManager.singleProcess) + skip("Wayland ping-pong is only supported in multi-process mode"); + ApplicationManager.startApplication(appId); + windowReadySpy.wait(2000); + compare(ApplicationManager.applicationRunState(appId), ApplicationManager.Running) + runStateChangedSpy.clear(); + wait(2200); + runStateChangedSpy.wait(2000); + compare(runStateChangedSpy.signalArguments[0][1], ApplicationManager.ShuttingDown) + runStateChangedSpy.wait(2000); + compare(runStateChangedSpy.signalArguments[1][1], ApplicationManager.NotRunning) + } + function test_window_properties() { appId = "test.winmap.amwin"; ApplicationManager.startApplication(appId); |