From 603844cf98b939e8c478997448c147a4fc815f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 24 Apr 2015 12:00:19 +0200 Subject: [PATCH] [wayland] Allow the AbstractBackend subclasses to manage OutputInterfaces This gives the backend more control without needing to provide all information in Screens. --- abstract_backend.h | 8 ++++++++ wayland_server.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/abstract_backend.h b/abstract_backend.h index fdbcb81887..8ab841e774 100644 --- a/abstract_backend.h +++ b/abstract_backend.h @@ -58,6 +58,10 @@ public: } void markCursorAsRendered(); + bool handlesOutputs() const { + return m_handlesOutputs; + } + Q_SIGNALS: void cursorChanged(); @@ -66,6 +70,9 @@ protected: void setSoftWareCursor(bool set); void updateCursorFromServer(); void updateCursorImage(Qt::CursorShape shape); + void handleOutputs() { + m_handlesOutputs = true; + } private Q_SLOTS: void installThemeCursor(quint32 id, const QPoint &hotspot); @@ -79,6 +86,7 @@ private: QPoint lastRenderedPosition; } m_cursor; Wayland::WaylandCursorTheme *m_cursorTheme = nullptr; + bool m_handlesOutputs = false; }; } diff --git a/wayland_server.cpp b/wayland_server.cpp index 88c9b4e5c0..d8a9ab4344 100644 --- a/wayland_server.cpp +++ b/wayland_server.cpp @@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "wayland_server.h" +#include "abstract_backend.h" #include "screens.h" #include "toplevel.h" #include "workspace.h" @@ -84,6 +85,9 @@ void WaylandServer::init(const QByteArray &socketName) void WaylandServer::initOutputs() { + if (m_backend && m_backend->handlesOutputs()) { + return; + } Screens *s = screens(); Q_ASSERT(s); for (int i = 0; i < s->count(); ++i) {