2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2017-10-07 12:09:07 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2017 Martin Flöser <mgraesslin@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2019 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
2022-04-09 12:23:59 +00:00
|
|
|
SPDX-FileCopyrightText: 2022 Ismael Asensio <isma.af@gmail.com>
|
2017-10-07 12:09:07 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2017-10-07 12:09:07 +00:00
|
|
|
#include "kwin_wayland_test.h"
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
#include "cursor.h"
|
2022-04-14 12:33:28 +00:00
|
|
|
#include "output.h"
|
2022-04-14 10:51:20 +00:00
|
|
|
#include "outputconfiguration.h"
|
2017-10-07 12:09:07 +00:00
|
|
|
#include "platform.h"
|
|
|
|
#include "rules.h"
|
|
|
|
#include "virtualdesktops.h"
|
|
|
|
#include "wayland_server.h"
|
2022-04-22 17:39:12 +00:00
|
|
|
#include "window.h"
|
2018-02-11 17:27:34 +00:00
|
|
|
#include "workspace.h"
|
2017-10-07 12:09:07 +00:00
|
|
|
|
|
|
|
#include <KWayland/Client/surface.h>
|
|
|
|
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
#include <linux/input.h>
|
|
|
|
|
2017-10-07 12:09:07 +00:00
|
|
|
using namespace KWin;
|
|
|
|
using namespace KWayland::Client;
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow_rules-0");
|
2017-10-07 12:09:07 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
class TestXdgShellWindowRules : public QObject
|
2017-10-07 12:09:07 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
enum ClientFlag {
|
|
|
|
None = 0,
|
|
|
|
ClientShouldBeInactive = 1 << 0, // Client should be inactive. Used on Minimize tests
|
|
|
|
ServerSideDecoration = 1 << 1, // Create window with server side decoration. Used on noBorder tests
|
|
|
|
ReturnAfterSurfaceConfiguration = 1 << 2, // Do not create the client now, but return after surface configuration.
|
|
|
|
};
|
|
|
|
Q_DECLARE_FLAGS(ClientFlags, ClientFlag);
|
|
|
|
|
2017-10-07 12:09:07 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void initTestCase();
|
|
|
|
void init();
|
|
|
|
void cleanup();
|
|
|
|
|
2019-07-09 17:28:05 +00:00
|
|
|
void testPositionDontAffect();
|
|
|
|
void testPositionApply();
|
|
|
|
void testPositionRemember();
|
|
|
|
void testPositionForce();
|
|
|
|
void testPositionApplyNow();
|
|
|
|
void testPositionForceTemporarily();
|
|
|
|
|
|
|
|
void testSizeDontAffect();
|
|
|
|
void testSizeApply();
|
|
|
|
void testSizeRemember();
|
|
|
|
void testSizeForce();
|
|
|
|
void testSizeApplyNow();
|
|
|
|
void testSizeForceTemporarily();
|
|
|
|
|
2019-07-09 18:07:21 +00:00
|
|
|
void testMaximizeDontAffect();
|
|
|
|
void testMaximizeApply();
|
|
|
|
void testMaximizeRemember();
|
|
|
|
void testMaximizeForce();
|
|
|
|
void testMaximizeApplyNow();
|
|
|
|
void testMaximizeForceTemporarily();
|
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
void testDesktopsDontAffect();
|
|
|
|
void testDesktopsApply();
|
|
|
|
void testDesktopsRemember();
|
|
|
|
void testDesktopsForce();
|
|
|
|
void testDesktopsApplyNow();
|
|
|
|
void testDesktopsForceTemporarily();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
void testMinimizeDontAffect();
|
|
|
|
void testMinimizeApply();
|
|
|
|
void testMinimizeRemember();
|
|
|
|
void testMinimizeForce();
|
|
|
|
void testMinimizeApplyNow();
|
|
|
|
void testMinimizeForceTemporarily();
|
|
|
|
|
|
|
|
void testSkipTaskbarDontAffect();
|
|
|
|
void testSkipTaskbarApply();
|
|
|
|
void testSkipTaskbarRemember();
|
|
|
|
void testSkipTaskbarForce();
|
|
|
|
void testSkipTaskbarApplyNow();
|
|
|
|
void testSkipTaskbarForceTemporarily();
|
|
|
|
|
|
|
|
void testSkipPagerDontAffect();
|
|
|
|
void testSkipPagerApply();
|
|
|
|
void testSkipPagerRemember();
|
|
|
|
void testSkipPagerForce();
|
|
|
|
void testSkipPagerApplyNow();
|
|
|
|
void testSkipPagerForceTemporarily();
|
|
|
|
|
|
|
|
void testSkipSwitcherDontAffect();
|
|
|
|
void testSkipSwitcherApply();
|
|
|
|
void testSkipSwitcherRemember();
|
|
|
|
void testSkipSwitcherForce();
|
|
|
|
void testSkipSwitcherApplyNow();
|
|
|
|
void testSkipSwitcherForceTemporarily();
|
|
|
|
|
|
|
|
void testKeepAboveDontAffect();
|
|
|
|
void testKeepAboveApply();
|
|
|
|
void testKeepAboveRemember();
|
|
|
|
void testKeepAboveForce();
|
|
|
|
void testKeepAboveApplyNow();
|
|
|
|
void testKeepAboveForceTemporarily();
|
|
|
|
|
|
|
|
void testKeepBelowDontAffect();
|
|
|
|
void testKeepBelowApply();
|
|
|
|
void testKeepBelowRemember();
|
|
|
|
void testKeepBelowForce();
|
|
|
|
void testKeepBelowApplyNow();
|
|
|
|
void testKeepBelowForceTemporarily();
|
|
|
|
|
|
|
|
void testShortcutDontAffect();
|
|
|
|
void testShortcutApply();
|
|
|
|
void testShortcutRemember();
|
|
|
|
void testShortcutForce();
|
|
|
|
void testShortcutApplyNow();
|
|
|
|
void testShortcutForceTemporarily();
|
|
|
|
|
|
|
|
void testDesktopFileDontAffect();
|
|
|
|
void testDesktopFileApply();
|
|
|
|
void testDesktopFileRemember();
|
|
|
|
void testDesktopFileForce();
|
|
|
|
void testDesktopFileApplyNow();
|
|
|
|
void testDesktopFileForceTemporarily();
|
|
|
|
|
|
|
|
void testActiveOpacityDontAffect();
|
|
|
|
void testActiveOpacityForce();
|
|
|
|
void testActiveOpacityForceTemporarily();
|
|
|
|
|
|
|
|
void testInactiveOpacityDontAffect();
|
|
|
|
void testInactiveOpacityForce();
|
|
|
|
void testInactiveOpacityForceTemporarily();
|
|
|
|
|
2021-12-11 13:29:35 +00:00
|
|
|
void testNoBorderDontAffect();
|
|
|
|
void testNoBorderApply();
|
|
|
|
void testNoBorderRemember();
|
|
|
|
void testNoBorderForce();
|
|
|
|
void testNoBorderApplyNow();
|
|
|
|
void testNoBorderForceTemporarily();
|
|
|
|
|
2022-02-05 16:38:24 +00:00
|
|
|
void testScreenDontAffect();
|
|
|
|
void testScreenApply();
|
|
|
|
void testScreenRemember();
|
|
|
|
void testScreenForce();
|
|
|
|
void testScreenApplyNow();
|
|
|
|
void testScreenForceTemporarily();
|
|
|
|
|
2018-03-12 17:06:33 +00:00
|
|
|
void testMatchAfterNameChange();
|
2021-12-10 09:17:43 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
private:
|
2022-04-09 12:23:59 +00:00
|
|
|
void createTestWindow(ClientFlags flags = None);
|
|
|
|
void mapClientToSurface(QSize clientSize, ClientFlags flags = None);
|
|
|
|
void destroyTestWindow();
|
|
|
|
|
2022-03-23 10:13:38 +00:00
|
|
|
template<typename T>
|
|
|
|
void setWindowRule(const QString &property, const T &value, int policy);
|
2021-09-02 22:19:43 +00:00
|
|
|
|
2021-12-10 09:17:43 +00:00
|
|
|
private:
|
|
|
|
KSharedConfig::Ptr m_config;
|
2022-04-09 12:23:59 +00:00
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
Window *m_client;
|
2022-04-09 17:12:41 +00:00
|
|
|
QScopedPointer<KWayland::Client::Surface> m_surface;
|
|
|
|
QScopedPointer<Test::XdgToplevel> m_shellSurface;
|
2022-04-09 12:23:59 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QScopedPointer<QSignalSpy> m_toplevelConfigureRequestedSpy;
|
|
|
|
QScopedPointer<QSignalSpy> m_surfaceConfigureRequestedSpy;
|
2017-10-07 12:09:07 +00:00
|
|
|
};
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::initTestCase()
|
2017-10-07 12:09:07 +00:00
|
|
|
{
|
2022-04-22 17:39:12 +00:00
|
|
|
qRegisterMetaType<KWin::Window *>();
|
2017-10-07 12:09:07 +00:00
|
|
|
|
2020-07-07 09:32:29 +00:00
|
|
|
QSignalSpy applicationStartedSpy(kwinApp(), &Application::started);
|
|
|
|
QVERIFY(applicationStartedSpy.isValid());
|
2017-10-07 12:09:07 +00:00
|
|
|
kwinApp()->platform()->setInitialWindowSize(QSize(1280, 1024));
|
2020-12-09 13:06:15 +00:00
|
|
|
QVERIFY(waylandServer()->init(s_socketName));
|
2019-08-26 21:16:53 +00:00
|
|
|
QMetaObject::invokeMethod(kwinApp()->platform(), "setVirtualOutputs", Qt::DirectConnection, Q_ARG(int, 2));
|
2017-10-07 12:09:07 +00:00
|
|
|
|
|
|
|
kwinApp()->start();
|
2020-07-07 09:32:29 +00:00
|
|
|
QVERIFY(applicationStartedSpy.wait());
|
2021-08-31 07:03:05 +00:00
|
|
|
const auto outputs = kwinApp()->platform()->enabledOutputs();
|
|
|
|
QCOMPARE(outputs.count(), 2);
|
|
|
|
QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024));
|
|
|
|
QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024));
|
2021-05-08 00:08:22 +00:00
|
|
|
Test::initWaylandWorkspace();
|
2021-12-10 09:17:43 +00:00
|
|
|
|
|
|
|
m_config = KSharedConfig::openConfig(QStringLiteral("kwinrulesrc"), KConfig::SimpleConfig);
|
|
|
|
RuleBook::self()->setConfig(m_config);
|
2017-10-07 12:09:07 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::init()
|
2017-10-07 12:09:07 +00:00
|
|
|
{
|
2017-10-07 15:57:10 +00:00
|
|
|
VirtualDesktopManager::self()->setCurrent(VirtualDesktopManager::self()->desktops().first());
|
2021-12-11 13:29:35 +00:00
|
|
|
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::XdgDecorationV1));
|
2017-10-07 12:09:07 +00:00
|
|
|
|
2021-08-28 18:58:29 +00:00
|
|
|
workspace()->setActiveOutput(QPoint(640, 512));
|
2017-10-07 12:09:07 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::cleanup()
|
2017-10-07 12:09:07 +00:00
|
|
|
{
|
2022-04-11 11:06:29 +00:00
|
|
|
if (!m_shellSurface.isNull()) {
|
|
|
|
destroyTestWindow();
|
|
|
|
}
|
|
|
|
|
2017-10-07 12:09:07 +00:00
|
|
|
Test::destroyWaylandConnection();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2021-12-10 09:17:43 +00:00
|
|
|
// Wipe the window rule config clean.
|
|
|
|
for (const QString &group : m_config->groupList()) {
|
|
|
|
m_config->deleteGroup(group);
|
|
|
|
}
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
workspace()->slotReconfigure();
|
|
|
|
|
|
|
|
// Restore virtual desktops to the initial state.
|
|
|
|
VirtualDesktopManager::self()->setCount(1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->count(), 1u);
|
2017-10-07 12:09:07 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::createTestWindow(ClientFlags flags)
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
// Apply flags for special windows and rules
|
|
|
|
const bool createClient = !(flags & ReturnAfterSurfaceConfiguration);
|
|
|
|
const auto decorationMode = (flags & ServerSideDecoration) ? Test::XdgToplevelDecorationV1::mode_server_side
|
|
|
|
: Test::XdgToplevelDecorationV1::mode_client_side;
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
// Create an xdg surface.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_surface.reset(Test::createSurface());
|
|
|
|
m_shellSurface.reset(Test::createXdgToplevelSurface(m_surface.data(), Test::CreationSetup::CreateOnly, m_surface.data()));
|
|
|
|
Test::XdgToplevelDecorationV1 *decoration = Test::createXdgToplevelDecorationV1(m_shellSurface.data(), m_shellSurface.data());
|
2022-04-09 12:23:59 +00:00
|
|
|
|
|
|
|
// Add signal watchers
|
2022-04-09 17:12:41 +00:00
|
|
|
m_toplevelConfigureRequestedSpy.reset(new QSignalSpy(m_shellSurface.data(), &Test::XdgToplevel::configureRequested));
|
|
|
|
m_surfaceConfigureRequestedSpy.reset(new QSignalSpy(m_shellSurface->xdgSurface(), &Test::XdgSurface::configureRequested));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->set_app_id(QStringLiteral("org.kde.foo"));
|
2021-12-11 13:29:35 +00:00
|
|
|
decoration->set_mode(decorationMode);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
// Wait for the initial configure event
|
2022-04-09 17:12:41 +00:00
|
|
|
m_surface->commit(KWayland::Client::Surface::CommitFlag::None);
|
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
2022-04-09 12:23:59 +00:00
|
|
|
|
|
|
|
if (createClient) {
|
|
|
|
mapClientToSurface(QSize(100, 50), flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::mapClientToSurface(QSize clientSize, ClientFlags flags)
|
2022-04-09 12:23:59 +00:00
|
|
|
{
|
|
|
|
const bool clientShouldBeActive = !(flags & ClientShouldBeInactive);
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surface.isNull());
|
|
|
|
QVERIFY(!m_shellSurface.isNull());
|
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy.isNull());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Draw content of the surface.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
// Create the client
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client = Test::renderAndWaitForShown(m_surface.data(), clientSize, Qt::blue);
|
|
|
|
QVERIFY(m_client);
|
|
|
|
QCOMPARE(m_client->isActive(), clientShouldBeActive);
|
2022-04-09 12:23:59 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::destroyTestWindow()
|
2022-04-09 12:23:59 +00:00
|
|
|
{
|
2022-04-09 17:12:41 +00:00
|
|
|
m_surfaceConfigureRequestedSpy.reset();
|
|
|
|
m_toplevelConfigureRequestedSpy.reset();
|
|
|
|
m_shellSurface.reset();
|
|
|
|
m_surface.reset();
|
|
|
|
QVERIFY(Test::waitForWindowDestroyed(m_client));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2018-02-11 17:27:34 +00:00
|
|
|
|
2022-03-23 10:13:38 +00:00
|
|
|
template<typename T>
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::setWindowRule(const QString &property, const T &value, int policy)
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
|
|
|
// Initialize RuleBook with the test rule.
|
2021-12-10 09:17:43 +00:00
|
|
|
m_config->group("General").writeEntry("count", 1);
|
|
|
|
KConfigGroup group = m_config->group("1");
|
2021-09-02 22:19:43 +00:00
|
|
|
|
|
|
|
group.writeEntry(property, value);
|
|
|
|
group.writeEntry(QStringLiteral("%1rule").arg(property), policy);
|
|
|
|
|
2019-07-09 17:28:05 +00:00
|
|
|
group.writeEntry("wmclass", "org.kde.foo");
|
|
|
|
group.writeEntry("wmclasscomplete", false);
|
|
|
|
group.writeEntry("wmclassmatch", int(Rules::ExactMatch));
|
|
|
|
group.sync();
|
2021-09-02 22:19:43 +00:00
|
|
|
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotReconfigure();
|
2021-09-02 22:19:43 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testPositionDontAffect()
|
2021-09-02 22:19:43 +00:00
|
|
|
{
|
|
|
|
setWindowRule("position", QPoint(42, 42), int(Rules::DontAffect));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The position of the client should not be affected by the rule. The default
|
|
|
|
// placement policy will put the client in the top-left corner of the screen.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMovable());
|
|
|
|
QVERIFY(m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(0, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testPositionApply()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("position", QPoint(42, 42), int(Rules::Apply));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The client should be moved to the position specified by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMovable());
|
|
|
|
QVERIFY(m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// One should still be able to move the client around.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStepUserMovedResizedSpy(m_client, &Window::clientStepUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStepUserMovedResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientFinishUserMovedResizedSpy(m_client, &Window::clientFinishUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
|
|
|
|
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeClient(), m_client);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2020-04-02 16:18:01 +00:00
|
|
|
const QPoint cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_client->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
|
2020-04-02 16:18:01 +00:00
|
|
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Enter);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1);
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The rule should be applied again if the client appears after it's been closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMovable());
|
|
|
|
QVERIFY(m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testPositionRemember()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("position", QPoint(42, 42), int(Rules::Remember));
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The client should be moved to the position specified by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMovable());
|
|
|
|
QVERIFY(m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// One should still be able to move the client around.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStepUserMovedResizedSpy(m_client, &Window::clientStepUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStepUserMovedResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientFinishUserMovedResizedSpy(m_client, &Window::clientFinishUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
|
|
|
|
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeClient(), m_client);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2020-04-02 16:18:01 +00:00
|
|
|
const QPoint cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_client->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
|
2020-04-02 16:18:01 +00:00
|
|
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Enter);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1);
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The client should be placed at the last know position if we reopen it.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMovable());
|
|
|
|
QVERIFY(m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testPositionForce()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("position", QPoint(42, 42), int(Rules::Force));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The client should be moved to the position specified by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMovable());
|
|
|
|
QVERIFY(!m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// User should not be able to move the client.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 0);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The position should still be forced if we reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMovable());
|
|
|
|
QVERIFY(!m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testPositionApplyNow()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The position of the client isn't set by any rule, thus the default placement
|
|
|
|
// policy will try to put the client in the top-left corner of the screen.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMovable());
|
|
|
|
QVERIFY(m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(0, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_client, &Window::frameGeometryChanged);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.isValid());
|
2021-09-02 22:19:43 +00:00
|
|
|
|
|
|
|
setWindowRule("position", QPoint(42, 42), int(Rules::ApplyNow));
|
|
|
|
|
|
|
|
// The client should be moved to the position specified by the rule.
|
2020-02-05 09:28:50 +00:00
|
|
|
QCOMPARE(frameGeometryChangedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// We still have to be able to move the client around.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMovable());
|
|
|
|
QVERIFY(m_client->isMovableAcrossScreens());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStepUserMovedResizedSpy(m_client, &Window::clientStepUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStepUserMovedResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientFinishUserMovedResizedSpy(m_client, &Window::clientFinishUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
|
|
|
|
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeClient(), m_client);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2020-04-02 16:18:01 +00:00
|
|
|
const QPoint cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_client->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
|
2020-04-02 16:18:01 +00:00
|
|
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Enter);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1);
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testPositionForceTemporarily()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("position", QPoint(42, 42), int(Rules::ForceTemporarily));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The client should be moved to the position specified by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMovable());
|
|
|
|
QVERIFY(!m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// User should not be able to move the client.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 0);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The rule should be discarded if we close the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMovable());
|
|
|
|
QVERIFY(m_client->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_client->pos(), QPoint(0, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSizeDontAffect()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("size", QSize(480, 640), int(Rules::DontAffect));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The window size shouldn't be enforced by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(0, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSizeApply()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("size", QSize(480, 640), int(Rules::Apply));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The initial configure event should contain size hint set by the rule.
|
2021-05-11 05:26:51 +00:00
|
|
|
Test::XdgToplevel::States states;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(480, 640));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Resizing));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Resizing));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// One still should be able to resize the client.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_client, &Window::frameGeometryChanged);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStepUserMovedResizedSpy(m_client, &Window::clientStepUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStepUserMovedResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientFinishUserMovedResizedSpy(m_client, &Window::clientFinishUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
|
|
|
|
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowResize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeClient(), m_client);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(m_client->isInteractiveResize());
|
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Resizing));
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2020-04-02 16:18:01 +00:00
|
|
|
const QPoint cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_client->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
|
2020-04-02 16:18:01 +00:00
|
|
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 4);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 4);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Resizing));
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(488, 640));
|
2021-12-24 09:20:00 +00:00
|
|
|
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
|
|
|
Test::render(m_surface.data(), QSize(488, 640), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->size(), QSize(488, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Enter);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1);
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 5);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 5);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The rule should be applied again if the client appears after it's been closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSizeRemember()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("size", QSize(480, 640), int(Rules::Remember));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The initial configure event should contain size hint set by the rule.
|
2021-05-11 05:26:51 +00:00
|
|
|
Test::XdgToplevel::States states;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Resizing));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Resizing));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// One should still be able to resize the client.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_client, &Window::frameGeometryChanged);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStepUserMovedResizedSpy(m_client, &Window::clientStepUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStepUserMovedResizedSpy.isValid());
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientFinishUserMovedResizedSpy(m_client, &Window::clientFinishUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientFinishUserMovedResizedSpy.isValid());
|
|
|
|
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowResize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeClient(), m_client);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(m_client->isInteractiveResize());
|
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Resizing));
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2020-04-02 16:18:01 +00:00
|
|
|
const QPoint cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_client->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
|
2020-04-02 16:18:01 +00:00
|
|
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 4);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 4);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Resizing));
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(488, 640));
|
2021-12-24 09:20:00 +00:00
|
|
|
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
|
|
|
Test::render(m_surface.data(), QSize(488, 640), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->size(), QSize(488, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientStepUserMovedResizedSpy.count(), 1);
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->keyPressEvent(Qt::Key_Enter);
|
2019-07-09 17:28:05 +00:00
|
|
|
QCOMPARE(clientFinishUserMovedResizedSpy.count(), 1);
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 5);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 5);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// If the client appears again, it should have the last known size.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(488, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(488, 640));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(488, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSizeForce()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("size", QSize(480, 640), int(Rules::Force));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The initial configure event should contain size hint set by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Any attempt to resize the client should not succeed.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowResize();
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 0);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// If the client appears again, the size should still be forced.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSizeApplyNow()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The expected surface dimensions should be set by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(0, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("size", QSize(480, 640), int(Rules::ApplyNow));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The compositor should send a configure event with a new size.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Draw the surface with the new size.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_client, &Window::frameGeometryChanged);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.isValid());
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
|
|
|
Test::render(m_surface.data(), QSize(480, 640), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->size(), QSize(480, 640));
|
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSizeForceTemporarily()
|
2019-07-09 17:28:05 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("size", QSize(480, 640), int(Rules::ForceTemporarily));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The initial configure event should contain size hint set by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// Any attempt to resize the client should not succeed.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientStartMoveResizedSpy(m_client, &Window::clientStartUserMovedResized);
|
2019-07-09 17:28:05 +00:00
|
|
|
QVERIFY(clientStartMoveResizedSpy.isValid());
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowResize();
|
|
|
|
QCOMPARE(workspace()->moveResizeClient(), nullptr);
|
|
|
|
QCOMPARE(clientStartMoveResizedSpy.count(), 0);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isInteractiveMove());
|
|
|
|
QVERIFY(!m_client->isInteractiveResize());
|
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().first().toSize(), QSize(0, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isResizable());
|
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 17:28:05 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMaximizeDontAffect()
|
2019-07-09 18:07:21 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("maximizehoriz", true, int(Rules::DontAffect));
|
|
|
|
setWindowRule("maximizevert", true, int(Rules::DontAffect));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Wait for the initial configure event.
|
2021-05-11 05:26:51 +00:00
|
|
|
Test::XdgToplevel::States states;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 18:07:21 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMaximizeApply()
|
2019-07-09 18:07:21 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("maximizehoriz", true, int(Rules::Apply));
|
|
|
|
setWindowRule("maximizevert", true, int(Rules::Apply));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Wait for the initial configure event.
|
2021-05-11 05:26:51 +00:00
|
|
|
Test::XdgToplevel::States states;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// One should still be able to change the maximized state of the client.
|
|
|
|
workspace()->slotWindowMaximize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_client, &Window::frameGeometryChanged);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.isValid());
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
|
|
|
Test::render(m_surface.data(), QSize(100, 50), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// If we create the client again, it should be initially maximized.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->size(), QSize(1280, 1024));
|
|
|
|
|
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 18:07:21 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMaximizeRemember()
|
2019-07-09 18:07:21 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("maximizehoriz", true, int(Rules::Remember));
|
|
|
|
setWindowRule("maximizevert", true, int(Rules::Remember));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Wait for the initial configure event.
|
2021-05-11 05:26:51 +00:00
|
|
|
Test::XdgToplevel::States states;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// One should still be able to change the maximized state of the client.
|
|
|
|
workspace()->slotWindowMaximize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_client, &Window::frameGeometryChanged);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.isValid());
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
|
|
|
Test::render(m_surface.data(), QSize(100, 50), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// If we create the client again, it should not be maximized (because last time it wasn't).
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 18:07:21 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMaximizeForce()
|
2019-07-09 18:07:21 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("maximizehoriz", true, int(Rules::Force));
|
|
|
|
setWindowRule("maximizevert", true, int(Rules::Force));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Wait for the initial configure event.
|
2021-05-11 05:26:51 +00:00
|
|
|
Test::XdgToplevel::States states;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Any attempt to change the maximized state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
const QRect oldGeometry = m_client->frameGeometry();
|
2019-07-09 18:07:21 +00:00
|
|
|
workspace()->slotWindowMaximize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->frameGeometry(), oldGeometry);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// If we create the client again, the maximized state should still be forced.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 18:07:21 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMaximizeApplyNow()
|
2019-07-09 18:07:21 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Wait for the initial configure event.
|
2021-05-11 05:26:51 +00:00
|
|
|
Test::XdgToplevel::States states;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("maximizehoriz", true, int(Rules::ApplyNow));
|
|
|
|
setWindowRule("maximizevert", true, int(Rules::ApplyNow));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// We should receive a configure event with a new surface size.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 3);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Draw contents of the maximized client.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_client, &Window::frameGeometryChanged);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.isValid());
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
|
|
|
Test::render(m_surface.data(), QSize(1280, 1024), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->size(), QSize(1280, 1024));
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// The client still has to be maximizeable.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMaximizable());
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Restore the client.
|
|
|
|
workspace()->slotWindowMaximize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 4);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 4);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(100, 50));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
|
|
|
Test::render(m_surface.data(), QSize(100, 50), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// The rule should be discarded after it's been applied.
|
2022-04-09 17:12:41 +00:00
|
|
|
const QRect oldGeometry = m_client->frameGeometry();
|
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->frameGeometry(), oldGeometry);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 18:07:21 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMaximizeForceTemporarily()
|
2019-07-09 18:07:21 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("maximizehoriz", true, int(Rules::ForceTemporarily));
|
|
|
|
setWindowRule("maximizevert", true, int(Rules::ForceTemporarily));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Wait for the initial configure event.
|
2021-05-11 05:26:51 +00:00
|
|
|
Test::XdgToplevel::States states;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(1280, 1024));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Map the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// We should receive a configure event when the client becomes active.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// Any attempt to change the maximized state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
const QRect oldGeometry = m_client->frameGeometry();
|
2019-07-09 18:07:21 +00:00
|
|
|
workspace()->slotWindowMaximize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_client->frameGeometry(), oldGeometry);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// The rule should be discarded if we close the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ReturnAfterSurfaceConfiguration);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 1);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->last().at(0).toSize(), QSize(0, 0));
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMaximizable());
|
|
|
|
QCOMPARE(m_client->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_client->size(), QSize(100, 50));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy->wait());
|
|
|
|
QCOMPARE(m_surfaceConfigureRequestedSpy->count(), 2);
|
|
|
|
QCOMPARE(m_toplevelConfigureRequestedSpy->count(), 2);
|
|
|
|
states = m_toplevelConfigureRequestedSpy->last().at(1).value<Test::XdgToplevel::States>();
|
2021-05-11 05:26:51 +00:00
|
|
|
QVERIFY(states.testFlag(Test::XdgToplevel::State::Activated));
|
|
|
|
QVERIFY(!states.testFlag(Test::XdgToplevel::State::Maximized));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2019-07-09 18:07:21 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopsDontAffect()
|
2017-10-07 12:09:07 +00:00
|
|
|
{
|
2021-08-13 19:49:10 +00:00
|
|
|
// We need at least two virtual desktop for this test.
|
|
|
|
VirtualDesktopManager::self()->setCount(2);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
|
|
|
|
VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
|
2021-08-13 19:49:10 +00:00
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
|
|
|
|
|
|
|
setWindowRule("desktops", QStringList{vd2->id()}, int(Rules::DontAffect));
|
2017-10-07 12:09:07 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should appear on the current virtual desktop.
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2017-10-07 12:09:07 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopsApply()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-08-13 19:49:10 +00:00
|
|
|
// We need at least two virtual desktop for this test.
|
|
|
|
VirtualDesktopManager::self()->setCount(2);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
|
|
|
|
VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
|
|
|
|
|
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
2021-08-13 19:49:10 +00:00
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
setWindowRule("desktops", QStringList{vd2->id()}, int(Rules::Apply));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should appear on the second virtual desktop.
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// We still should be able to move the client between desktops.
|
2022-04-08 19:25:02 +00:00
|
|
|
m_client->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we re-open the client, it should appear on the second virtual desktop again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-08 19:25:02 +00:00
|
|
|
|
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2017-10-07 15:57:10 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopsRemember()
|
2017-10-07 15:57:10 +00:00
|
|
|
{
|
2021-08-13 19:49:10 +00:00
|
|
|
// We need at least two virtual desktop for this test.
|
|
|
|
VirtualDesktopManager::self()->setCount(2);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
|
|
|
|
VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
|
2021-08-13 19:49:10 +00:00
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
|
|
|
|
|
|
|
setWindowRule("desktops", QStringList{vd2->id()}, int(Rules::Remember));
|
2017-10-07 15:57:10 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Move the client to the first virtual desktop.
|
2022-04-08 19:25:02 +00:00
|
|
|
m_client->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we create the client again, it should appear on the first virtual desktop.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2017-10-07 15:57:10 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopsForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-08-13 19:49:10 +00:00
|
|
|
// We need at least two virtual desktop for this test.
|
|
|
|
VirtualDesktopManager::self()->setCount(2);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
|
|
|
|
VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
|
|
|
|
|
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
2021-08-13 19:49:10 +00:00
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
setWindowRule("desktops", QStringList{vd2->id()}, int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should appear on the second virtual desktop.
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
|
|
|
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
// Any attempt to move the client to another virtual desktop should fail.
|
2022-04-08 19:25:02 +00:00
|
|
|
m_client->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we re-open the client, it should appear on the second virtual desktop again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2018-01-13 18:58:43 +00:00
|
|
|
}
|
2017-10-07 15:57:10 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopsApplyNow()
|
2018-01-13 18:58:43 +00:00
|
|
|
{
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
// We need at least two virtual desktop for this test.
|
|
|
|
VirtualDesktopManager::self()->setCount(2);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
|
|
|
|
VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
|
|
|
|
|
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
2018-01-13 18:58:43 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
|
|
|
|
|
|
|
setWindowRule("desktops", QStringList{vd2->id()}, int(Rules::ApplyNow));
|
2018-01-13 18:58:43 +00:00
|
|
|
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
// The client should have been moved to the second virtual desktop.
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// One should still be able to move the client between desktops.
|
2022-04-08 19:25:02 +00:00
|
|
|
m_client->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2017-10-07 15:57:10 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopsForceTemporarily()
|
2017-10-07 15:57:10 +00:00
|
|
|
{
|
2021-08-13 19:49:10 +00:00
|
|
|
// We need at least two virtual desktop for this test.
|
|
|
|
VirtualDesktopManager::self()->setCount(2);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->count(), 2u);
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktop *vd1 = VirtualDesktopManager::self()->desktops().at(0);
|
|
|
|
VirtualDesktop *vd2 = VirtualDesktopManager::self()->desktops().at(1);
|
2021-08-13 19:49:10 +00:00
|
|
|
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
|
|
|
|
|
|
|
setWindowRule("desktops", QStringList{vd2->id()}, int(Rules::ForceTemporarily));
|
2018-01-13 18:58:43 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should appear on the second virtual desktop.
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to move the client to another virtual desktop should fail.
|
2022-04-08 19:25:02 +00:00
|
|
|
m_client->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is withdrawn.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-04-08 19:25:02 +00:00
|
|
|
VirtualDesktopManager::self()->setCurrent(vd1);
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-08 19:25:02 +00:00
|
|
|
|
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// One should be able to move the client between desktops.
|
2022-04-08 19:25:02 +00:00
|
|
|
m_client->setDesktops({vd2});
|
|
|
|
QCOMPARE(m_client->desktops(), {vd2});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
|
|
|
|
|
|
|
m_client->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_client->desktops(), {vd1});
|
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2018-01-13 18:58:43 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMinimizeDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("minimize", true, int(Rules::DontAffect));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimizable());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be minimized.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2018-01-13 18:58:43 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMinimizeApply()
|
2018-01-13 18:58:43 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("minimize", true, int(Rules::Apply));
|
2022-04-09 12:23:59 +00:00
|
|
|
|
|
|
|
createTestWindow(ClientShouldBeInactive);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimizable());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be minimized.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// We should still be able to unminimize the client.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->unminimize();
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we re-open the client, it should be minimized back again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ClientShouldBeInactive);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimizable());
|
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2017-10-07 15:57:10 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMinimizeRemember()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("minimize", false, int(Rules::Remember));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimizable());
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Minimize the client.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we open the client again, it should be minimized.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ClientShouldBeInactive);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimizable());
|
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2018-01-14 08:45:02 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMinimizeForce()
|
2018-01-14 08:45:02 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("minimize", false, int(Rules::Force));
|
2018-01-14 08:45:02 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimizable());
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to minimize the client should fail.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we re-open the client, the minimized state should still be forced.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimizable());
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2018-01-14 08:45:02 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMinimizeApplyNow()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimizable());
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("minimize", true, int(Rules::ApplyNow));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be minimized now.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimizable());
|
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// One is still able to unminimize the client.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->unminimize();
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(m_client->isMinimizable());
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2018-01-14 08:45:02 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMinimizeForceTemporarily()
|
2018-01-14 08:45:02 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("minimize", false, int(Rules::ForceTemporarily));
|
2018-01-14 08:45:02 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimizable());
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to minimize the client should fail until the client is closed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimizable());
|
|
|
|
QVERIFY(!m_client->isMinimized());
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2018-01-14 13:51:37 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipTaskbarDontAffect()
|
2018-01-14 13:51:37 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skiptaskbar", true, int(Rules::DontAffect));
|
2018-01-14 13:51:37 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2018-01-14 13:51:37 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipTaskbarApply()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skiptaskbar", true, int(Rules::Apply));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be included on a taskbar.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Though one can change that.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(!m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client, the rule should be applied again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2017-10-07 12:09:07 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipTaskbarRemember()
|
2018-03-11 16:13:32 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skiptaskbar", true, int(Rules::Remember));
|
2018-03-11 16:13:32 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be included on a taskbar.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Change the skip-taskbar state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(!m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be included on a taskbar.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2018-03-11 16:13:32 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipTaskbarForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skiptaskbar", true, int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be included on a taskbar.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to change the skip-taskbar state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The skip-taskbar state should be still forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2018-03-11 16:13:32 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipTaskbarApplyNow()
|
2018-02-11 17:27:34 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skiptaskbar", true, int(Rules::ApplyNow));
|
2018-02-11 17:27:34 +00:00
|
|
|
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
// The client should not be on a taskbar now.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Also, one change the skip-taskbar state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(!m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipTaskbarForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skiptaskbar", true, int(Rules::ForceTemporarily));
|
2018-02-11 17:27:34 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be included on a taskbar.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to change the skip-taskbar state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The skip-taskbar state is no longer forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setOriginalSkipTaskbar(true);
|
|
|
|
QVERIFY(m_client->skipTaskbar());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipPagerDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skippager", true, int(Rules::DontAffect));
|
2018-02-11 17:27:34 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2018-02-11 17:27:34 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipPagerApply()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skippager", true, int(Rules::Apply));
|
2018-02-11 17:27:34 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be included on a pager.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Though one can change that.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipPager(false);
|
|
|
|
QVERIFY(!m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client, the rule should be applied again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
2018-02-11 17:27:34 +00:00
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipPagerRemember()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skippager", true, int(Rules::Remember));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be included on a pager.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Change the skip-pager state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipPager(false);
|
|
|
|
QVERIFY(!m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be included on a pager.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipPagerForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skippager", true, int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be included on a pager.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to change the skip-pager state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipPager(false);
|
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The skip-pager state should be still forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipPagerApplyNow()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skippager", true, int(Rules::ApplyNow));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be on a pager now.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Also, one change the skip-pager state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipPager(false);
|
|
|
|
QVERIFY(!m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipPagerForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skippager", true, int(Rules::ForceTemporarily));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be included on a pager.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to change the skip-pager state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipPager(false);
|
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The skip-pager state is no longer forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipPager(true);
|
|
|
|
QVERIFY(m_client->skipPager());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipSwitcherDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skipswitcher", true, int(Rules::DontAffect));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipSwitcherApply()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skipswitcher", true, int(Rules::Apply));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be excluded from window switching effects.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Though one can change that.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipSwitcher(false);
|
|
|
|
QVERIFY(!m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client, the rule should be applied again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipSwitcherRemember()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skipswitcher", true, int(Rules::Remember));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be excluded from window switching effects.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Change the skip-switcher state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipSwitcher(false);
|
|
|
|
QVERIFY(!m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be included in window switching effects.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipSwitcherForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skipswitcher", true, int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be excluded from window switching effects.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to change the skip-switcher state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipSwitcher(false);
|
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The skip-switcher state should be still forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipSwitcherApplyNow()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skipswitcher", true, int(Rules::ApplyNow));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be excluded from window switching effects now.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Also, one change the skip-switcher state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipSwitcher(false);
|
|
|
|
QVERIFY(!m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testSkipSwitcherForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("skipswitcher", true, int(Rules::ForceTemporarily));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should be excluded from window switching effects.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to change the skip-switcher state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipSwitcher(false);
|
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The skip-switcher state is no longer forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setSkipSwitcher(true);
|
|
|
|
QVERIFY(m_client->skipSwitcher());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepAboveDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("above", true, int(Rules::DontAffect));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The keep-above state of the client should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepAboveApply()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("above", true, int(Rules::Apply));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Initially, the client should be kept above.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// One should also be able to alter the keep-above state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepAbove(false);
|
|
|
|
QVERIFY(!m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If one re-opens the client, it should be kept above back again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepAboveRemember()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("above", true, int(Rules::Remember));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Initially, the client should be kept above.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Unset the keep-above state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepAbove(false);
|
|
|
|
QVERIFY(!m_client->keepAbove());
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Re-open the client, it should not be kept above.
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepAboveForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("above", true, int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Initially, the client should be kept above.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attemt to unset the keep-above should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepAbove(false);
|
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we re-open the client, it should still be kept above.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepAboveApplyNow()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("above", true, int(Rules::ApplyNow));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should now be kept above other clients.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// One is still able to change the keep-above state of the client.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepAbove(false);
|
|
|
|
QVERIFY(!m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepAboveForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("above", true, int(Rules::ForceTemporarily));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Initially, the client should be kept above.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to alter the keep-above state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepAbove(false);
|
|
|
|
QVERIFY(m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The keep-above state is no longer forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepAbove(true);
|
|
|
|
QVERIFY(m_client->keepAbove());
|
|
|
|
m_client->setKeepAbove(false);
|
|
|
|
QVERIFY(!m_client->keepAbove());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepBelowDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("below", true, int(Rules::DontAffect));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The keep-below state of the client should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepBelowApply()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("below", true, int(Rules::Apply));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Initially, the client should be kept below.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// One should also be able to alter the keep-below state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepBelow(false);
|
|
|
|
QVERIFY(!m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If one re-opens the client, it should be kept above back again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepBelowRemember()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("below", true, int(Rules::Remember));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Initially, the client should be kept below.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Unset the keep-below state.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepBelow(false);
|
|
|
|
QVERIFY(!m_client->keepBelow());
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Re-open the client, it should not be kept below.
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepBelowForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("below", true, int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Initially, the client should be kept below.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attemt to unset the keep-below should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepBelow(false);
|
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we re-open the client, it should still be kept below.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepBelowApplyNow()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("below", true, int(Rules::ApplyNow));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should now be kept below other clients.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// One is still able to change the keep-below state of the client.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepBelow(false);
|
|
|
|
QVERIFY(!m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testKeepBelowForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("below", true, int(Rules::ForceTemporarily));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Initially, the client should be kept below.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to alter the keep-below state should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepBelow(false);
|
|
|
|
QVERIFY(m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The keep-below state is no longer forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setKeepBelow(true);
|
|
|
|
QVERIFY(m_client->keepBelow());
|
|
|
|
m_client->setKeepBelow(false);
|
|
|
|
QVERIFY(!m_client->keepBelow());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testShortcutDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::DontAffect));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), QKeySequence());
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we press the window shortcut, nothing should happen.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientUnminimizedSpy(m_client, &Window::clientUnminimized);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.isValid());
|
|
|
|
quint32 timestamp = 1;
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(!clientUnminimizedSpy.wait(100));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testShortcutApply()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::Apply));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we press the window shortcut, the window should be brought back to user.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientUnminimizedSpy(m_client, &Window::clientUnminimized);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.isValid());
|
|
|
|
quint32 timestamp = 1;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// One can also change the shortcut.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The old shortcut should do nothing.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(!clientUnminimizedSpy.wait(100));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The window shortcut should be set back to Ctrl+Alt+1.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testShortcutRemember()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
QSKIP("KWin core doesn't try to save the last used window shortcut");
|
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::Remember));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we press the window shortcut, the window should be brought back to user.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientUnminimizedSpy(m_client, &Window::clientUnminimized);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.isValid());
|
|
|
|
quint32 timestamp = 1;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Change the window shortcut to Ctrl+Alt+2.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The window shortcut should be set to the last known value.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testShortcutForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
QSKIP("KWin core can't release forced window shortcuts");
|
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we press the window shortcut, the window should be brought back to user.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientUnminimizedSpy(m_client, &Window::clientUnminimized);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.isValid());
|
|
|
|
quint32 timestamp = 1;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to change the window shortcut should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(!clientUnminimizedSpy.wait(100));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The window shortcut should still be forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testShortcutApplyNow()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->shortcut().isEmpty());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::ApplyNow));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The client should now have a window shortcut assigned.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientUnminimizedSpy(m_client, &Window::clientUnminimized);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.isValid());
|
|
|
|
quint32 timestamp = 1;
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Assign a different shortcut.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testShortcutForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
QSKIP("KWin core can't release forced window shortcuts");
|
|
|
|
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::ForceTemporarily));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// If we press the window shortcut, the window should be brought back to user.
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy clientUnminimizedSpy(m_client, &Window::clientUnminimized);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.isValid());
|
|
|
|
quint32 timestamp = 1;
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_1, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(clientUnminimizedSpy.wait());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Any attempt to change the window shortcut should not succeed.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_client->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
|
|
|
m_client->minimize();
|
|
|
|
QVERIFY(m_client->isMinimized());
|
2022-03-10 10:27:35 +00:00
|
|
|
Test::keyboardKeyPressed(KEY_LEFTCTRL, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyPressed(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_2, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTALT, timestamp++);
|
|
|
|
Test::keyboardKeyReleased(KEY_LEFTCTRL, timestamp++);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
QVERIFY(!clientUnminimizedSpy.wait(100));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isMinimized());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->shortcut().isEmpty());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopFileDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
// Currently, the desktop file name is derived from the app id. If the app id is
|
|
|
|
// changed, then the old rules will be lost. Either setDesktopFileName should
|
|
|
|
// be exposed or the desktop file name rule should be removed for wayland clients.
|
|
|
|
QSKIP("Needs changes in KWin core to pass");
|
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopFileApply()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
// Currently, the desktop file name is derived from the app id. If the app id is
|
|
|
|
// changed, then the old rules will be lost. Either setDesktopFileName should
|
|
|
|
// be exposed or the desktop file name rule should be removed for wayland clients.
|
|
|
|
QSKIP("Needs changes in KWin core to pass");
|
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopFileRemember()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
// Currently, the desktop file name is derived from the app id. If the app id is
|
|
|
|
// changed, then the old rules will be lost. Either setDesktopFileName should
|
|
|
|
// be exposed or the desktop file name rule should be removed for wayland clients.
|
|
|
|
QSKIP("Needs changes in KWin core to pass");
|
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopFileForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
// Currently, the desktop file name is derived from the app id. If the app id is
|
|
|
|
// changed, then the old rules will be lost. Either setDesktopFileName should
|
|
|
|
// be exposed or the desktop file name rule should be removed for wayland clients.
|
|
|
|
QSKIP("Needs changes in KWin core to pass");
|
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopFileApplyNow()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
// Currently, the desktop file name is derived from the app id. If the app id is
|
|
|
|
// changed, then the old rules will be lost. Either setDesktopFileName should
|
|
|
|
// be exposed or the desktop file name rule should be removed for wayland clients.
|
|
|
|
QSKIP("Needs changes in KWin core to pass");
|
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testDesktopFileForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
|
|
|
// Currently, the desktop file name is derived from the app id. If the app id is
|
|
|
|
// changed, then the old rules will be lost. Either setDesktopFileName should
|
|
|
|
// be exposed or the desktop file name rule should be removed for wayland clients.
|
|
|
|
QSKIP("Needs changes in KWin core to pass");
|
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testActiveOpacityDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("opacityactive", 90, int(Rules::DontAffect));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The opacity should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->opacity(), 1.0);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testActiveOpacityForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("opacityactive", 90, int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
|
|
|
QCOMPARE(m_client->opacity(), 0.9);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testActiveOpacityForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("opacityactive", 90, int(Rules::ForceTemporarily));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
|
|
|
QCOMPARE(m_client->opacity(), 0.9);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
|
|
|
QCOMPARE(m_client->opacity(), 1.0);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testInactiveOpacityDontAffect()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("opacityinactive", 80, int(Rules::DontAffect));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Make the client inactive.
|
|
|
|
workspace()->setActiveClient(nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isActive());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The opacity of the client should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->opacity(), 1.0);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testInactiveOpacityForce()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("opacityinactive", 80, int(Rules::Force));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
|
|
|
QCOMPARE(m_client->opacity(), 1.0);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Make the client inactive.
|
|
|
|
workspace()->setActiveClient(nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isActive());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The opacity should be forced by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->opacity(), 0.8);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testInactiveOpacityForceTemporarily()
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("opacityinactive", 80, int(Rules::ForceTemporarily));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
|
|
|
QCOMPARE(m_client->opacity(), 1.0);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// Make the client inactive.
|
|
|
|
workspace()->setActiveClient(nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isActive());
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The opacity should be forced by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->opacity(), 0.8);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
|
|
|
QCOMPARE(m_client->opacity(), 1.0);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
workspace()->setActiveClient(nullptr);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->isActive());
|
|
|
|
QCOMPARE(m_client->opacity(), 1.0);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2018-02-11 17:27:34 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testNoBorderDontAffect()
|
2021-12-11 13:29:35 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("noborder", true, int(Rules::DontAffect));
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ServerSideDecoration);
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The client should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2021-12-11 13:29:35 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testNoBorderApply()
|
2021-12-11 13:29:35 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("noborder", true, int(Rules::Apply));
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ServerSideDecoration);
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// Initially, the client should not be decorated.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->noBorder());
|
|
|
|
QVERIFY(!m_client->isDecorated());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// But you should be able to change "no border" property afterwards.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->userCanSetNoBorder());
|
|
|
|
m_client->setNoBorder(false);
|
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// If one re-opens the client, it should have no border again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ServerSideDecoration);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2021-12-11 13:29:35 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testNoBorderRemember()
|
2021-12-11 13:29:35 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("noborder", true, int(Rules::Remember));
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ServerSideDecoration);
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// Initially, the client should not be decorated.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->noBorder());
|
|
|
|
QVERIFY(!m_client->isDecorated());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// Unset the "no border" property.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->userCanSetNoBorder());
|
|
|
|
m_client->setNoBorder(false);
|
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// Re-open the client, it should be decorated.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ServerSideDecoration);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isDecorated());
|
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2021-12-11 13:29:35 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testNoBorderForce()
|
2021-12-11 13:29:35 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("noborder", true, int(Rules::Force));
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ServerSideDecoration);
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The client should not be decorated.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->noBorder());
|
|
|
|
QVERIFY(!m_client->isDecorated());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// And the user should not be able to change the "no border" property.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setNoBorder(false);
|
|
|
|
QVERIFY(m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// Reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ServerSideDecoration);
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The "no border" property should be still forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2021-12-11 13:29:35 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testNoBorderApplyNow()
|
2021-12-11 13:29:35 +00:00
|
|
|
{
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ServerSideDecoration);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// Initialize RuleBook with the test rule.
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("noborder", true, int(Rules::ApplyNow));
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The "no border" property should be set now.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// One should be still able to change the "no border" property.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setNoBorder(false);
|
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2021-12-11 13:29:35 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testNoBorderForceTemporarily()
|
2021-12-11 13:29:35 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("noborder", true, int(Rules::ForceTemporarily));
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow(ServerSideDecoration);
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The "no border" property should be set.
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// And you should not be able to change it.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setNoBorder(false);
|
|
|
|
QVERIFY(m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The rule should be discarded when the client is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ServerSideDecoration);
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The "no border" property is no longer forced.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->setNoBorder(true);
|
|
|
|
QVERIFY(m_client->noBorder());
|
|
|
|
m_client->setNoBorder(false);
|
|
|
|
QVERIFY(!m_client->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2021-12-11 13:29:35 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testScreenDontAffect()
|
2022-02-05 16:38:24 +00:00
|
|
|
{
|
|
|
|
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
|
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::DontAffect));
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// The client should not be affected by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// The user can still move the client to another screen.
|
2022-04-09 17:12:41 +00:00
|
|
|
workspace()->sendClientToOutput(m_client, outputs.at(1));
|
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testScreenApply()
|
2022-02-05 16:38:24 +00:00
|
|
|
{
|
|
|
|
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
|
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::Apply));
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// The client should be in the screen specified by the rule.
|
|
|
|
QEXPECT_FAIL("", "Applying a screen rule on a new client fails on Wayland", Continue);
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// The user can move the client to another screen.
|
2022-04-09 17:12:41 +00:00
|
|
|
workspace()->sendClientToOutput(m_client, outputs.at(0));
|
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testScreenRemember()
|
2022-02-05 16:38:24 +00:00
|
|
|
{
|
|
|
|
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
|
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::Remember));
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// Initially, the client should be in the first screen
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// Move the client to the second screen.
|
2022-04-09 17:12:41 +00:00
|
|
|
workspace()->sendClientToOutput(m_client, outputs.at(1));
|
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// Close and reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
QEXPECT_FAIL("", "Applying a screen rule on a new client fails on Wayland", Continue);
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testScreenForce()
|
2022-02-05 16:38:24 +00:00
|
|
|
{
|
|
|
|
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(m_client->isActive());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::Force));
|
|
|
|
|
|
|
|
// The client should be forced to the screen specified by the rule.
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// User should not be able to move the client to another screen.
|
2022-04-09 17:12:41 +00:00
|
|
|
workspace()->sendClientToOutput(m_client, outputs.at(0));
|
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// Disable the output where the window is on, so the client is moved the other screen
|
2022-04-14 10:51:20 +00:00
|
|
|
OutputConfiguration config;
|
2022-04-14 08:32:51 +00:00
|
|
|
auto changeSet = config.changeSet(outputs.at(1));
|
2022-02-05 16:38:24 +00:00
|
|
|
changeSet->enabled = false;
|
|
|
|
kwinApp()->platform()->applyOutputChanges(config);
|
|
|
|
|
|
|
|
QVERIFY(!outputs.at(1)->isEnabled());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// Enable the output and check that the client is moved there again
|
|
|
|
changeSet->enabled = true;
|
|
|
|
kwinApp()->platform()->applyOutputChanges(config);
|
|
|
|
|
|
|
|
QVERIFY(outputs.at(1)->isEnabled());
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// Close and reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
QEXPECT_FAIL("", "Applying a screen rule on a new client fails on Wayland", Continue);
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testScreenApplyNow()
|
2022-02-05 16:38:24 +00:00
|
|
|
{
|
|
|
|
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// Set the rule so the client should move to the screen specified by the rule.
|
|
|
|
setWindowRule("screen", int(1), int(Rules::ApplyNow));
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// The user can move the client to another screen.
|
2022-04-09 17:12:41 +00:00
|
|
|
workspace()->sendClientToOutput(m_client, outputs.at(0));
|
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-09 17:12:41 +00:00
|
|
|
m_client->evaluateWindowRules();
|
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testScreenForceTemporarily()
|
2022-02-05 16:38:24 +00:00
|
|
|
{
|
|
|
|
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::ForceTemporarily));
|
|
|
|
|
|
|
|
// The client should be forced the second screen
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// User is not allowed to move it
|
2022-04-09 17:12:41 +00:00
|
|
|
workspace()->sendClientToOutput(m_client, outputs.at(0));
|
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// Close and reopen the client.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// The rule should be discarded now
|
2022-04-09 17:12:41 +00:00
|
|
|
QCOMPARE(m_client->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
void TestXdgShellWindowRules::testMatchAfterNameChange()
|
2018-03-12 17:06:33 +00:00
|
|
|
{
|
2021-09-02 22:19:43 +00:00
|
|
|
setWindowRule("above", true, int(Rules::Force));
|
2018-03-12 17:06:33 +00:00
|
|
|
|
2021-09-03 17:54:03 +00:00
|
|
|
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
|
2021-05-11 05:26:51 +00:00
|
|
|
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data()));
|
2018-03-12 17:06:33 +00:00
|
|
|
|
|
|
|
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
|
|
|
|
QVERIFY(c);
|
|
|
|
QVERIFY(c->isActive());
|
|
|
|
QCOMPARE(c->keepAbove(), false);
|
|
|
|
|
2022-04-22 17:39:12 +00:00
|
|
|
QSignalSpy desktopFileNameSpy(c, &Window::desktopFileNameChanged);
|
2018-03-12 17:06:33 +00:00
|
|
|
QVERIFY(desktopFileNameSpy.isValid());
|
|
|
|
|
2021-05-11 05:26:51 +00:00
|
|
|
shellSurface->set_app_id(QStringLiteral("org.kde.foo"));
|
2018-03-12 17:06:33 +00:00
|
|
|
QVERIFY(desktopFileNameSpy.wait());
|
|
|
|
QCOMPARE(c->keepAbove(), true);
|
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
WAYLANDTEST_MAIN(TestXdgShellWindowRules)
|
|
|
|
#include "xdgshellwindow_rules_test.moc"
|