Rename XdgShellClient to XdgShellWindow

The word "client" means different things in wayland and kwin. Use a
better word to refer to windows.
This commit is contained in:
Vlad Zahorodnii 2022-04-22 21:11:29 +03:00
parent a21aa839b1
commit 4b91c6163f
11 changed files with 379 additions and 379 deletions

View file

@ -107,7 +107,7 @@ integrationTest(NAME testDebugConsole SRCS debug_console_test.cpp)
integrationTest(NAME testDontCrashEmptyDeco SRCS dont_crash_empty_deco.cpp)
integrationTest(WAYLAND_ONLY NAME testPlasmaSurface SRCS plasma_surface_test.cpp)
integrationTest(WAYLAND_ONLY NAME testMaximized SRCS maximize_test.cpp)
integrationTest(WAYLAND_ONLY NAME testXdgShellClient SRCS xdgshellclient_test.cpp)
integrationTest(WAYLAND_ONLY NAME testXdgShellWindow SRCS xdgshellwindow_test.cpp)
integrationTest(WAYLAND_ONLY NAME testDontCrashNoBorder SRCS dont_crash_no_border.cpp)
integrationTest(NAME testXwaylandSelections SRCS xwayland_selections_test.cpp)
integrationTest(WAYLAND_ONLY NAME testSceneOpenGL SRCS scene_opengl_test.cpp )
@ -126,7 +126,7 @@ integrationTest(WAYLAND_ONLY NAME testDontCrashUseractionsMenu SRCS dont_crash_u
integrationTest(WAYLAND_ONLY NAME testKWinBindings SRCS kwinbindings_test.cpp)
integrationTest(WAYLAND_ONLY NAME testLayerShellV1Window SRCS layershellv1window_test.cpp)
integrationTest(WAYLAND_ONLY NAME testVirtualDesktop SRCS virtual_desktop_test.cpp)
integrationTest(WAYLAND_ONLY NAME testXdgShellClientRules SRCS xdgshellclient_rules_test.cpp)
integrationTest(WAYLAND_ONLY NAME testXdgShellWindowRules SRCS xdgshellwindow_rules_test.cpp)
integrationTest(WAYLAND_ONLY NAME testIdleInhibition SRCS idle_inhibition_test.cpp)
integrationTest(WAYLAND_ONLY NAME testDontCrashCursorPhysicalSizeEmpty SRCS dont_crash_cursor_physical_size_empty.cpp)
integrationTest(WAYLAND_ONLY NAME testDontCrashReinitializeCompositor SRCS dont_crash_reinitialize_compositor.cpp)

View file

@ -28,9 +28,9 @@
using namespace KWin;
using namespace KWayland::Client;
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellclient_rules-0");
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow_rules-0");
class TestXdgShellClientRules : public QObject
class TestXdgShellWindowRules : public QObject
{
Q_OBJECT
@ -174,7 +174,7 @@ private:
QScopedPointer<QSignalSpy> m_surfaceConfigureRequestedSpy;
};
void TestXdgShellClientRules::initTestCase()
void TestXdgShellWindowRules::initTestCase()
{
qRegisterMetaType<KWin::Window *>();
@ -196,7 +196,7 @@ void TestXdgShellClientRules::initTestCase()
RuleBook::self()->setConfig(m_config);
}
void TestXdgShellClientRules::init()
void TestXdgShellWindowRules::init()
{
VirtualDesktopManager::self()->setCurrent(VirtualDesktopManager::self()->desktops().first());
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::XdgDecorationV1));
@ -204,7 +204,7 @@ void TestXdgShellClientRules::init()
workspace()->setActiveOutput(QPoint(640, 512));
}
void TestXdgShellClientRules::cleanup()
void TestXdgShellWindowRules::cleanup()
{
if (!m_shellSurface.isNull()) {
destroyTestWindow();
@ -223,7 +223,7 @@ void TestXdgShellClientRules::cleanup()
QCOMPARE(VirtualDesktopManager::self()->count(), 1u);
}
void TestXdgShellClientRules::createTestWindow(ClientFlags flags)
void TestXdgShellWindowRules::createTestWindow(ClientFlags flags)
{
// Apply flags for special windows and rules
const bool createClient = !(flags & ReturnAfterSurfaceConfiguration);
@ -250,7 +250,7 @@ void TestXdgShellClientRules::createTestWindow(ClientFlags flags)
}
}
void TestXdgShellClientRules::mapClientToSurface(QSize clientSize, ClientFlags flags)
void TestXdgShellWindowRules::mapClientToSurface(QSize clientSize, ClientFlags flags)
{
const bool clientShouldBeActive = !(flags & ClientShouldBeInactive);
@ -267,7 +267,7 @@ void TestXdgShellClientRules::mapClientToSurface(QSize clientSize, ClientFlags f
QCOMPARE(m_client->isActive(), clientShouldBeActive);
}
void TestXdgShellClientRules::destroyTestWindow()
void TestXdgShellWindowRules::destroyTestWindow()
{
m_surfaceConfigureRequestedSpy.reset();
m_toplevelConfigureRequestedSpy.reset();
@ -277,7 +277,7 @@ void TestXdgShellClientRules::destroyTestWindow()
}
template<typename T>
void TestXdgShellClientRules::setWindowRule(const QString &property, const T &value, int policy)
void TestXdgShellWindowRules::setWindowRule(const QString &property, const T &value, int policy)
{
// Initialize RuleBook with the test rule.
m_config->group("General").writeEntry("count", 1);
@ -294,7 +294,7 @@ void TestXdgShellClientRules::setWindowRule(const QString &property, const T &va
workspace()->slotReconfigure();
}
void TestXdgShellClientRules::testPositionDontAffect()
void TestXdgShellWindowRules::testPositionDontAffect()
{
setWindowRule("position", QPoint(42, 42), int(Rules::DontAffect));
@ -309,7 +309,7 @@ void TestXdgShellClientRules::testPositionDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testPositionApply()
void TestXdgShellWindowRules::testPositionApply()
{
setWindowRule("position", QPoint(42, 42), int(Rules::Apply));
@ -362,7 +362,7 @@ void TestXdgShellClientRules::testPositionApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testPositionRemember()
void TestXdgShellWindowRules::testPositionRemember()
{
setWindowRule("position", QPoint(42, 42), int(Rules::Remember));
createTestWindow();
@ -414,7 +414,7 @@ void TestXdgShellClientRules::testPositionRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testPositionForce()
void TestXdgShellWindowRules::testPositionForce()
{
setWindowRule("position", QPoint(42, 42), int(Rules::Force));
@ -448,7 +448,7 @@ void TestXdgShellClientRules::testPositionForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testPositionApplyNow()
void TestXdgShellWindowRules::testPositionApplyNow()
{
createTestWindow();
@ -507,7 +507,7 @@ void TestXdgShellClientRules::testPositionApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testPositionForceTemporarily()
void TestXdgShellWindowRules::testPositionForceTemporarily()
{
setWindowRule("position", QPoint(42, 42), int(Rules::ForceTemporarily));
@ -541,7 +541,7 @@ void TestXdgShellClientRules::testPositionForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testSizeDontAffect()
void TestXdgShellWindowRules::testSizeDontAffect()
{
setWindowRule("size", QSize(480, 640), int(Rules::DontAffect));
@ -565,7 +565,7 @@ void TestXdgShellClientRules::testSizeDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testSizeApply()
void TestXdgShellWindowRules::testSizeApply()
{
setWindowRule("size", QSize(480, 640), int(Rules::Apply));
@ -666,7 +666,7 @@ void TestXdgShellClientRules::testSizeApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testSizeRemember()
void TestXdgShellWindowRules::testSizeRemember()
{
setWindowRule("size", QSize(480, 640), int(Rules::Remember));
@ -767,7 +767,7 @@ void TestXdgShellClientRules::testSizeRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testSizeForce()
void TestXdgShellWindowRules::testSizeForce()
{
setWindowRule("size", QSize(480, 640), int(Rules::Force));
@ -820,7 +820,7 @@ void TestXdgShellClientRules::testSizeForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testSizeApplyNow()
void TestXdgShellWindowRules::testSizeApplyNow()
{
createTestWindow(ReturnAfterSurfaceConfiguration);
@ -863,7 +863,7 @@ void TestXdgShellClientRules::testSizeApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testSizeForceTemporarily()
void TestXdgShellWindowRules::testSizeForceTemporarily()
{
setWindowRule("size", QSize(480, 640), int(Rules::ForceTemporarily));
@ -916,7 +916,7 @@ void TestXdgShellClientRules::testSizeForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testMaximizeDontAffect()
void TestXdgShellWindowRules::testMaximizeDontAffect()
{
setWindowRule("maximizehoriz", true, int(Rules::DontAffect));
setWindowRule("maximizevert", true, int(Rules::DontAffect));
@ -951,7 +951,7 @@ void TestXdgShellClientRules::testMaximizeDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testMaximizeApply()
void TestXdgShellWindowRules::testMaximizeApply()
{
setWindowRule("maximizehoriz", true, int(Rules::Apply));
setWindowRule("maximizevert", true, int(Rules::Apply));
@ -1029,7 +1029,7 @@ void TestXdgShellClientRules::testMaximizeApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testMaximizeRemember()
void TestXdgShellWindowRules::testMaximizeRemember()
{
setWindowRule("maximizehoriz", true, int(Rules::Remember));
setWindowRule("maximizevert", true, int(Rules::Remember));
@ -1108,7 +1108,7 @@ void TestXdgShellClientRules::testMaximizeRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testMaximizeForce()
void TestXdgShellWindowRules::testMaximizeForce()
{
setWindowRule("maximizehoriz", true, int(Rules::Force));
setWindowRule("maximizevert", true, int(Rules::Force));
@ -1176,7 +1176,7 @@ void TestXdgShellClientRules::testMaximizeForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testMaximizeApplyNow()
void TestXdgShellWindowRules::testMaximizeApplyNow()
{
createTestWindow(ReturnAfterSurfaceConfiguration);
@ -1258,7 +1258,7 @@ void TestXdgShellClientRules::testMaximizeApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testMaximizeForceTemporarily()
void TestXdgShellWindowRules::testMaximizeForceTemporarily()
{
setWindowRule("maximizehoriz", true, int(Rules::ForceTemporarily));
setWindowRule("maximizevert", true, int(Rules::ForceTemporarily));
@ -1326,7 +1326,7 @@ void TestXdgShellClientRules::testMaximizeForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testDesktopsDontAffect()
void TestXdgShellWindowRules::testDesktopsDontAffect()
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager::self()->setCount(2);
@ -1348,7 +1348,7 @@ void TestXdgShellClientRules::testDesktopsDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testDesktopsApply()
void TestXdgShellWindowRules::testDesktopsApply()
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager::self()->setCount(2);
@ -1384,7 +1384,7 @@ void TestXdgShellClientRules::testDesktopsApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testDesktopsRemember()
void TestXdgShellWindowRules::testDesktopsRemember()
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager::self()->setCount(2);
@ -1417,7 +1417,7 @@ void TestXdgShellClientRules::testDesktopsRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testDesktopsForce()
void TestXdgShellWindowRules::testDesktopsForce()
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager::self()->setCount(2);
@ -1453,7 +1453,7 @@ void TestXdgShellClientRules::testDesktopsForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testDesktopsApplyNow()
void TestXdgShellWindowRules::testDesktopsApplyNow()
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager::self()->setCount(2);
@ -1488,7 +1488,7 @@ void TestXdgShellClientRules::testDesktopsApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testDesktopsForceTemporarily()
void TestXdgShellWindowRules::testDesktopsForceTemporarily()
{
// We need at least two virtual desktop for this test.
VirtualDesktopManager::self()->setCount(2);
@ -1533,7 +1533,7 @@ void TestXdgShellClientRules::testDesktopsForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testMinimizeDontAffect()
void TestXdgShellWindowRules::testMinimizeDontAffect()
{
setWindowRule("minimize", true, int(Rules::DontAffect));
@ -1546,7 +1546,7 @@ void TestXdgShellClientRules::testMinimizeDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testMinimizeApply()
void TestXdgShellWindowRules::testMinimizeApply()
{
setWindowRule("minimize", true, int(Rules::Apply));
@ -1569,7 +1569,7 @@ void TestXdgShellClientRules::testMinimizeApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testMinimizeRemember()
void TestXdgShellWindowRules::testMinimizeRemember()
{
setWindowRule("minimize", false, int(Rules::Remember));
@ -1590,7 +1590,7 @@ void TestXdgShellClientRules::testMinimizeRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testMinimizeForce()
void TestXdgShellWindowRules::testMinimizeForce()
{
setWindowRule("minimize", false, int(Rules::Force));
@ -1613,7 +1613,7 @@ void TestXdgShellClientRules::testMinimizeForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testMinimizeApplyNow()
void TestXdgShellWindowRules::testMinimizeApplyNow()
{
createTestWindow();
QVERIFY(m_client->isMinimizable());
@ -1637,7 +1637,7 @@ void TestXdgShellClientRules::testMinimizeApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testMinimizeForceTemporarily()
void TestXdgShellWindowRules::testMinimizeForceTemporarily()
{
setWindowRule("minimize", false, int(Rules::ForceTemporarily));
@ -1660,7 +1660,7 @@ void TestXdgShellClientRules::testMinimizeForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipTaskbarDontAffect()
void TestXdgShellWindowRules::testSkipTaskbarDontAffect()
{
setWindowRule("skiptaskbar", true, int(Rules::DontAffect));
@ -1672,7 +1672,7 @@ void TestXdgShellClientRules::testSkipTaskbarDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipTaskbarApply()
void TestXdgShellWindowRules::testSkipTaskbarApply()
{
setWindowRule("skiptaskbar", true, int(Rules::Apply));
@ -1693,7 +1693,7 @@ void TestXdgShellClientRules::testSkipTaskbarApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipTaskbarRemember()
void TestXdgShellWindowRules::testSkipTaskbarRemember()
{
setWindowRule("skiptaskbar", true, int(Rules::Remember));
@ -1716,7 +1716,7 @@ void TestXdgShellClientRules::testSkipTaskbarRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipTaskbarForce()
void TestXdgShellWindowRules::testSkipTaskbarForce()
{
setWindowRule("skiptaskbar", true, int(Rules::Force));
@ -1739,7 +1739,7 @@ void TestXdgShellClientRules::testSkipTaskbarForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipTaskbarApplyNow()
void TestXdgShellWindowRules::testSkipTaskbarApplyNow()
{
createTestWindow();
QVERIFY(!m_client->skipTaskbar());
@ -1760,7 +1760,7 @@ void TestXdgShellClientRules::testSkipTaskbarApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipTaskbarForceTemporarily()
void TestXdgShellWindowRules::testSkipTaskbarForceTemporarily()
{
setWindowRule("skiptaskbar", true, int(Rules::ForceTemporarily));
@ -1785,7 +1785,7 @@ void TestXdgShellClientRules::testSkipTaskbarForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipPagerDontAffect()
void TestXdgShellWindowRules::testSkipPagerDontAffect()
{
setWindowRule("skippager", true, int(Rules::DontAffect));
@ -1797,7 +1797,7 @@ void TestXdgShellClientRules::testSkipPagerDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipPagerApply()
void TestXdgShellWindowRules::testSkipPagerApply()
{
setWindowRule("skippager", true, int(Rules::Apply));
@ -1818,7 +1818,7 @@ void TestXdgShellClientRules::testSkipPagerApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipPagerRemember()
void TestXdgShellWindowRules::testSkipPagerRemember()
{
setWindowRule("skippager", true, int(Rules::Remember));
@ -1841,7 +1841,7 @@ void TestXdgShellClientRules::testSkipPagerRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipPagerForce()
void TestXdgShellWindowRules::testSkipPagerForce()
{
setWindowRule("skippager", true, int(Rules::Force));
@ -1864,7 +1864,7 @@ void TestXdgShellClientRules::testSkipPagerForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipPagerApplyNow()
void TestXdgShellWindowRules::testSkipPagerApplyNow()
{
createTestWindow();
QVERIFY(!m_client->skipPager());
@ -1885,7 +1885,7 @@ void TestXdgShellClientRules::testSkipPagerApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipPagerForceTemporarily()
void TestXdgShellWindowRules::testSkipPagerForceTemporarily()
{
setWindowRule("skippager", true, int(Rules::ForceTemporarily));
@ -1910,7 +1910,7 @@ void TestXdgShellClientRules::testSkipPagerForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipSwitcherDontAffect()
void TestXdgShellWindowRules::testSkipSwitcherDontAffect()
{
setWindowRule("skipswitcher", true, int(Rules::DontAffect));
@ -1922,7 +1922,7 @@ void TestXdgShellClientRules::testSkipSwitcherDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipSwitcherApply()
void TestXdgShellWindowRules::testSkipSwitcherApply()
{
setWindowRule("skipswitcher", true, int(Rules::Apply));
@ -1943,7 +1943,7 @@ void TestXdgShellClientRules::testSkipSwitcherApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipSwitcherRemember()
void TestXdgShellWindowRules::testSkipSwitcherRemember()
{
setWindowRule("skipswitcher", true, int(Rules::Remember));
@ -1966,7 +1966,7 @@ void TestXdgShellClientRules::testSkipSwitcherRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipSwitcherForce()
void TestXdgShellWindowRules::testSkipSwitcherForce()
{
setWindowRule("skipswitcher", true, int(Rules::Force));
@ -1989,7 +1989,7 @@ void TestXdgShellClientRules::testSkipSwitcherForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipSwitcherApplyNow()
void TestXdgShellWindowRules::testSkipSwitcherApplyNow()
{
createTestWindow();
QVERIFY(!m_client->skipSwitcher());
@ -2010,7 +2010,7 @@ void TestXdgShellClientRules::testSkipSwitcherApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testSkipSwitcherForceTemporarily()
void TestXdgShellWindowRules::testSkipSwitcherForceTemporarily()
{
setWindowRule("skipswitcher", true, int(Rules::ForceTemporarily));
@ -2035,7 +2035,7 @@ void TestXdgShellClientRules::testSkipSwitcherForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepAboveDontAffect()
void TestXdgShellWindowRules::testKeepAboveDontAffect()
{
setWindowRule("above", true, int(Rules::DontAffect));
@ -2047,7 +2047,7 @@ void TestXdgShellClientRules::testKeepAboveDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepAboveApply()
void TestXdgShellWindowRules::testKeepAboveApply()
{
setWindowRule("above", true, int(Rules::Apply));
@ -2068,7 +2068,7 @@ void TestXdgShellClientRules::testKeepAboveApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepAboveRemember()
void TestXdgShellWindowRules::testKeepAboveRemember()
{
setWindowRule("above", true, int(Rules::Remember));
@ -2089,7 +2089,7 @@ void TestXdgShellClientRules::testKeepAboveRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepAboveForce()
void TestXdgShellWindowRules::testKeepAboveForce()
{
setWindowRule("above", true, int(Rules::Force));
@ -2110,7 +2110,7 @@ void TestXdgShellClientRules::testKeepAboveForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepAboveApplyNow()
void TestXdgShellWindowRules::testKeepAboveApplyNow()
{
createTestWindow();
QVERIFY(!m_client->keepAbove());
@ -2131,7 +2131,7 @@ void TestXdgShellClientRules::testKeepAboveApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepAboveForceTemporarily()
void TestXdgShellWindowRules::testKeepAboveForceTemporarily()
{
setWindowRule("above", true, int(Rules::ForceTemporarily));
@ -2158,7 +2158,7 @@ void TestXdgShellClientRules::testKeepAboveForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepBelowDontAffect()
void TestXdgShellWindowRules::testKeepBelowDontAffect()
{
setWindowRule("below", true, int(Rules::DontAffect));
@ -2170,7 +2170,7 @@ void TestXdgShellClientRules::testKeepBelowDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepBelowApply()
void TestXdgShellWindowRules::testKeepBelowApply()
{
setWindowRule("below", true, int(Rules::Apply));
@ -2191,7 +2191,7 @@ void TestXdgShellClientRules::testKeepBelowApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepBelowRemember()
void TestXdgShellWindowRules::testKeepBelowRemember()
{
setWindowRule("below", true, int(Rules::Remember));
@ -2212,7 +2212,7 @@ void TestXdgShellClientRules::testKeepBelowRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepBelowForce()
void TestXdgShellWindowRules::testKeepBelowForce()
{
setWindowRule("below", true, int(Rules::Force));
@ -2233,7 +2233,7 @@ void TestXdgShellClientRules::testKeepBelowForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepBelowApplyNow()
void TestXdgShellWindowRules::testKeepBelowApplyNow()
{
createTestWindow();
QVERIFY(!m_client->keepBelow());
@ -2254,7 +2254,7 @@ void TestXdgShellClientRules::testKeepBelowApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testKeepBelowForceTemporarily()
void TestXdgShellWindowRules::testKeepBelowForceTemporarily()
{
setWindowRule("below", true, int(Rules::ForceTemporarily));
@ -2281,7 +2281,7 @@ void TestXdgShellClientRules::testKeepBelowForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testShortcutDontAffect()
void TestXdgShellWindowRules::testShortcutDontAffect()
{
setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::DontAffect));
@ -2306,7 +2306,7 @@ void TestXdgShellClientRules::testShortcutDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testShortcutApply()
void TestXdgShellWindowRules::testShortcutApply()
{
setWindowRule("shortcut", "Ctrl+Alt+1", int(Rules::Apply));
@ -2364,7 +2364,7 @@ void TestXdgShellClientRules::testShortcutApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testShortcutRemember()
void TestXdgShellWindowRules::testShortcutRemember()
{
QSKIP("KWin core doesn't try to save the last used window shortcut");
@ -2412,7 +2412,7 @@ void TestXdgShellClientRules::testShortcutRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testShortcutForce()
void TestXdgShellWindowRules::testShortcutForce()
{
QSKIP("KWin core can't release forced window shortcuts");
@ -2460,7 +2460,7 @@ void TestXdgShellClientRules::testShortcutForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testShortcutApplyNow()
void TestXdgShellWindowRules::testShortcutApplyNow()
{
createTestWindow();
QVERIFY(m_client->shortcut().isEmpty());
@ -2504,7 +2504,7 @@ void TestXdgShellClientRules::testShortcutApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testShortcutForceTemporarily()
void TestXdgShellWindowRules::testShortcutForceTemporarily()
{
QSKIP("KWin core can't release forced window shortcuts");
@ -2550,7 +2550,7 @@ void TestXdgShellClientRules::testShortcutForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testDesktopFileDontAffect()
void TestXdgShellWindowRules::testDesktopFileDontAffect()
{
// 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
@ -2558,7 +2558,7 @@ void TestXdgShellClientRules::testDesktopFileDontAffect()
QSKIP("Needs changes in KWin core to pass");
}
void TestXdgShellClientRules::testDesktopFileApply()
void TestXdgShellWindowRules::testDesktopFileApply()
{
// 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
@ -2566,7 +2566,7 @@ void TestXdgShellClientRules::testDesktopFileApply()
QSKIP("Needs changes in KWin core to pass");
}
void TestXdgShellClientRules::testDesktopFileRemember()
void TestXdgShellWindowRules::testDesktopFileRemember()
{
// 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
@ -2574,7 +2574,7 @@ void TestXdgShellClientRules::testDesktopFileRemember()
QSKIP("Needs changes in KWin core to pass");
}
void TestXdgShellClientRules::testDesktopFileForce()
void TestXdgShellWindowRules::testDesktopFileForce()
{
// 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
@ -2582,7 +2582,7 @@ void TestXdgShellClientRules::testDesktopFileForce()
QSKIP("Needs changes in KWin core to pass");
}
void TestXdgShellClientRules::testDesktopFileApplyNow()
void TestXdgShellWindowRules::testDesktopFileApplyNow()
{
// 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
@ -2590,7 +2590,7 @@ void TestXdgShellClientRules::testDesktopFileApplyNow()
QSKIP("Needs changes in KWin core to pass");
}
void TestXdgShellClientRules::testDesktopFileForceTemporarily()
void TestXdgShellWindowRules::testDesktopFileForceTemporarily()
{
// 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
@ -2598,7 +2598,7 @@ void TestXdgShellClientRules::testDesktopFileForceTemporarily()
QSKIP("Needs changes in KWin core to pass");
}
void TestXdgShellClientRules::testActiveOpacityDontAffect()
void TestXdgShellWindowRules::testActiveOpacityDontAffect()
{
setWindowRule("opacityactive", 90, int(Rules::DontAffect));
@ -2611,7 +2611,7 @@ void TestXdgShellClientRules::testActiveOpacityDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testActiveOpacityForce()
void TestXdgShellWindowRules::testActiveOpacityForce()
{
setWindowRule("opacityactive", 90, int(Rules::Force));
@ -2622,7 +2622,7 @@ void TestXdgShellClientRules::testActiveOpacityForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testActiveOpacityForceTemporarily()
void TestXdgShellWindowRules::testActiveOpacityForceTemporarily()
{
setWindowRule("opacityactive", 90, int(Rules::ForceTemporarily));
@ -2639,7 +2639,7 @@ void TestXdgShellClientRules::testActiveOpacityForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testInactiveOpacityDontAffect()
void TestXdgShellWindowRules::testInactiveOpacityDontAffect()
{
setWindowRule("opacityinactive", 80, int(Rules::DontAffect));
@ -2656,7 +2656,7 @@ void TestXdgShellClientRules::testInactiveOpacityDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testInactiveOpacityForce()
void TestXdgShellWindowRules::testInactiveOpacityForce()
{
setWindowRule("opacityinactive", 80, int(Rules::Force));
@ -2674,7 +2674,7 @@ void TestXdgShellClientRules::testInactiveOpacityForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testInactiveOpacityForceTemporarily()
void TestXdgShellWindowRules::testInactiveOpacityForceTemporarily()
{
setWindowRule("opacityinactive", 80, int(Rules::ForceTemporarily));
@ -2702,7 +2702,7 @@ void TestXdgShellClientRules::testInactiveOpacityForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testNoBorderDontAffect()
void TestXdgShellWindowRules::testNoBorderDontAffect()
{
setWindowRule("noborder", true, int(Rules::DontAffect));
createTestWindow(ServerSideDecoration);
@ -2713,7 +2713,7 @@ void TestXdgShellClientRules::testNoBorderDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testNoBorderApply()
void TestXdgShellWindowRules::testNoBorderApply()
{
setWindowRule("noborder", true, int(Rules::Apply));
createTestWindow(ServerSideDecoration);
@ -2735,7 +2735,7 @@ void TestXdgShellClientRules::testNoBorderApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testNoBorderRemember()
void TestXdgShellWindowRules::testNoBorderRemember()
{
setWindowRule("noborder", true, int(Rules::Remember));
createTestWindow(ServerSideDecoration);
@ -2758,7 +2758,7 @@ void TestXdgShellClientRules::testNoBorderRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testNoBorderForce()
void TestXdgShellWindowRules::testNoBorderForce()
{
setWindowRule("noborder", true, int(Rules::Force));
createTestWindow(ServerSideDecoration);
@ -2781,7 +2781,7 @@ void TestXdgShellClientRules::testNoBorderForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testNoBorderApplyNow()
void TestXdgShellWindowRules::testNoBorderApplyNow()
{
createTestWindow(ServerSideDecoration);
QVERIFY(!m_client->noBorder());
@ -2803,7 +2803,7 @@ void TestXdgShellClientRules::testNoBorderApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testNoBorderForceTemporarily()
void TestXdgShellWindowRules::testNoBorderForceTemporarily()
{
setWindowRule("noborder", true, int(Rules::ForceTemporarily));
createTestWindow(ServerSideDecoration);
@ -2829,7 +2829,7 @@ void TestXdgShellClientRules::testNoBorderForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testScreenDontAffect()
void TestXdgShellWindowRules::testScreenDontAffect()
{
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
@ -2847,7 +2847,7 @@ void TestXdgShellClientRules::testScreenDontAffect()
destroyTestWindow();
}
void TestXdgShellClientRules::testScreenApply()
void TestXdgShellWindowRules::testScreenApply()
{
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
@ -2866,7 +2866,7 @@ void TestXdgShellClientRules::testScreenApply()
destroyTestWindow();
}
void TestXdgShellClientRules::testScreenRemember()
void TestXdgShellWindowRules::testScreenRemember()
{
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
@ -2891,7 +2891,7 @@ void TestXdgShellClientRules::testScreenRemember()
destroyTestWindow();
}
void TestXdgShellClientRules::testScreenForce()
void TestXdgShellWindowRules::testScreenForce()
{
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
@ -2933,7 +2933,7 @@ void TestXdgShellClientRules::testScreenForce()
destroyTestWindow();
}
void TestXdgShellClientRules::testScreenApplyNow()
void TestXdgShellWindowRules::testScreenApplyNow()
{
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
@ -2956,7 +2956,7 @@ void TestXdgShellClientRules::testScreenApplyNow()
destroyTestWindow();
}
void TestXdgShellClientRules::testScreenForceTemporarily()
void TestXdgShellWindowRules::testScreenForceTemporarily()
{
const KWin::Outputs outputs = kwinApp()->platform()->enabledOutputs();
@ -2981,7 +2981,7 @@ void TestXdgShellClientRules::testScreenForceTemporarily()
destroyTestWindow();
}
void TestXdgShellClientRules::testMatchAfterNameChange()
void TestXdgShellWindowRules::testMatchAfterNameChange()
{
setWindowRule("above", true, int(Rules::Force));
@ -3001,5 +3001,5 @@ void TestXdgShellClientRules::testMatchAfterNameChange()
QCOMPARE(c->keepAbove(), true);
}
WAYLANDTEST_MAIN(TestXdgShellClientRules)
#include "xdgshellclient_rules_test.moc"
WAYLANDTEST_MAIN(TestXdgShellWindowRules)
#include "xdgshellwindow_rules_test.moc"

View file

@ -50,9 +50,9 @@
using namespace KWin;
using namespace KWayland::Client;
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellclient-0");
static const QString s_socketName = QStringLiteral("wayland_test_kwin_xdgshellwindow-0");
class TestXdgShellClient : public QObject
class TestXdgShellWindow : public QObject
{
Q_OBJECT
private Q_SLOTS:
@ -108,7 +108,7 @@ private Q_SLOTS:
void testChangeDecorationModeAfterInitialCommit();
};
void TestXdgShellClient::testXdgWindowReactive()
void TestXdgShellWindow::testXdgWindowReactive()
{
QScopedPointer<Test::XdgPositioner> positioner(Test::createXdgPositioner());
positioner->set_size(10, 10);
@ -134,7 +134,7 @@ void TestXdgShellClient::testXdgWindowReactive()
QCOMPARE(popupConfigureRequested.count(), 1);
}
void TestXdgShellClient::testXdgWindowRepositioning()
void TestXdgShellWindow::testXdgWindowRepositioning()
{
QScopedPointer<Test::XdgPositioner> positioner(Test::createXdgPositioner());
positioner->set_size(10, 10);
@ -163,7 +163,7 @@ void TestXdgShellClient::testXdgWindowRepositioning()
QCOMPARE(reconfigureSpy.count(), 1);
}
void TestXdgShellClient::initTestCase()
void TestXdgShellWindow::initTestCase()
{
qRegisterMetaType<KWin::Deleted *>();
qRegisterMetaType<KWin::Window *>();
@ -184,7 +184,7 @@ void TestXdgShellClient::initTestCase()
Test::initWaylandWorkspace();
}
void TestXdgShellClient::init()
void TestXdgShellWindow::init()
{
QVERIFY(Test::setupWaylandConnection(Test::AdditionalWaylandInterface::Seat | Test::AdditionalWaylandInterface::XdgDecorationV1 | Test::AdditionalWaylandInterface::AppMenu));
QVERIFY(Test::waitForWaylandPointer());
@ -194,14 +194,14 @@ void TestXdgShellClient::init()
KWin::Cursors::self()->mouse()->setPos(QPoint(640, 512));
}
void TestXdgShellClient::cleanup()
void TestXdgShellWindow::cleanup()
{
Test::destroyWaylandConnection();
}
void TestXdgShellClient::testMapUnmap()
void TestXdgShellWindow::testMapUnmap()
{
// This test verifies that the compositor destroys XdgToplevelClient when the
// This test verifies that the compositor destroys XdgToplevelWindow when the
// associated xdg_toplevel surface is unmapped.
// Create a wl_surface and an xdg_toplevel, but don't commit them yet!
@ -262,7 +262,7 @@ void TestXdgShellClient::testMapUnmap()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testDesktopPresenceChanged()
void TestXdgShellWindow::testDesktopPresenceChanged()
{
// this test verifies that the desktop presence changed signals are properly emitted
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
@ -295,7 +295,7 @@ void TestXdgShellClient::testDesktopPresenceChanged()
QCOMPARE(desktopPresenceChangedEffectsSpy.first().at(2).toInt(), 2);
}
void TestXdgShellClient::testWindowOutputs()
void TestXdgShellWindow::testWindowOutputs()
{
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data()));
@ -332,7 +332,7 @@ void TestXdgShellClient::testWindowOutputs()
QCOMPARE(surface->outputs().first()->globalPosition(), QPoint(1280, 0));
}
void TestXdgShellClient::testMinimizeActiveWindow()
void TestXdgShellWindow::testMinimizeActiveWindow()
{
// this test verifies that when minimizing the active window it gets deactivated
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
@ -363,7 +363,7 @@ void TestXdgShellClient::testMinimizeActiveWindow()
QCOMPARE(workspace()->activeClient(), c);
}
void TestXdgShellClient::testFullscreen_data()
void TestXdgShellWindow::testFullscreen_data()
{
QTest::addColumn<Test::XdgToplevelDecorationV1::mode>("decoMode");
@ -371,7 +371,7 @@ void TestXdgShellClient::testFullscreen_data()
QTest::newRow("server-side deco") << Test::XdgToplevelDecorationV1::mode_server_side;
}
void TestXdgShellClient::testFullscreen()
void TestXdgShellWindow::testFullscreen()
{
// this test verifies that a window can be properly fullscreened
@ -452,7 +452,7 @@ void TestXdgShellClient::testFullscreen()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testUserCanSetFullscreen()
void TestXdgShellWindow::testUserCanSetFullscreen()
{
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data()));
@ -463,7 +463,7 @@ void TestXdgShellClient::testUserCanSetFullscreen()
QVERIFY(c->userCanSetFullScreen());
}
void TestXdgShellClient::testMaximizedToFullscreen_data()
void TestXdgShellWindow::testMaximizedToFullscreen_data()
{
QTest::addColumn<Test::XdgToplevelDecorationV1::mode>("decoMode");
@ -471,7 +471,7 @@ void TestXdgShellClient::testMaximizedToFullscreen_data()
QTest::newRow("server-side deco") << Test::XdgToplevelDecorationV1::mode_server_side;
}
void TestXdgShellClient::testMaximizedToFullscreen()
void TestXdgShellWindow::testMaximizedToFullscreen()
{
// this test verifies that a window can be properly fullscreened after maximizing
@ -562,7 +562,7 @@ void TestXdgShellClient::testMaximizedToFullscreen()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testFullscreenMultipleOutputs()
void TestXdgShellWindow::testFullscreenMultipleOutputs()
{
// this test verifies that kwin will place fullscreen windows in the outputs its instructed to
@ -615,7 +615,7 @@ void TestXdgShellClient::testFullscreenMultipleOutputs()
}
}
void TestXdgShellClient::testHidden()
void TestXdgShellWindow::testHidden()
{
// this test verifies that when hiding window it doesn't get shown
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
@ -643,7 +643,7 @@ void TestXdgShellClient::testHidden()
// QCOMPARE(workspace()->activeClient(), c);
}
void TestXdgShellClient::testDesktopFileName()
void TestXdgShellWindow::testDesktopFileName()
{
QIcon::setThemeName(QStringLiteral("breeze"));
// this test verifies that desktop file name is passed correctly to the window
@ -655,7 +655,7 @@ void TestXdgShellClient::testDesktopFileName()
QVERIFY(c);
QCOMPARE(c->desktopFileName(), QByteArrayLiteral("org.kde.foo"));
QCOMPARE(c->resourceClass(), QByteArrayLiteral("org.kde.foo"));
QVERIFY(c->resourceName().startsWith("testXdgShellClient"));
QVERIFY(c->resourceName().startsWith("testXdgShellWindow"));
// the desktop file does not exist, so icon should be generic Wayland
QCOMPARE(c->icon().name(), QStringLiteral("wayland"));
@ -667,7 +667,7 @@ void TestXdgShellClient::testDesktopFileName()
QVERIFY(desktopFileNameChangedSpy.wait());
QCOMPARE(c->desktopFileName(), QByteArrayLiteral("org.kde.bar"));
QCOMPARE(c->resourceClass(), QByteArrayLiteral("org.kde.bar"));
QVERIFY(c->resourceName().startsWith("testXdgShellClient"));
QVERIFY(c->resourceName().startsWith("testXdgShellWindow"));
// icon should still be wayland
QCOMPARE(c->icon().name(), QStringLiteral("wayland"));
QVERIFY(iconChangedSpy.isEmpty());
@ -680,7 +680,7 @@ void TestXdgShellClient::testDesktopFileName()
QCOMPARE(c->icon().name(), QStringLiteral("kwin"));
}
void TestXdgShellClient::testCaptionSimplified()
void TestXdgShellWindow::testCaptionSimplified()
{
// this test verifies that caption is properly trimmed
// see BUG 323798 comment #12
@ -695,7 +695,7 @@ void TestXdgShellClient::testCaptionSimplified()
QCOMPARE(c->caption(), origTitle.simplified());
}
void TestXdgShellClient::testCaptionMultipleWindows()
void TestXdgShellWindow::testCaptionMultipleWindows()
{
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data()));
@ -742,7 +742,7 @@ void TestXdgShellClient::testCaptionMultipleWindows()
QCOMPARE(c4->captionSuffix(), QStringLiteral(" <4>"));
}
void TestXdgShellClient::testUnresponsiveWindow_data()
void TestXdgShellWindow::testUnresponsiveWindow_data()
{
QTest::addColumn<QString>("shellInterface"); // see env selection in qwaylandintegration.cpp
QTest::addColumn<bool>("socketMode");
@ -751,7 +751,7 @@ void TestXdgShellClient::testUnresponsiveWindow_data()
QTest::newRow("xdg socket") << "xdg-shell" << true;
}
void TestXdgShellClient::testUnresponsiveWindow()
void TestXdgShellWindow::testUnresponsiveWindow()
{
// this test verifies that killWindow properly terminates a process
// for this an external binary is launched
@ -826,7 +826,7 @@ void TestXdgShellClient::testUnresponsiveWindow()
QVERIFY(elapsed2 > 1800); // second ping comes in a second later
}
void TestXdgShellClient::testAppMenu()
void TestXdgShellWindow::testAppMenu()
{
// register a faux appmenu client
QVERIFY(QDBusConnection::sessionBus().registerService("org.kde.kappmenu"));
@ -846,7 +846,7 @@ void TestXdgShellClient::testAppMenu()
QVERIFY(QDBusConnection::sessionBus().unregisterService("org.kde.kappmenu"));
}
void TestXdgShellClient::testSendClientWithTransientToDesktop()
void TestXdgShellWindow::testSendClientWithTransientToDesktop()
{
// this test verifies that when sending a client to a desktop all transients are also send to that desktop
@ -897,7 +897,7 @@ void TestXdgShellClient::testSendClientWithTransientToDesktop()
QCOMPARE(transient->desktops(), QVector<VirtualDesktop *>{desktops[0]});
}
void TestXdgShellClient::testMinimizeWindowWithTransients()
void TestXdgShellWindow::testMinimizeWindowWithTransients()
{
// this test verifies that when minimizing/unminimizing a window all its
// transients will be minimized/unminimized as well
@ -930,7 +930,7 @@ void TestXdgShellClient::testMinimizeWindowWithTransients()
QVERIFY(!transient->isMinimized());
}
void TestXdgShellClient::testXdgDecoration_data()
void TestXdgShellWindow::testXdgDecoration_data()
{
QTest::addColumn<Test::XdgToplevelDecorationV1::mode>("requestedMode");
QTest::addColumn<Test::XdgToplevelDecorationV1::mode>("expectedMode");
@ -939,7 +939,7 @@ void TestXdgShellClient::testXdgDecoration_data()
QTest::newRow("server side requested") << Test::XdgToplevelDecorationV1::mode_server_side << Test::XdgToplevelDecorationV1::mode_server_side;
}
void TestXdgShellClient::testXdgDecoration()
void TestXdgShellWindow::testXdgDecoration()
{
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data()));
@ -966,14 +966,14 @@ void TestXdgShellClient::testXdgDecoration()
QCOMPARE(c->isDecorated(), expectedMode == Test::XdgToplevelDecorationV1::mode_server_side);
}
void TestXdgShellClient::testXdgNeverCommitted()
void TestXdgShellWindow::testXdgNeverCommitted()
{
// check we don't crash if we create a shell object but delete the XdgShellClient before committing it
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data(), Test::CreationSetup::CreateOnly));
}
void TestXdgShellClient::testXdgInitialState()
void TestXdgShellWindow::testXdgInitialState()
{
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data(), Test::CreationSetup::CreateOnly));
@ -994,7 +994,7 @@ void TestXdgShellClient::testXdgInitialState()
QCOMPARE(c->size(), QSize(200, 100));
}
void TestXdgShellClient::testXdgInitiallyMaximised()
void TestXdgShellWindow::testXdgInitiallyMaximised()
{
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data(), Test::CreationSetup::CreateOnly));
@ -1021,7 +1021,7 @@ void TestXdgShellClient::testXdgInitiallyMaximised()
QCOMPARE(c->size(), QSize(1280, 1024));
}
void TestXdgShellClient::testXdgInitiallyFullscreen()
void TestXdgShellWindow::testXdgInitiallyFullscreen()
{
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data(), Test::CreationSetup::CreateOnly));
@ -1048,7 +1048,7 @@ void TestXdgShellClient::testXdgInitiallyFullscreen()
QCOMPARE(c->size(), QSize(1280, 1024));
}
void TestXdgShellClient::testXdgInitiallyMinimized()
void TestXdgShellWindow::testXdgInitiallyMinimized()
{
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
QScopedPointer<Test::XdgToplevel> shellSurface(Test::createXdgToplevelSurface(surface.data(), Test::CreationSetup::CreateOnly));
@ -1074,7 +1074,7 @@ void TestXdgShellClient::testXdgInitiallyMinimized()
QVERIFY(c->isMinimized());
}
void TestXdgShellClient::testXdgWindowGeometryIsntSet()
void TestXdgShellWindow::testXdgWindowGeometryIsntSet()
{
// This test verifies that the effective window geometry corresponds to the
// bounding rectangle of the main surface and its sub-surfaces if no window
@ -1111,7 +1111,7 @@ void TestXdgShellClient::testXdgWindowGeometryIsntSet()
QCOMPARE(client->bufferGeometry().size(), QSize(100, 50));
}
void TestXdgShellClient::testXdgWindowGeometryAttachBuffer()
void TestXdgShellWindow::testXdgWindowGeometryAttachBuffer()
{
// This test verifies that the effective window geometry remains the same when
// a new buffer is attached and xdg_surface.set_window_geometry is not called
@ -1159,7 +1159,7 @@ void TestXdgShellClient::testXdgWindowGeometryAttachBuffer()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testXdgWindowGeometryAttachSubSurface()
void TestXdgShellWindow::testXdgWindowGeometryAttachSubSurface()
{
// This test verifies that the effective window geometry remains the same
// when a new sub-surface is added and xdg_surface.set_window_geometry is
@ -1204,7 +1204,7 @@ void TestXdgShellClient::testXdgWindowGeometryAttachSubSurface()
QCOMPARE(client->bufferGeometry().size(), QSize(200, 100));
}
void TestXdgShellClient::testXdgWindowGeometryInteractiveResize()
void TestXdgShellWindow::testXdgWindowGeometryInteractiveResize()
{
// This test verifies that correct window geometry is provided along each
// configure event when an xdg-shell is being interactively resized.
@ -1297,7 +1297,7 @@ void TestXdgShellClient::testXdgWindowGeometryInteractiveResize()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testXdgWindowGeometryFullScreen()
void TestXdgShellWindow::testXdgWindowGeometryFullScreen()
{
// This test verifies that an xdg-shell receives correct window geometry when
// its fullscreen state gets changed.
@ -1354,7 +1354,7 @@ void TestXdgShellClient::testXdgWindowGeometryFullScreen()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testXdgWindowGeometryMaximize()
void TestXdgShellWindow::testXdgWindowGeometryMaximize()
{
// This test verifies that an xdg-shell receives correct window geometry when
// its maximized state gets changed.
@ -1411,9 +1411,9 @@ void TestXdgShellClient::testXdgWindowGeometryMaximize()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testPointerInputTransform()
void TestXdgShellWindow::testPointerInputTransform()
{
// This test verifies that XdgToplevelClient provides correct input transform matrix.
// This test verifies that XdgToplevelWindow provides correct input transform matrix.
// The input transform matrix is used by seat to map pointer events from the global
// screen coordinates to the surface-local coordinates.
@ -1470,7 +1470,7 @@ void TestXdgShellClient::testPointerInputTransform()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testReentrantSetFrameGeometry()
void TestXdgShellWindow::testReentrantSetFrameGeometry()
{
// This test verifies that calling moveResize() from a slot connected directly
// to the frameGeometryChanged() signal won't cause an infinite recursion.
@ -1498,7 +1498,7 @@ void TestXdgShellClient::testReentrantSetFrameGeometry()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testDoubleMaximize()
void TestXdgShellWindow::testDoubleMaximize()
{
// This test verifies that the case where a client issues two set_maximized() requests
// separated by the initial commit is handled properly.
@ -1533,7 +1533,7 @@ void TestXdgShellClient::testDoubleMaximize()
QVERIFY(states.testFlag(Test::XdgToplevel::State::Maximized));
}
void TestXdgShellClient::testDoubleFullscreenSeparatedByCommit()
void TestXdgShellWindow::testDoubleFullscreenSeparatedByCommit()
{
// Some applications do weird things at startup and this is one of them. This test verifies
// that the window will have good frame geometry if the client has issued several
@ -1566,7 +1566,7 @@ void TestXdgShellClient::testDoubleFullscreenSeparatedByCommit()
QCOMPARE(client->frameGeometry(), QRect(0, 0, 1280, 1024));
}
void TestXdgShellClient::testMaximizeHorizontal()
void TestXdgShellWindow::testMaximizeHorizontal()
{
// Create the test client.
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
@ -1646,7 +1646,7 @@ void TestXdgShellClient::testMaximizeHorizontal()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testMaximizeVertical()
void TestXdgShellWindow::testMaximizeVertical()
{
// Create the test client.
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
@ -1726,7 +1726,7 @@ void TestXdgShellClient::testMaximizeVertical()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testMaximizeFull()
void TestXdgShellWindow::testMaximizeFull()
{
// Create the test client.
QScopedPointer<KWayland::Client::Surface> surface(Test::createSurface());
@ -1806,7 +1806,7 @@ void TestXdgShellClient::testMaximizeFull()
QVERIFY(Test::waitForWindowDestroyed(client));
}
void TestXdgShellClient::testMaximizeAndChangeDecorationModeAfterInitialCommit()
void TestXdgShellWindow::testMaximizeAndChangeDecorationModeAfterInitialCommit()
{
// Ideally, the app would initialize the xdg-toplevel surface before the initial commit, but
// many don't do it. They initialize the surface after the first commit.
@ -1834,7 +1834,7 @@ void TestXdgShellClient::testMaximizeAndChangeDecorationModeAfterInitialCommit()
QCOMPARE(toplevelConfigureRequestedSpy.last().at(1).value<Test::XdgToplevel::States>(), Test::XdgToplevel::State::Maximized);
}
void TestXdgShellClient::testFullScreenAndChangeDecorationModeAfterInitialCommit()
void TestXdgShellWindow::testFullScreenAndChangeDecorationModeAfterInitialCommit()
{
// Ideally, the app would initialize the xdg-toplevel surface before the initial commit, but
// many don't do it. They initialize the surface after the first commit.
@ -1862,7 +1862,7 @@ void TestXdgShellClient::testFullScreenAndChangeDecorationModeAfterInitialCommit
QCOMPARE(toplevelConfigureRequestedSpy.last().at(1).value<Test::XdgToplevel::States>(), Test::XdgToplevel::State::Fullscreen);
}
void TestXdgShellClient::testChangeDecorationModeAfterInitialCommit()
void TestXdgShellWindow::testChangeDecorationModeAfterInitialCommit()
{
// This test verifies that the compositor will respond with a good configure event when
// the decoration mode changes after the first surface commit but before the surface is mapped.
@ -1889,5 +1889,5 @@ void TestXdgShellClient::testChangeDecorationModeAfterInitialCommit()
QCOMPARE(decorationConfigureRequestedSpy.last().at(0).value<Test::XdgToplevelDecorationV1::mode>(), Test::XdgToplevelDecorationV1::mode_client_side);
}
WAYLANDTEST_MAIN(TestXdgShellClient)
#include "xdgshellclient_test.moc"
WAYLANDTEST_MAIN(TestXdgShellWindow)
#include "xdgshellwindow_test.moc"

View file

@ -155,8 +155,8 @@ target_sources(kwin PRIVATE
x11window.cpp
xcursortheme.cpp
xdgactivationv1.cpp
xdgshellclient.cpp
xdgshellintegration.cpp
xdgshellwindow.cpp
xkb.cpp
xwaylandclient.cpp
xwayland/xwayland_interface.cpp

View file

@ -45,7 +45,7 @@ void XdgShellInterfacePrivate::unregisterXdgSurface(XdgSurfaceInterface *surface
/**
* @todo Whether the ping is delayed or has timed out is out of domain of the XdgShellInterface.
* Such matter must be handled somewhere else, e.g. XdgToplevelClient, not here!
* Such matter must be handled somewhere else, e.g. XdgToplevelWindow, not here!
*/
void XdgShellInterfacePrivate::registerPing(quint32 serial)
{

View file

@ -66,8 +66,8 @@
#include "workspace.h"
#include "x11window.h"
#include "xdgactivationv1.h"
#include "xdgshellclient.h"
#include "xdgshellintegration.h"
#include "xdgshellwindow.h"
// Qt
#include <QCryptographicHash>
@ -229,7 +229,7 @@ void WaylandServer::registerShellClient(Window *client)
m_clients << client;
}
void WaylandServer::registerXdgToplevelClient(XdgToplevelClient *client)
void WaylandServer::registerXdgToplevelWindow(XdgToplevelWindow *client)
{
// TODO: Find a better way and more generic to install extensions.
@ -260,12 +260,12 @@ void WaylandServer::registerXdgToplevelClient(XdgToplevelClient *client)
void WaylandServer::registerXdgGenericClient(Window *client)
{
XdgToplevelClient *toplevelClient = qobject_cast<XdgToplevelClient *>(client);
XdgToplevelWindow *toplevelClient = qobject_cast<XdgToplevelWindow *>(client);
if (toplevelClient) {
registerXdgToplevelClient(toplevelClient);
registerXdgToplevelWindow(toplevelClient);
return;
}
XdgPopupClient *popupClient = qobject_cast<XdgPopupClient *>(client);
XdgPopupWindow *popupClient = qobject_cast<XdgPopupWindow *>(client);
if (popupClient) {
registerShellClient(popupClient);
if (auto shellSurface = PlasmaShellSurfaceInterface::get(client->surface())) {
@ -405,7 +405,7 @@ bool WaylandServer::init(InitializationFlags flags)
m_xdgDecorationManagerV1 = new XdgDecorationManagerV1Interface(m_display, m_display);
connect(m_xdgDecorationManagerV1, &XdgDecorationManagerV1Interface::decorationCreated, this, [this](XdgToplevelDecorationV1Interface *decoration) {
if (XdgToplevelClient *toplevel = findXdgToplevelClient(decoration->toplevel()->surface())) {
if (XdgToplevelWindow *toplevel = findXdgToplevelWindow(decoration->toplevel()->surface())) {
toplevel->installXdgDecoration(decoration);
}
});
@ -425,19 +425,19 @@ bool WaylandServer::init(InitializationFlags flags)
new IdleInhibitManagerV1Interface(m_display, m_display);
m_plasmaShell = new PlasmaShellInterface(m_display, m_display);
connect(m_plasmaShell, &PlasmaShellInterface::surfaceCreated, this, [this](PlasmaShellSurfaceInterface *surface) {
if (XdgSurfaceClient *client = findXdgSurfaceClient(surface->surface())) {
if (XdgSurfaceWindow *client = findXdgSurfaceWindow(surface->surface())) {
client->installPlasmaShellSurface(surface);
}
});
m_appMenuManager = new AppMenuManagerInterface(m_display, m_display);
connect(m_appMenuManager, &AppMenuManagerInterface::appMenuCreated, this, [this](AppMenuInterface *appMenu) {
if (XdgToplevelClient *client = findXdgToplevelClient(appMenu->surface())) {
if (XdgToplevelWindow *client = findXdgToplevelWindow(appMenu->surface())) {
client->installAppMenu(appMenu);
}
});
m_paletteManager = new ServerSideDecorationPaletteManagerInterface(m_display, m_display);
connect(m_paletteManager, &ServerSideDecorationPaletteManagerInterface::paletteCreated, this, [this](ServerSideDecorationPaletteInterface *palette) {
if (XdgToplevelClient *client = findXdgToplevelClient(palette->surface())) {
if (XdgToplevelWindow *client = findXdgToplevelWindow(palette->surface())) {
client->installPalette(palette);
}
});
@ -476,7 +476,7 @@ bool WaylandServer::init(InitializationFlags flags)
m_decorationManager = new ServerSideDecorationManagerInterface(m_display, m_display);
connect(m_decorationManager, &ServerSideDecorationManagerInterface::decorationCreated, this, [this](ServerSideDecorationInterface *decoration) {
if (XdgToplevelClient *client = findXdgToplevelClient(decoration->surface())) {
if (XdgToplevelWindow *client = findXdgToplevelWindow(decoration->surface())) {
client->installServerDecoration(decoration);
}
});
@ -708,14 +708,14 @@ Window *WaylandServer::findClient(const KWaylandServer::SurfaceInterface *surfac
return nullptr;
}
XdgToplevelClient *WaylandServer::findXdgToplevelClient(SurfaceInterface *surface) const
XdgToplevelWindow *WaylandServer::findXdgToplevelWindow(SurfaceInterface *surface) const
{
return qobject_cast<XdgToplevelClient *>(findClient(surface));
return qobject_cast<XdgToplevelWindow *>(findClient(surface));
}
XdgSurfaceClient *WaylandServer::findXdgSurfaceClient(SurfaceInterface *surface) const
XdgSurfaceWindow *WaylandServer::findXdgSurfaceWindow(SurfaceInterface *surface) const
{
return qobject_cast<XdgSurfaceClient *>(findClient(surface));
return qobject_cast<XdgSurfaceWindow *>(findClient(surface));
}
bool WaylandServer::isScreenLocked() const

View file

@ -55,9 +55,9 @@ namespace KWin
class Window;
class Output;
class XdgPopupClient;
class XdgSurfaceClient;
class XdgToplevelClient;
class XdgPopupWindow;
class XdgSurfaceWindow;
class XdgToplevelWindow;
class WaylandOutput;
class WaylandOutputDevice;
@ -144,8 +144,8 @@ public:
}
void removeClient(Window *c);
Window *findClient(const KWaylandServer::SurfaceInterface *surface) const;
XdgToplevelClient *findXdgToplevelClient(KWaylandServer::SurfaceInterface *surface) const;
XdgSurfaceClient *findXdgSurfaceClient(KWaylandServer::SurfaceInterface *surface) const;
XdgToplevelWindow *findXdgToplevelWindow(KWaylandServer::SurfaceInterface *surface) const;
XdgSurfaceWindow *findXdgSurfaceWindow(KWaylandServer::SurfaceInterface *surface) const;
/**
* @returns a transient parent of a surface imported with the foreign protocol, if any
@ -244,8 +244,8 @@ private:
void shellClientShown(Window *t);
void initScreenLocker();
void registerXdgGenericClient(Window *client);
void registerXdgToplevelClient(XdgToplevelClient *client);
void registerXdgPopupClient(XdgPopupClient *client);
void registerXdgToplevelWindow(XdgToplevelWindow *client);
void registerXdgPopupWindow(XdgPopupWindow *client);
void registerShellClient(Window *client);
void handleOutputAdded(Output *output);
void handleOutputRemoved(Output *output);

View file

@ -9,7 +9,7 @@
#include "wayland/xdgshell_interface.h"
#include "wayland_server.h"
#include "workspace.h"
#include "xdgshellclient.h"
#include "xdgshellwindow.h"
using namespace KWaylandServer;
@ -20,11 +20,11 @@ namespace KWin
* The WaylandXdgShellIntegration class is a factory class for xdg-shell clients.
*
* The xdg-shell protocol defines two surface roles - xdg_toplevel and xdg_popup. On the
* compositor side, those roles are represented by XdgToplevelClient and XdgPopupClient,
* compositor side, those roles are represented by XdgToplevelWindow and XdgPopupWindow,
* respectively.
*
* WaylandXdgShellIntegration monitors for new xdg_toplevel and xdg_popup objects. If it
* detects one, it will create an XdgToplevelClient or XdgPopupClient based on the current
* detects one, it will create an XdgToplevelWindow or XdgPopupWindow based on the current
* surface role of the underlying xdg_surface object.
*/
@ -42,18 +42,18 @@ XdgShellIntegration::XdgShellIntegration(QObject *parent)
void XdgShellIntegration::registerXdgToplevel(XdgToplevelInterface *toplevel)
{
// Note that the client is going to be destroyed and immediately re-created when the
// underlying surface is unmapped. XdgToplevelClient is re-created right away since
// underlying surface is unmapped. XdgToplevelWindow is re-created right away since
// we don't want too loose any client requests that are allowed to be sent prior to
// the first initial commit, e.g. set_maximized or set_fullscreen.
connect(toplevel, &XdgToplevelInterface::resetOccurred,
this, [this, toplevel] {
createXdgToplevelClient(toplevel);
createXdgToplevelWindow(toplevel);
});
createXdgToplevelClient(toplevel);
createXdgToplevelWindow(toplevel);
}
void XdgShellIntegration::createXdgToplevelClient(XdgToplevelInterface *toplevel)
void XdgShellIntegration::createXdgToplevelWindow(XdgToplevelInterface *toplevel)
{
if (!workspace()) {
qCWarning(KWIN_CORE, "An xdg-toplevel surface has been created while the compositor "
@ -61,7 +61,7 @@ void XdgShellIntegration::createXdgToplevelClient(XdgToplevelInterface *toplevel
return;
}
Q_EMIT clientCreated(new XdgToplevelClient(toplevel));
Q_EMIT clientCreated(new XdgToplevelWindow(toplevel));
}
void XdgShellIntegration::registerXdgPopup(XdgPopupInterface *popup)
@ -72,7 +72,7 @@ void XdgShellIntegration::registerXdgPopup(XdgPopupInterface *popup)
return;
}
Q_EMIT clientCreated(new XdgPopupClient(popup));
Q_EMIT clientCreated(new XdgPopupWindow(popup));
}
} // namespace KWin

View file

@ -27,7 +27,7 @@ public:
private:
void registerXdgToplevel(KWaylandServer::XdgToplevelInterface *toplevel);
void registerXdgPopup(KWaylandServer::XdgPopupInterface *popup);
void createXdgToplevelClient(KWaylandServer::XdgToplevelInterface *surface);
void createXdgToplevelWindow(KWaylandServer::XdgToplevelInterface *surface);
};
} // namespace KWin

File diff suppressed because it is too large Load diff

View file

@ -50,13 +50,13 @@ public:
ConfigureFlags flags;
};
class XdgSurfaceClient : public WaylandWindow
class XdgSurfaceWindow : public WaylandWindow
{
Q_OBJECT
public:
explicit XdgSurfaceClient(KWaylandServer::XdgSurfaceInterface *shellSurface);
~XdgSurfaceClient() override;
explicit XdgSurfaceWindow(KWaylandServer::XdgSurfaceInterface *shellSurface);
~XdgSurfaceWindow() override;
NET::WindowType windowType(bool direct = false, int supported_types = 0) const override;
QRect frameRectToBufferRect(const QRect &rect) const override;
@ -111,7 +111,7 @@ public:
KWaylandServer::XdgToplevelInterface::States states;
};
class XdgToplevelClient final : public XdgSurfaceClient
class XdgToplevelWindow final : public XdgSurfaceWindow
{
Q_OBJECT
@ -127,8 +127,8 @@ class XdgToplevelClient final : public XdgSurfaceClient
};
public:
explicit XdgToplevelClient(KWaylandServer::XdgToplevelInterface *shellSurface);
~XdgToplevelClient() override;
explicit XdgToplevelWindow(KWaylandServer::XdgToplevelInterface *shellSurface);
~XdgToplevelWindow() override;
KWaylandServer::XdgToplevelInterface *shellSurface() const;
@ -236,13 +236,13 @@ private:
QSharedPointer<KDecoration2::Decoration> m_nextDecoration;
};
class XdgPopupClient final : public XdgSurfaceClient
class XdgPopupWindow final : public XdgSurfaceWindow
{
Q_OBJECT
public:
explicit XdgPopupClient(KWaylandServer::XdgPopupInterface *shellSurface);
~XdgPopupClient() override;
explicit XdgPopupWindow(KWaylandServer::XdgPopupInterface *shellSurface);
~XdgPopupWindow() override;
bool hasPopupGrab() const override;
void popupDone() override;