diff --git a/main_wayland.cpp b/main_wayland.cpp index 7e155a5c1d..4f5ee18a1e 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -206,7 +206,6 @@ void ApplicationWayland::continueStartupWithX() Xcb::sync(); // Trigger possible errors, there's still a chance to abort notifyKSplash(); - waylandServer()->createDummyQtWindow(); } void ApplicationWayland::createX11Connection() diff --git a/wayland_server.cpp b/wayland_server.cpp index 5f1df67ea5..c332791ea3 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -115,10 +115,6 @@ void WaylandServer::init(const QByteArray &socketName) } if (surface->client() == m_internalConnection.server) { // one of Qt's windows - if (m_dummyWindowSurface && (m_dummyWindowSurface->id() == surface->surface()->id())) { - fakeDummyQtWindowInput(); - return; - } // HACK: in order to get Qt to not block for frame rendered, we immediatelly emit the // frameRendered once we get a new damage event. auto s = surface->surface(); @@ -310,37 +306,6 @@ void WaylandServer::removeClient(ShellClient *c) emit shellClientRemoved(c); } -void WaylandServer::createDummyQtWindow() -{ - if (m_dummyWindow) { - return; - } - m_dummyWindow.reset(new QWindow()); - m_dummyWindow->setSurfaceType(QSurface::RasterSurface); - m_dummyWindow->show(); - m_dummyWindowSurface = KWayland::Client::Surface::fromWindow(m_dummyWindow.data()); -} - -void WaylandServer::fakeDummyQtWindowInput() -{ - // we need to fake Qt into believing it has got any seat events - // this is done only when receiving either a key press or button. - // we simulate by sending a button press and release - auto surface = KWayland::Server::SurfaceInterface::get(m_dummyWindowSurface->id(), m_internalConnection.server); - if (!surface) { - return; - } - const auto oldSeatSurface = m_seat->focusedPointerSurface(); - const auto oldPos = m_seat->focusedPointerSurfacePosition(); - m_seat->setFocusedPointerSurface(surface, QPoint(0, 0)); - m_seat->setPointerPos(QPointF(0, 0)); - m_seat->pointerButtonPressed(Qt::LeftButton); - m_seat->pointerButtonReleased(Qt::LeftButton); - m_internalConnection.server->flush(); - m_dummyWindow->hide(); - m_seat->setFocusedPointerSurface(oldSeatSurface, oldPos); -} - void WaylandServer::dispatch() { if (!m_display) { diff --git a/wayland_server.h b/wayland_server.h index 85ae4a7018..57fec168ba 100644 --- a/wayland_server.h +++ b/wayland_server.h @@ -109,7 +109,6 @@ public: int createInputMethodConnection(); void createInternalConnection(); - void createDummyQtWindow(); void initWorkspace(); KWayland::Server::ClientConnection *xWaylandConnection() const { @@ -138,7 +137,6 @@ Q_SIGNALS: void shellClientRemoved(ShellClient*); private: - void fakeDummyQtWindowInput(); quint16 createClientId(KWayland::Server::ClientConnection *c); KWayland::Server::Display *m_display = nullptr; KWayland::Server::CompositorInterface *m_compositor = nullptr; @@ -160,8 +158,6 @@ private: AbstractBackend *m_backend = nullptr; QList m_clients; QList m_internalClients; - QScopedPointer m_dummyWindow; - KWayland::Client::Surface *m_dummyWindowSurface = nullptr; QHash m_clientIds; KWIN_SINGLETON(WaylandServer) };