diff --git a/shell_client.cpp b/shell_client.cpp index f453bdec1a..3f08b31a7c 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -41,7 +41,6 @@ along with this program. If not, see . #include #include #include -#include #include #include #include @@ -67,20 +66,8 @@ using namespace KWayland::Server; namespace KWin { -ShellClient::ShellClient(ShellSurfaceInterface *surface) - : AbstractClient() - , m_shellSurface(surface) - , m_xdgShellSurface(nullptr) - , m_xdgShellPopup(nullptr) -{ - setSurface(surface->surface()); - init(); - m_isInitialized = true; -} - ShellClient::ShellClient(XdgShellSurfaceInterface *surface) : AbstractClient() - , m_shellSurface(nullptr) , m_xdgShellSurface(surface) , m_xdgShellPopup(nullptr) { @@ -92,7 +79,6 @@ ShellClient::ShellClient(XdgShellSurfaceInterface *surface) ShellClient::ShellClient(XdgShellPopupInterface *surface) : AbstractClient() - , m_shellSurface(nullptr) , m_xdgShellSurface(nullptr) , m_xdgShellPopup(surface) { @@ -186,11 +172,6 @@ void ShellClient::initSurface(T *shellSurface) ); connect(shellSurface, &T::maximizedChanged, this, [this] (bool maximized) { - if (m_shellSurface && isFullScreen()) { - // ignore for wl_shell - there it is mutual exclusive and messes with the geometry - return; - } - // If the maximized state of the client hasn't been changed due to a window // rule or because the requested state is the same as the current, then the // compositor still has to send a configure event. @@ -216,16 +197,7 @@ void ShellClient::init() updateIcon(); SurfaceInterface *s = surface(); Q_ASSERT(s); - if (s->buffer()) { - setReadyForPainting(); - if (shouldExposeToWindowManagement()) { - setupWindowManagementInterface(); - } - m_unmapped = false; - m_clientSize = s->size(); - } else { - ready_for_painting = false; - } + ready_for_painting = false; doSetGeometry(QRect(QPoint(0, 0), m_clientSize)); if (waylandServer()->inputMethodConnection() == s->client()) { m_windowType = NET::OnScreenDisplay; @@ -240,15 +212,7 @@ void ShellClient::init() connect(s, &SurfaceInterface::unmapped, this, &ShellClient::unmap); connect(s, &SurfaceInterface::unbound, this, &ShellClient::destroyClient); connect(s, &SurfaceInterface::destroyed, this, &ShellClient::destroyClient); - if (m_shellSurface) { - initSurface(m_shellSurface); - auto setPopup = [this] { - // TODO: verify grab serial - m_hasPopupGrab = m_shellSurface->isPopup(); - }; - connect(m_shellSurface, &ShellSurfaceInterface::popupChanged, this, setPopup); - setPopup(); - } else if (m_xdgShellSurface) { + if (m_xdgShellSurface) { initSurface(m_xdgShellSurface); auto global = static_cast(m_xdgShellSurface->global()); @@ -447,7 +411,6 @@ void ShellClient::destroyClient() deleted->unrefWindow(); - m_shellSurface = nullptr; m_xdgShellSurface = nullptr; m_xdgShellPopup = nullptr; deleteClient(this); @@ -666,7 +629,7 @@ void ShellClient::setGeometry(int x, int y, int w, int h, ForceGeometry_t force) const QSize requestedClientSize = newGeometry.size() - QSize(borderLeft() + borderRight(), borderTop() + borderBottom()); const QSize requestedWindowGeometrySize = toWindowGeometry(newGeometry.size()); - if (requestedClientSize == m_clientSize && !isWaitingForMoveResizeSync() && + if (requestedClientSize == m_clientSize && (m_requestedClientSize.isEmpty() || requestedWindowGeometrySize == m_requestedClientSize)) { // size didn't change, and we don't need to explicitly request a new size doSetGeometry(newGeometry); @@ -1013,13 +976,7 @@ void ShellClient::setFullScreen(bool set, bool user) if (wasFullscreen) { workspace()->updateFocusMousePosition(Cursor::pos()); // may cause leave event } else { - // in shell surface, maximise mode and fullscreen are exclusive - // fullscreen->toplevel should restore the state we had before maximising - if (m_shellSurface && m_maximizeMode == MaximizeMode::MaximizeFull) { - m_geomFsRestore = m_geomMaximizeRestore; - } else { - m_geomFsRestore = geometry(); - } + m_geomFsRestore = geometry(); } m_fullScreen = set; @@ -1140,12 +1097,6 @@ bool ShellClient::acceptsFocus() const // an unmapped window does not accept focus return false; } - if (m_shellSurface) { - if (m_shellSurface->isPopup()) { - return false; - } - return m_shellSurface->acceptsKeyboardFocus(); - } if (m_xdgShellSurface) { // TODO: proper return true; @@ -1190,9 +1141,6 @@ void ShellClient::requestGeometry(const QRect &rect) quint64 serialId = 0; - if (m_shellSurface && !size.isEmpty()) { - m_shellSurface->requestSize(size); - } if (m_xdgShellSurface) { serialId = m_xdgShellSurface->configure(xdgSurfaceStates(), size); } @@ -1257,9 +1205,6 @@ void ShellClient::resizeWithChecks(int w, int h, ForceGeometry_t force) if (h > area.height()) { h = area.height(); } - if (m_shellSurface) { - m_shellSurface->requestSize(QSize(w, h)); - } if (m_xdgShellSurface) { m_xdgShellSurface->configure(xdgSurfaceStates(), QSize(w, h)); } @@ -1526,9 +1471,6 @@ bool ShellClient::isTransient() const void ShellClient::setTransient() { SurfaceInterface *s = nullptr; - if (m_shellSurface) { - s = m_shellSurface->transientFor().data(); - } if (m_xdgShellSurface) { if (auto transient = m_xdgShellSurface->transientFor().data()) { s = transient->surface(); @@ -1555,8 +1497,7 @@ void ShellClient::setTransient() bool ShellClient::hasTransientPlacementHint() const { - return isTransient() && transientFor() != nullptr && - (m_shellSurface || m_xdgShellPopup); + return isTransient() && transientFor() && m_xdgShellPopup; } QRect ShellClient::transientPlacement(const QRect &bounds) const @@ -1589,12 +1530,7 @@ QRect ShellClient::transientPlacement(const QRect &bounds) const return true; }; - if (m_shellSurface) { - anchorRect = QRect(m_shellSurface->transientOffset(), QSize(1,1)); - anchorEdge = Qt::TopEdge | Qt::LeftEdge; - gravity = Qt::BottomEdge | Qt::RightEdge; //our single point represents the top left of the popup - constraintAdjustments = (PositionerConstraint::SlideX | PositionerConstraint::SlideY); - } else if (m_xdgShellPopup) { + if (m_xdgShellPopup) { anchorRect = m_xdgShellPopup->anchorRect(); anchorEdge = m_xdgShellPopup->anchorEdge(); gravity = m_xdgShellPopup->gravity(); @@ -1736,14 +1672,6 @@ QPoint ShellClient::popupOffset(const QRect &anchorRect, const Qt::Edges anchorE return anchorPoint + popupPosAdjust; } -bool ShellClient::isWaitingForMoveResizeSync() const -{ - if (m_shellSurface) { - return !m_pendingConfigureRequests.isEmpty(); - } - return false; -} - void ShellClient::doResizeSync() { requestGeometry(moveResizeGeometry()); @@ -1818,11 +1746,6 @@ bool ShellClient::shouldExposeToWindowManagement() if (m_xdgShellPopup) { return false; } - if (m_shellSurface) { - if (m_shellSurface->isTransient() && !m_shellSurface->acceptsKeyboardFocus()) { - return false; - } - } return true; } @@ -1904,9 +1827,6 @@ bool ShellClient::hasPopupGrab() const void ShellClient::popupDone() { - if (m_shellSurface) { - m_shellSurface->popupDone(); - } if (m_xdgShellPopup) { m_xdgShellPopup->popupDone(); } @@ -1932,13 +1852,11 @@ void ShellClient::updateWindowMargins() if (m_xdgShellSurface) { windowGeometry = m_xdgShellSurface->windowGeometry(); - } else if (m_xdgShellPopup) { + } else { windowGeometry = m_xdgShellPopup->windowGeometry(); if (!clientSize.isValid()) { clientSize = m_xdgShellPopup->initialSize(); } - } else { - return; } if (windowGeometry.isEmpty() || @@ -1958,9 +1876,6 @@ bool ShellClient::isPopupWindow() const if (Toplevel::isPopupWindow()) { return true; } - if (m_shellSurface != nullptr) { - return m_shellSurface->isPopup(); - } if (m_xdgShellPopup != nullptr) { return true; } diff --git a/shell_client.h b/shell_client.h index e6f840c2bf..822f3a9332 100644 --- a/shell_client.h +++ b/shell_client.h @@ -29,7 +29,6 @@ namespace KWayland { namespace Server { -class ShellSurfaceInterface; class ServerSideDecorationInterface; class ServerSideDecorationPaletteInterface; class AppMenuInterface; @@ -53,7 +52,6 @@ class KWIN_EXPORT ShellClient : public AbstractClient { Q_OBJECT public: - ShellClient(KWayland::Server::ShellSurfaceInterface *surface); ShellClient(KWayland::Server::XdgShellSurfaceInterface *surface); ShellClient(KWayland::Server::XdgShellPopupInterface *surface); ~ShellClient() override; @@ -171,7 +169,6 @@ protected: m_geomMaximizeRestore = geo; } void doResizeSync() override; - bool isWaitingForMoveResizeSync() const override; bool acceptsFocus() const override; void doMinimize() override; void updateCaption() override; @@ -213,7 +210,6 @@ private: QSize toWindowGeometry(const QSize &geometry) const; - KWayland::Server::ShellSurfaceInterface *m_shellSurface; KWayland::Server::XdgShellSurfaceInterface *m_xdgShellSurface; KWayland::Server::XdgShellPopupInterface *m_xdgShellPopup; diff --git a/wayland_server.cpp b/wayland_server.cpp index 36f873968b..1775247260 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -57,7 +57,6 @@ along with this program. If not, see . #include #include #include -#include #include #include #include @@ -312,9 +311,6 @@ 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); m_xdgShell5 = m_display->createXdgShell(XdgShellInterfaceVersion::UnstableV5, m_display); m_xdgShell5->create(); diff --git a/wayland_server.h b/wayland_server.h index dc0838a8d2..b4a840dc91 100644 --- a/wayland_server.h +++ b/wayland_server.h @@ -49,7 +49,6 @@ class CompositorInterface; class Display; class DataDeviceInterface; class IdleInterface; -class ShellInterface; class SeatInterface; class DataDeviceManagerInterface; class ServerSideDecorationManagerInterface; @@ -107,9 +106,6 @@ public: KWayland::Server::DataDeviceManagerInterface *dataDeviceManager() { return m_dataDeviceManager; } - KWayland::Server::ShellInterface *shell() { - return m_shell; - } KWayland::Server::PlasmaVirtualDesktopManagementInterface *virtualDesktopManagement() { return m_virtualDesktopManagement; } @@ -238,7 +234,6 @@ private: KWayland::Server::CompositorInterface *m_compositor = nullptr; KWayland::Server::SeatInterface *m_seat = nullptr; KWayland::Server::DataDeviceManagerInterface *m_dataDeviceManager = nullptr; - KWayland::Server::ShellInterface *m_shell = nullptr; KWayland::Server::XdgShellInterface *m_xdgShell5 = nullptr; KWayland::Server::XdgShellInterface *m_xdgShell6 = nullptr; KWayland::Server::XdgShellInterface *m_xdgShell = nullptr;