Commit 4b91c616 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Rename XdgShellClient to XdgShellWindow

The word "client" means different things in wayland and kwin. Use a
better word to refer to windows.
parent a21aa839
......@@ -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)
......
......@@ -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
......
......@@ -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)
{
......
......@@ -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
......
......@@ -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);
......
......@@ -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
......@@ -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
......@@ -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;
......
Supports Markdown
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