[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kwin] /: Add XDG WmBase support
From:       David Edmundson <null () kde ! org>
Date:       2018-09-14 11:18:51
Message-ID: E1g0m7f-0004rG-Rr () code ! kde ! org
[Download RAW message or body]

Git commit fcf9acfec50539ebc10a2565863c349241a473a4 by David Edmundson.
Committed on 14/09/2018 at 11:18.
Pushed by davidedmundson into branch 'master'.

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

M  +2    -1    autotests/integration/kwin_wayland_test.h
M  +17   -1    autotests/integration/shell_client_test.cpp
M  +9    -4    wayland_server.cpp
M  +2    -1    wayland_server.h

https://commits.kde.org/kwin/fcf9acfec50539ebc10a2565863c349241a473a4

diff --git a/autotests/integration/kwin_wayland_test.h \
b/autotests/integration/kwin_wayland_test.h index 8a1ad5f9f..db3593b0b \
                100644
--- a/autotests/integration/kwin_wayland_test.h
+++ b/autotests/integration/kwin_wayland_test.h
@@ -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);
diff --git a/autotests/integration/shell_client_test.cpp \
b/autotests/integration/shell_client_test.cpp index c69291a2c..2e01da761 \
                100644
--- a/autotests/integration/shell_client_test.cpp
+++ b/autotests/integration/shell_client_test.cpp
@@ -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()
diff --git a/wayland_server.cpp b/wayland_server.cpp
index d1d9a7062..ad4367d05 100644
--- a/wayland_server.cpp
+++ b/wayland_server.cpp
@@ -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);
diff --git a/wayland_server.h b/wayland_server.h
index 44c542dd0..6751cdd4b 100644
--- a/wayland_server.h
+++ b/wayland_server.h
@@ -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;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic