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
|
|
|
|
2022-08-29 07:55:49 +00:00
|
|
|
#include "core/output.h"
|
|
|
|
#include "core/outputconfiguration.h"
|
2019-07-09 17:28:05 +00:00
|
|
|
#include "cursor.h"
|
2017-10-07 12:09:07 +00:00
|
|
|
#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;
|
|
|
|
|
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,
|
2022-04-23 19:51:16 +00:00
|
|
|
ClientShouldBeInactive = 1 << 0, // Window should be inactive. Used on Minimize tests
|
2022-04-09 12:23:59 +00:00
|
|
|
ServerSideDecoration = 1 << 1, // Create window with server side decoration. Used on noBorder tests
|
2022-04-23 19:51:16 +00:00
|
|
|
ReturnAfterSurfaceConfiguration = 1 << 2, // Do not create the window now, but return after surface configuration.
|
2022-04-09 12:23:59 +00:00
|
|
|
};
|
2022-06-23 11:43:09 +00:00
|
|
|
Q_DECLARE_FLAGS(ClientFlags, ClientFlag)
|
2022-04-09 12:23:59 +00:00
|
|
|
|
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-23 19:51:16 +00:00
|
|
|
Window *m_window;
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<KWayland::Client::Surface> m_surface;
|
|
|
|
std::unique_ptr<Test::XdgToplevel> m_shellSurface;
|
2022-04-09 12:23:59 +00:00
|
|
|
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<QSignalSpy> m_toplevelConfigureRequestedSpy;
|
|
|
|
std::unique_ptr<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);
|
2020-12-09 13:06:15 +00:00
|
|
|
QVERIFY(waylandServer()->init(s_socketName));
|
2023-05-08 10:16:00 +00:00
|
|
|
Test::setOutputConfig({
|
|
|
|
QRect(0, 0, 1280, 1024),
|
|
|
|
QRect(1280, 0, 1280, 1024),
|
|
|
|
});
|
2017-10-07 12:09:07 +00:00
|
|
|
|
|
|
|
kwinApp()->start();
|
2020-07-07 09:32:29 +00:00
|
|
|
QVERIFY(applicationStartedSpy.wait());
|
2022-07-11 10:41:15 +00:00
|
|
|
const auto outputs = workspace()->outputs();
|
2021-08-31 07:03:05 +00:00
|
|
|
QCOMPARE(outputs.count(), 2);
|
|
|
|
QCOMPARE(outputs[0]->geometry(), QRect(0, 0, 1280, 1024));
|
|
|
|
QCOMPARE(outputs[1]->geometry(), QRect(1280, 0, 1280, 1024));
|
2021-12-10 09:17:43 +00:00
|
|
|
|
|
|
|
m_config = KSharedConfig::openConfig(QStringLiteral("kwinrulesrc"), KConfig::SimpleConfig);
|
2022-07-30 22:40:49 +00:00
|
|
|
workspace()->rulebook()->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-08-01 21:29:02 +00:00
|
|
|
if (m_shellSurface) {
|
2022-04-11 11:06:29 +00:00
|
|
|
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-08-16 11:43:33 +00:00
|
|
|
m_surface = Test::createSurface();
|
2022-08-01 21:29:02 +00:00
|
|
|
m_shellSurface.reset(Test::createXdgToplevelSurface(m_surface.get(), Test::CreationSetup::CreateOnly, m_surface.get()));
|
|
|
|
Test::XdgToplevelDecorationV1 *decoration = Test::createXdgToplevelDecorationV1(m_shellSurface.get(), m_shellSurface.get());
|
2022-04-09 12:23:59 +00:00
|
|
|
|
|
|
|
// Add signal watchers
|
2023-08-10 16:53:37 +00:00
|
|
|
m_toplevelConfigureRequestedSpy = std::make_unique<QSignalSpy>(m_shellSurface.get(), &Test::XdgToplevel::configureRequested);
|
|
|
|
m_surfaceConfigureRequestedSpy = std::make_unique<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-08-01 21:29:02 +00:00
|
|
|
QVERIFY(m_surface != nullptr);
|
|
|
|
QVERIFY(m_shellSurface != nullptr);
|
|
|
|
QVERIFY(m_surfaceConfigureRequestedSpy != nullptr);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed 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-23 19:51:16 +00:00
|
|
|
// Create the window
|
2022-08-01 21:29:02 +00:00
|
|
|
m_window = Test::renderAndWaitForShown(m_surface.get(), clientSize, Qt::blue);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window);
|
|
|
|
QCOMPARE(m_window->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();
|
2023-04-21 20:28:48 +00:00
|
|
|
QVERIFY(Test::waitForWindowClosed(m_window));
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed 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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The position of the window should not be affected by the rule. The default
|
|
|
|
// placement policy will put the window in the top-left corner of the screen.
|
|
|
|
QVERIFY(m_window->isMovable());
|
|
|
|
QVERIFY(m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be moved to the position specified by the rule.
|
|
|
|
QVERIFY(m_window->isMovable());
|
|
|
|
QVERIFY(m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// One should still be able to move the window around.
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
|
|
|
QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
|
|
|
|
QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), m_window);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2023-02-19 23:35:44 +00:00
|
|
|
const QPointF cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_window->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
|
2020-04-02 16:18:01 +00:00
|
|
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Enter);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
|
|
|
QCOMPARE(m_window->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The rule should be applied again if the window appears after it's been closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMovable());
|
|
|
|
QVERIFY(m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be moved to the position specified by the rule.
|
|
|
|
QVERIFY(m_window->isMovable());
|
|
|
|
QVERIFY(m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// One should still be able to move the window around.
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
|
|
|
QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
|
|
|
|
QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), m_window);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2023-02-19 23:35:44 +00:00
|
|
|
const QPointF cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_window->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
|
2020-04-02 16:18:01 +00:00
|
|
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Enter);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
|
|
|
QCOMPARE(m_window->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be placed at the last know position if we reopen it.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMovable());
|
|
|
|
QVERIFY(m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be moved to the position specified by the rule.
|
|
|
|
QVERIFY(!m_window->isMovable());
|
|
|
|
QVERIFY(!m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// User should not be able to move the window.
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 0);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The position should still be forced if we reopen the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isMovable());
|
|
|
|
QVERIFY(!m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The position of the window isn't set by any rule, thus the default placement
|
|
|
|
// policy will try to put the window in the top-left corner of the screen.
|
|
|
|
QVERIFY(m_window->isMovable());
|
|
|
|
QVERIFY(m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->pos(), QPoint(0, 0));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
|
2021-09-02 22:19:43 +00:00
|
|
|
|
|
|
|
setWindowRule("position", QPoint(42, 42), int(Rules::ApplyNow));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be moved to the position specified by the rule.
|
2020-02-05 09:28:50 +00:00
|
|
|
QCOMPARE(frameGeometryChangedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We still have to be able to move the window around.
|
|
|
|
QVERIFY(m_window->isMovable());
|
|
|
|
QVERIFY(m_window->isMovableAcrossScreens());
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
|
|
|
QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
|
|
|
|
QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), m_window);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2023-02-19 23:35:44 +00:00
|
|
|
const QPointF cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_window->updateInteractiveMoveResize(KWin::Cursors::self()->mouse()->pos());
|
2020-04-02 16:18:01 +00:00
|
|
|
QCOMPARE(KWin::Cursors::self()->mouse()->pos(), cursorPos + QPoint(8, 0));
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Enter);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
|
|
|
QCOMPARE(m_window->pos(), QPoint(50, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be moved to the position specified by the rule.
|
|
|
|
QVERIFY(!m_window->isMovable());
|
|
|
|
QVERIFY(!m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->pos(), QPoint(42, 42));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// User should not be able to move the window.
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowMove();
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 0);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The rule should be discarded if we close the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMovable());
|
|
|
|
QVERIFY(m_window->isMovableAcrossScreens());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->size(), QSize(100, 50));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// One still should be able to resize the window.
|
|
|
|
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
|
|
|
QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
|
|
|
|
QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowResize();
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), m_window);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(m_window->isInteractiveResize());
|
2022-04-09 17:12:41 +00:00
|
|
|
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
|
|
|
|
2023-02-19 23:35:44 +00:00
|
|
|
const QPointF cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_window->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));
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
2022-08-01 21:29:02 +00:00
|
|
|
Test::render(m_surface.get(), QSize(488, 640), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->size(), QSize(488, 640));
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Enter);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The rule should be applied again if the window 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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// One should still be able to resize the window.
|
|
|
|
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
|
|
|
QSignalSpy interactiveMoveResizeSteppedSpy(m_window, &Window::interactiveMoveResizeStepped);
|
|
|
|
QSignalSpy interactiveMoveResizeFinishedSpy(m_window, &Window::interactiveMoveResizeFinished);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowResize();
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), m_window);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 1);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(m_window->isInteractiveResize());
|
2022-04-09 17:12:41 +00:00
|
|
|
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
|
|
|
|
2023-02-19 23:35:44 +00:00
|
|
|
const QPointF cursorPos = KWin::Cursors::self()->mouse()->pos();
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Right);
|
|
|
|
m_window->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));
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
2022-08-01 21:29:02 +00:00
|
|
|
Test::render(m_surface.get(), QSize(488, 640), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->size(), QSize(488, 640));
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeSteppedSpy.count(), 1);
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->keyPressEvent(Qt::Key_Enter);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeFinishedSpy.count(), 1);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// If the window 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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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-23 19:51:16 +00:00
|
|
|
// Any attempt to resize the window should not succeed.
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowResize();
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 0);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// If the window 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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->size(), QSize(100, 50));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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-23 19:51:16 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
2022-08-01 21:29:02 +00:00
|
|
|
Test::render(m_surface.get(), QSize(480, 640), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->size(), QSize(480, 640));
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
2022-04-09 17:12:41 +00:00
|
|
|
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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(480, 640));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->size(), QSize(480, 640));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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-23 19:51:16 +00:00
|
|
|
// Any attempt to resize the window should not succeed.
|
2023-02-18 11:38:08 +00:00
|
|
|
QSignalSpy interactiveMoveResizeStartedSpy(m_window, &Window::interactiveMoveResizeStarted);
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2019-07-09 17:28:05 +00:00
|
|
|
workspace()->slotWindowResize();
|
2022-04-23 08:33:23 +00:00
|
|
|
QCOMPARE(workspace()->moveResizeWindow(), nullptr);
|
2023-02-18 11:38:08 +00:00
|
|
|
QCOMPARE(interactiveMoveResizeStartedSpy.count(), 0);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isInteractiveMove());
|
|
|
|
QVERIFY(!m_window->isInteractiveResize());
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2019-07-09 17:28:05 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window 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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isResizable());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->size(), QSize(100, 50));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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-23 19:51:16 +00:00
|
|
|
// One should still be able to change the maximized state of the window.
|
2019-07-09 18:07:21 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
2022-08-01 21:29:02 +00:00
|
|
|
Test::render(m_surface.get(), QSize(100, 50), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->size(), QSize(100, 50));
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// If we create the window 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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->size(), QSize(1280, 1024));
|
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::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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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-23 19:51:16 +00:00
|
|
|
// One should still be able to change the maximized state of the window.
|
2019-07-09 18:07:21 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
2022-08-01 21:29:02 +00:00
|
|
|
Test::render(m_surface.get(), QSize(100, 50), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->size(), QSize(100, 50));
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// If we create the window 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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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-05-16 20:13:39 +00:00
|
|
|
const QRectF oldGeometry = m_window->frameGeometry();
|
2019-07-09 18:07:21 +00:00
|
|
|
workspace()->slotWindowMaximize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->frameGeometry(), oldGeometry);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// If we create the window 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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(100, 50));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->size(), QSize(100, 50));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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-23 19:51:16 +00:00
|
|
|
QSignalSpy frameGeometryChangedSpy(m_window, &Window::frameGeometryChanged);
|
2022-04-09 17:12:41 +00:00
|
|
|
m_shellSurface->xdgSurface()->ack_configure(m_surfaceConfigureRequestedSpy->last().at(0).value<quint32>());
|
2022-08-01 21:29:02 +00:00
|
|
|
Test::render(m_surface.get(), QSize(1280, 1024), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->size(), QSize(1280, 1024));
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window still has to be maximizeable.
|
|
|
|
QVERIFY(m_window->isMaximizable());
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Restore the window.
|
2019-07-09 18:07:21 +00:00
|
|
|
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>());
|
2022-08-01 21:29:02 +00:00
|
|
|
Test::render(m_surface.get(), QSize(100, 50), Qt::blue);
|
2020-02-05 09:28:50 +00:00
|
|
|
QVERIFY(frameGeometryChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->size(), QSize(100, 50));
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
|
|
|
// The rule should be discarded after it's been applied.
|
2022-05-16 20:13:39 +00:00
|
|
|
const QRectF oldGeometry = m_window->frameGeometry();
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Map the window.
|
2022-04-09 12:23:59 +00:00
|
|
|
mapClientToSurface(QSize(1280, 1024));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->size(), QSize(1280, 1024));
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// We should receive a configure event when the window 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-05-16 20:13:39 +00:00
|
|
|
const QRectF oldGeometry = m_window->frameGeometry();
|
2019-07-09 18:07:21 +00:00
|
|
|
workspace()->slotWindowMaximize();
|
2022-04-09 17:12:41 +00:00
|
|
|
QVERIFY(!m_surfaceConfigureRequestedSpy->wait(100));
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeFull);
|
|
|
|
QCOMPARE(m_window->frameGeometry(), oldGeometry);
|
2019-07-09 18:07:21 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The rule should be discarded if we close the window.
|
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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMaximizable());
|
|
|
|
QCOMPARE(m_window->maximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->requestedMaximizeMode(), MaximizeMode::MaximizeRestore);
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should appear on the current virtual desktop.
|
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should appear on the second virtual desktop.
|
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// We still should be able to move the window between desktops.
|
|
|
|
m_window->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// If we re-open the window, 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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// Move the window to the first virtual desktop.
|
|
|
|
m_window->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// If we create the window again, it should appear on the first virtual desktop.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should appear on the second virtual desktop.
|
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd2);
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Any attempt to move the window to another virtual desktop should fail.
|
|
|
|
m_window->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// If we re-open the window, 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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
|
|
|
|
|
|
|
setWindowRule("desktops", QStringList{vd2->id()}, int(Rules::ApplyNow));
|
2018-01-13 18:58:43 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should have been moved to the second virtual desktop.
|
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// One should still be able to move the window between desktops.
|
|
|
|
m_window->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should appear on the second virtual desktop.
|
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// Any attempt to move the window to another virtual desktop should fail.
|
|
|
|
m_window->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window 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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
// One should be able to move the window between desktops.
|
|
|
|
m_window->setDesktops({vd2});
|
|
|
|
QCOMPARE(m_window->desktops(), {vd2});
|
2022-04-08 19:25:02 +00:00
|
|
|
QCOMPARE(VirtualDesktopManager::self()->currentDesktop(), vd1);
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->setDesktops({vd1});
|
|
|
|
QCOMPARE(m_window->desktops(), {vd1});
|
2022-04-08 19:25:02 +00:00
|
|
|
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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be minimized.
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be minimized.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// We should still be able to unminimize the window.
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(false);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// If we re-open the window, it should be minimized back again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ClientShouldBeInactive);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMinimizable());
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMinimizable());
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Minimize the window.
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// If we open the window again, it should be minimized.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ClientShouldBeInactive);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMinimizable());
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isMinimizable());
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Any attempt to minimize the window should fail.
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// If we re-open the window, the minimized state should still be forced.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isMinimizable());
|
|
|
|
QVERIFY(!m_window->isMinimized());
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMinimizable());
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be minimized now.
|
|
|
|
QVERIFY(m_window->isMinimizable());
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// One is still able to unminimize the window.
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(false);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QVERIFY(m_window->isMinimizable());
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isMinimizable());
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Any attempt to minimize the window should fail until the window is closed.
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isMinimizable());
|
|
|
|
QVERIFY(!m_window->isMinimized());
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be affected by the rule.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be included on a taskbar.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window, the rule should be applied again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be included on a taskbar.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be included on a taskbar.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be included on a taskbar.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be on a taskbar now.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be included on a taskbar.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setOriginalSkipTaskbar(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setOriginalSkipTaskbar(true);
|
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be affected by the rule.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be included on a pager.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipPager(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window, the rule should be applied again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be included on a pager.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipPager(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be included on a pager.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be included on a pager.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipPager(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be on a pager now.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipPager(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be included on a pager.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipPager(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipPager(true);
|
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be affected by the rule.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be excluded from window switching effects.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipSwitcher(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window, the rule should be applied again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be excluded from window switching effects.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipSwitcher(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be included in window switching effects.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be excluded from window switching effects.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipSwitcher(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be excluded from window switching effects now.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipSwitcher(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be excluded from window switching effects.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipSwitcher(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setSkipSwitcher(true);
|
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The keep-above state of the window should not be affected by the rule.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be kept above.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepAbove(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// If one re-opens the window, it should be kept above back again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be kept above.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepAbove(false);
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Re-open the window, it should not be kept above.
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be kept above.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepAbove(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// If we re-open the window, it should still be kept above.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should now be kept above other windows.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// One is still able to change the keep-above state of the window.
|
|
|
|
m_window->setKeepAbove(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be kept above.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepAbove(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepAbove(true);
|
|
|
|
QVERIFY(m_window->keepAbove());
|
|
|
|
m_window->setKeepAbove(false);
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The keep-below state of the window should not be affected by the rule.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be kept below.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepBelow(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// If one re-opens the window, it should be kept above back again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be kept below.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepBelow(false);
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Re-open the window, it should not be kept below.
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be kept below.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepBelow(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// If we re-open the window, it should still be kept below.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should now be kept below other windows.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// One is still able to change the keep-below state of the window.
|
|
|
|
m_window->setKeepBelow(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be kept below.
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepBelow(false);
|
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setKeepBelow(true);
|
|
|
|
QVERIFY(m_window->keepBelow());
|
|
|
|
m_window->setKeepBelow(false);
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->shortcut(), QKeySequence());
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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.
|
2023-02-23 13:43:33 +00:00
|
|
|
QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(!minimizedChangedSpy.wait(100));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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.
|
2023-02-23 13:43:33 +00:00
|
|
|
QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
quint32 timestamp = 1;
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(minimizedChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(minimizedChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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.
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(!minimizedChangedSpy.wait(100));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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.
|
2023-02-23 13:43:33 +00:00
|
|
|
QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
quint32 timestamp = 1;
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(minimizedChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(minimizedChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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.
|
2023-02-23 13:43:33 +00:00
|
|
|
QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
quint32 timestamp = 1;
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(minimizedChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(!minimizedChangedSpy.wait(100));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should now have a window shortcut assigned.
|
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
2023-02-23 13:43:33 +00:00
|
|
|
QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
quint32 timestamp = 1;
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(minimizedChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_2}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(minimizedChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QCOMPARE(m_window->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.
|
2023-02-23 13:43:33 +00:00
|
|
|
QSignalSpy minimizedChangedSpy(m_window, &Window::minimizedChanged);
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed By: #kwin, davidedmundson
Subscribers: davidedmundson, graesslin, kwin
Tags: #kwin
Differential Revision: https://phabricator.kde.org/D18464
2019-07-09 11:41:33 +00:00
|
|
|
quint32 timestamp = 1;
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(minimizedChangedSpy.wait());
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
m_window->setShortcut(QStringLiteral("Ctrl+Alt+2"));
|
|
|
|
QCOMPARE(m_window->shortcut(), (QKeySequence{Qt::CTRL | Qt::ALT | Qt::Key_1}));
|
2023-03-07 10:45:02 +00:00
|
|
|
m_window->setMinimized(true);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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++);
|
2023-02-23 13:43:33 +00:00
|
|
|
QVERIFY(!minimizedChangedSpy.wait(100));
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
2022-04-23 19:51:16 +00:00
|
|
|
// be exposed or the desktop file name rule should be removed for wayland windows.
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed 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("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
|
2022-04-23 19:51:16 +00:00
|
|
|
// be exposed or the desktop file name rule should be removed for wayland windows.
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed 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("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
|
2022-04-23 19:51:16 +00:00
|
|
|
// be exposed or the desktop file name rule should be removed for wayland windows.
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed 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("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
|
2022-04-23 19:51:16 +00:00
|
|
|
// be exposed or the desktop file name rule should be removed for wayland windows.
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed 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("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
|
2022-04-23 19:51:16 +00:00
|
|
|
// be exposed or the desktop file name rule should be removed for wayland windows.
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed 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("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
|
2022-04-23 19:51:16 +00:00
|
|
|
// be exposed or the desktop file name rule should be removed for wayland windows.
|
[autotests] Rewrite testShellClientRules
Summary:
Currently, the test doesn't verify that each rule does what it should,
e.g. a force rule is a force rule and not force temporarily, etc. This
as it turns out hides some bugs, e.g. all remember rules do not work,
forced window shortcuts can't be released, etc.
CCBUG: 403305
Reviewers: #kwin, davidedmundson
Reviewed 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("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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isActive());
|
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isActive());
|
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isActive());
|
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Make the window inactive.
|
2022-04-23 08:33:23 +00:00
|
|
|
workspace()->setActiveWindow(nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The opacity of the window should not be affected by the rule.
|
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isActive());
|
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
// Make the window inactive.
|
2022-04-23 08:33:23 +00:00
|
|
|
workspace()->setActiveWindow(nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isActive());
|
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
// Make the window inactive.
|
2022-04-23 08:33:23 +00:00
|
|
|
workspace()->setActiveWindow(nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow();
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isActive());
|
|
|
|
QCOMPARE(m_window->opacity(), 1.0);
|
2022-04-23 08:33:23 +00:00
|
|
|
workspace()->setActiveWindow(nullptr);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->isActive());
|
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be affected by the rule.
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should not be decorated.
|
|
|
|
QVERIFY(m_window->noBorder());
|
|
|
|
QVERIFY(!m_window->isDecorated());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// But you should be able to change "no border" property afterwards.
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->userCanSetNoBorder());
|
|
|
|
m_window->setNoBorder(false);
|
|
|
|
QVERIFY(!m_window->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// If one re-opens the window, it should have no border again.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ServerSideDecoration);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should not be decorated.
|
|
|
|
QVERIFY(m_window->noBorder());
|
|
|
|
QVERIFY(!m_window->isDecorated());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// Unset the "no border" property.
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->userCanSetNoBorder());
|
|
|
|
m_window->setNoBorder(false);
|
|
|
|
QVERIFY(!m_window->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Re-open the window, it should be decorated.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ServerSideDecoration);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isDecorated());
|
|
|
|
QVERIFY(!m_window->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
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be decorated.
|
|
|
|
QVERIFY(m_window->noBorder());
|
|
|
|
QVERIFY(!m_window->isDecorated());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// And the user should not be able to change the "no border" property.
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->setNoBorder(false);
|
|
|
|
QVERIFY(m_window->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// One should be still able to change the "no border" property.
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->setNoBorder(false);
|
|
|
|
QVERIFY(!m_window->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QVERIFY(!m_window->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-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// And you should not be able to change it.
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->setNoBorder(false);
|
|
|
|
QVERIFY(m_window->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The rule should be discarded when the window is closed.
|
2022-04-09 12:23:59 +00:00
|
|
|
destroyTestWindow();
|
|
|
|
createTestWindow(ServerSideDecoration);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(!m_window->noBorder());
|
2021-12-11 13:29:35 +00:00
|
|
|
|
|
|
|
// The "no border" property is no longer forced.
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->setNoBorder(true);
|
|
|
|
QVERIFY(m_window->noBorder());
|
|
|
|
m_window->setNoBorder(false);
|
|
|
|
QVERIFY(!m_window->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
|
|
|
{
|
2022-07-11 10:41:15 +00:00
|
|
|
const QList<KWin::Output *> outputs = workspace()->outputs();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::DontAffect));
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should not be affected by the rule.
|
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The user can still move the window to another screen.
|
|
|
|
workspace()->sendWindowToOutput(m_window, outputs.at(1));
|
|
|
|
QCOMPARE(m_window->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
|
|
|
{
|
2022-07-11 10:41:15 +00:00
|
|
|
const QList<KWin::Output *> outputs = workspace()->outputs();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::Apply));
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be in the screen specified by the rule.
|
2022-02-05 16:38:24 +00:00
|
|
|
QEXPECT_FAIL("", "Applying a screen rule on a new client fails on Wayland", Continue);
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The user can move the window to another screen.
|
|
|
|
workspace()->sendWindowToOutput(m_window, outputs.at(0));
|
|
|
|
QCOMPARE(m_window->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
|
|
|
{
|
2022-07-11 10:41:15 +00:00
|
|
|
const QList<KWin::Output *> outputs = workspace()->outputs();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::Remember));
|
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Initially, the window should be in the first screen
|
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Move the window to the second screen.
|
|
|
|
workspace()->sendWindowToOutput(m_window, outputs.at(1));
|
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Close and reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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
|
|
|
{
|
2022-07-11 10:41:15 +00:00
|
|
|
const QList<KWin::Output *> outputs = workspace()->outputs();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(m_window->isActive());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::Force));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be forced to the screen specified by the rule.
|
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// User should not be able to move the window to another screen.
|
|
|
|
workspace()->sendWindowToOutput(m_window, outputs.at(0));
|
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Disable the output where the window is on, so the window 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;
|
2022-09-05 07:31:57 +00:00
|
|
|
workspace()->applyOutputConfiguration(config);
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
QVERIFY(!outputs.at(1)->isEnabled());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Enable the output and check that the window is moved there again
|
2022-02-05 16:38:24 +00:00
|
|
|
changeSet->enabled = true;
|
2022-09-05 07:31:57 +00:00
|
|
|
workspace()->applyOutputConfiguration(config);
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
QVERIFY(outputs.at(1)->isEnabled());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Close and reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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
|
|
|
{
|
2022-07-11 10:41:15 +00:00
|
|
|
const QList<KWin::Output *> outputs = workspace()->outputs();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Set the rule so the window should move to the screen specified by the rule.
|
2022-02-05 16:38:24 +00:00
|
|
|
setWindowRule("screen", int(1), int(Rules::ApplyNow));
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The user can move the window to another screen.
|
|
|
|
workspace()->sendWindowToOutput(m_window, outputs.at(0));
|
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(0)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// The rule should not be applied again.
|
2022-04-23 19:51:16 +00:00
|
|
|
m_window->evaluateWindowRules();
|
|
|
|
QCOMPARE(m_window->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
|
|
|
{
|
2022-07-11 10:41:15 +00:00
|
|
|
const QList<KWin::Output *> outputs = workspace()->outputs();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-09 12:23:59 +00:00
|
|
|
createTestWindow();
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
setWindowRule("screen", int(1), int(Rules::ForceTemporarily));
|
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// The window should be forced the second screen
|
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
|
|
|
// User is not allowed to move it
|
2022-04-23 19:51:16 +00:00
|
|
|
workspace()->sendWindowToOutput(m_window, outputs.at(0));
|
|
|
|
QCOMPARE(m_window->output()->name(), outputs.at(1)->name());
|
2022-02-05 16:38:24 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
// Close and reopen the window.
|
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-23 19:51:16 +00:00
|
|
|
QCOMPARE(m_window->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
|
|
|
|
2022-08-01 21:29:02 +00:00
|
|
|
std::unique_ptr<KWayland::Client::Surface> surface(Test::createSurface());
|
|
|
|
std::unique_ptr<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.get()));
|
2018-03-12 17:06:33 +00:00
|
|
|
|
2022-08-01 21:29:02 +00:00
|
|
|
auto window = Test::renderAndWaitForShown(surface.get(), QSize(100, 50), Qt::blue);
|
2022-04-23 19:51:16 +00:00
|
|
|
QVERIFY(window);
|
|
|
|
QVERIFY(window->isActive());
|
|
|
|
QCOMPARE(window->keepAbove(), false);
|
2018-03-12 17:06:33 +00:00
|
|
|
|
2022-04-23 19:51:16 +00:00
|
|
|
QSignalSpy desktopFileNameSpy(window, &Window::desktopFileNameChanged);
|
2018-03-12 17:06:33 +00:00
|
|
|
|
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());
|
2022-04-23 19:51:16 +00:00
|
|
|
QCOMPARE(window->keepAbove(), true);
|
2018-03-12 17:06:33 +00:00
|
|
|
}
|
|
|
|
|
2022-04-22 18:11:29 +00:00
|
|
|
WAYLANDTEST_MAIN(TestXdgShellWindowRules)
|
|
|
|
#include "xdgshellwindow_rules_test.moc"
|