Commit 45784b70 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[wayland] Get rid of some code duplication in XdgShellClient constructors

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D24332
parent 3ff0f378
...@@ -70,9 +70,7 @@ XdgShellClient::XdgShellClient(XdgShellSurfaceInterface *surface) ...@@ -70,9 +70,7 @@ XdgShellClient::XdgShellClient(XdgShellSurfaceInterface *surface)
, m_xdgShellPopup(nullptr) , m_xdgShellPopup(nullptr)
{ {
setSurface(surface->surface()); setSurface(surface->surface());
m_requestGeometryBlockCounter++;
init(); init();
connect(surface->surface(), &SurfaceInterface::committed, this, &XdgShellClient::finishInit);
} }
XdgShellClient::XdgShellClient(XdgShellPopupInterface *surface) XdgShellClient::XdgShellClient(XdgShellPopupInterface *surface)
...@@ -81,15 +79,15 @@ XdgShellClient::XdgShellClient(XdgShellPopupInterface *surface) ...@@ -81,15 +79,15 @@ XdgShellClient::XdgShellClient(XdgShellPopupInterface *surface)
, m_xdgShellPopup(surface) , m_xdgShellPopup(surface)
{ {
setSurface(surface->surface()); setSurface(surface->surface());
m_requestGeometryBlockCounter++;
init(); init();
connect(surface->surface(), &SurfaceInterface::committed, this, &XdgShellClient::finishInit);
} }
XdgShellClient::~XdgShellClient() = default; XdgShellClient::~XdgShellClient() = default;
void XdgShellClient::init() void XdgShellClient::init()
{ {
m_requestGeometryBlockCounter++;
connect(this, &XdgShellClient::desktopFileNameChanged, this, &XdgShellClient::updateIcon); connect(this, &XdgShellClient::desktopFileNameChanged, this, &XdgShellClient::updateIcon);
createWindowId(); createWindowId();
setupCompositing(); setupCompositing();
...@@ -173,6 +171,8 @@ void XdgShellClient::init() ...@@ -173,6 +171,8 @@ void XdgShellClient::init()
handleTransientForChanged(); handleTransientForChanged();
AbstractClient::updateColorScheme(QString()); AbstractClient::updateColorScheme(QString());
connect(surface(), &SurfaceInterface::committed, this, &XdgShellClient::finishInit);
} }
void XdgShellClient::finishInit() void XdgShellClient::finishInit()
......
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