Commit fcf9acfe authored by David Edmundson's avatar David Edmundson

Add XDG WmBase support

Test Plan:
Compiled latest GTK
Ran gtk4-demo and used WAYLAND_DEBUG to confirm it used the correct
shell
tested a top level and a popup

Reviewers: #plasma, romangg

Reviewed By: #plasma, romangg

Subscribers: romangg, mart, graesslin, zzag, kwin

Tags: #kwin
BUG: 398614
FIXED-IN: 5.15.0

Differential Revision: https://phabricator.kde.org/D13530
parent 525e96cc
......@@ -130,7 +130,8 @@ KWayland::Client::Surface *createSurface(QObject *parent = nullptr);
enum class ShellSurfaceType {
WlShell,
XdgShellV5,
XdgShellV6
XdgShellV6,
XdgShellStable
};
QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *surface, QObject *parent = nullptr);
KWayland::Client::ShellSurface *createShellSurface(KWayland::Client::Surface *surface, QObject *parent = nullptr);
......
......@@ -134,6 +134,7 @@ void TestShellClient::testMapUnmapMap_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testMapUnmapMap()
......@@ -297,6 +298,7 @@ void TestShellClient::testWindowOutputs_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testWindowOutputs()
......@@ -344,6 +346,7 @@ void TestShellClient::testMinimizeActiveWindow_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testMinimizeActiveWindow()
......@@ -386,11 +389,13 @@ void TestShellClient::testFullscreen_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell << ServerSideDecoration::Mode::Client;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5 << ServerSideDecoration::Mode::Client;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6 << ServerSideDecoration::Mode::Client;
QTest::newRow("xdgShellWmBase") << Test::ShellSurfaceType::XdgShellStable << ServerSideDecoration::Mode::Client;
QTest::newRow("wlShell - deco") << Test::ShellSurfaceType::WlShell << ServerSideDecoration::Mode::Server;
QTest::newRow("xdgShellV5 - deco") << Test::ShellSurfaceType::XdgShellV5 << ServerSideDecoration::Mode::Server;
QTest::newRow("xdgShellV6 - deco") << Test::ShellSurfaceType::XdgShellV6 << ServerSideDecoration::Mode::Server;
QTest::newRow("xdgShellWmBase - deco") << Test::ShellSurfaceType::XdgShellStable << ServerSideDecoration::Mode::Server;
}
void TestShellClient::testFullscreen()
......@@ -487,6 +492,8 @@ void TestShellClient::testUserCanSetFullscreen_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell << false;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5 << true;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6 << true;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable << true;
}
void TestShellClient::testUserCanSetFullscreen()
......@@ -523,6 +530,7 @@ void TestShellClient::testUserSetFullscreenXdgShell_data()
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testUserSetFullscreenXdgShell()
......@@ -579,10 +587,12 @@ void TestShellClient::testMaximizedToFullscreen_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell << ServerSideDecoration::Mode::Client;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5 << ServerSideDecoration::Mode::Client;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6 << ServerSideDecoration::Mode::Client;
QTest::newRow("xdgShellWmBase") << Test::ShellSurfaceType::XdgShellStable << ServerSideDecoration::Mode::Client;
QTest::newRow("wlShell - deco") << Test::ShellSurfaceType::WlShell << ServerSideDecoration::Mode::Server;
QTest::newRow("xdgShellV5 - deco") << Test::ShellSurfaceType::XdgShellV5 << ServerSideDecoration::Mode::Server;
QTest::newRow("xdgShellV6 - deco") << Test::ShellSurfaceType::XdgShellV6 << ServerSideDecoration::Mode::Server;
QTest::newRow("xdgShellWmBase - deco") << Test::ShellSurfaceType::XdgShellStable << ServerSideDecoration::Mode::Server;
}
void TestShellClient::testMaximizedToFullscreen()
......@@ -699,6 +709,7 @@ void TestShellClient::testWindowOpensLargerThanScreen_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testWindowOpensLargerThanScreen()
......@@ -736,6 +747,7 @@ void TestShellClient::testHidden_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testHidden()
......@@ -878,6 +890,8 @@ void TestShellClient::testUnresponsiveWindow_data()
QTest::newRow("xdgv5 socket") << "xdg-shell-v5" << true;
QTest::newRow("xdgv6 display") << "xdg-shell-v6" << false;
QTest::newRow("xdgv6 socket") << "xdg-shell-v6" << true;
//TODO add XDG WM Base when Kwin relies on Qt 5.12
}
void TestShellClient::testUnresponsiveWindow()
......@@ -955,6 +969,7 @@ void TestShellClient::testX11WindowId_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testX11WindowId()
......@@ -994,6 +1009,7 @@ void TestShellClient::testNoDecorationModeRequested_data()
QTest::newRow("wlShell") << Test::ShellSurfaceType::WlShell;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testNoDecorationModeRequested()
......
......@@ -215,17 +215,22 @@ bool WaylandServer::init(const QByteArray &socketName, InitalizationFlags flags)
m_shell = m_display->createShell(m_display);
m_shell->create();
connect(m_shell, &ShellInterface::surfaceCreated, this, &WaylandServer::createSurface<ShellSurfaceInterface>);
m_xdgShell = m_display->createXdgShell(XdgShellInterfaceVersion::UnstableV5, m_display);
m_xdgShell->create();
connect(m_xdgShell, &XdgShellInterface::surfaceCreated, this, &WaylandServer::createSurface<XdgShellSurfaceInterface>);
m_xdgShell5 = m_display->createXdgShell(XdgShellInterfaceVersion::UnstableV5, m_display);
m_xdgShell5->create();
connect(m_xdgShell5, &XdgShellInterface::surfaceCreated, this, &WaylandServer::createSurface<XdgShellSurfaceInterface>);
// TODO: verify seat and serial
connect(m_xdgShell, &XdgShellInterface::popupCreated, this, &WaylandServer::createSurface<XdgShellPopupInterface>);
connect(m_xdgShell5, &XdgShellInterface::popupCreated, this, &WaylandServer::createSurface<XdgShellPopupInterface>);
m_xdgShell6 = m_display->createXdgShell(XdgShellInterfaceVersion::UnstableV6, m_display);
m_xdgShell6->create();
connect(m_xdgShell6, &XdgShellInterface::surfaceCreated, this, &WaylandServer::createSurface<XdgShellSurfaceInterface>);
connect(m_xdgShell6, &XdgShellInterface::xdgPopupCreated, this, &WaylandServer::createSurface<XdgShellPopupInterface>);
m_xdgShell = m_display->createXdgShell(XdgShellInterfaceVersion::Stable, m_display);
m_xdgShell->create();
connect(m_xdgShell, &XdgShellInterface::surfaceCreated, this, &WaylandServer::createSurface<XdgShellSurfaceInterface>);
connect(m_xdgShell, &XdgShellInterface::xdgPopupCreated, this, &WaylandServer::createSurface<XdgShellPopupInterface>);
m_display->createShm();
m_seat = m_display->createSeat(m_display);
......
......@@ -222,8 +222,9 @@ private:
KWayland::Server::CompositorInterface *m_compositor = nullptr;
KWayland::Server::SeatInterface *m_seat = nullptr;
KWayland::Server::ShellInterface *m_shell = nullptr;
KWayland::Server::XdgShellInterface *m_xdgShell = nullptr;
KWayland::Server::XdgShellInterface *m_xdgShell5 = nullptr;
KWayland::Server::XdgShellInterface *m_xdgShell6 = nullptr;
KWayland::Server::XdgShellInterface *m_xdgShell = nullptr;
KWayland::Server::PlasmaShellInterface *m_plasmaShell = nullptr;
KWayland::Server::PlasmaWindowManagementInterface *m_windowManagement = nullptr;
KWayland::Server::QtSurfaceExtensionInterface *m_qtExtendedSurface = nullptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment