[wayland] Allow the AbstractBackend subclasses to manage OutputInterfaces

This gives the backend more control without needing to provide all
information in Screens.
This commit is contained in:
Martin Gräßlin 2015-04-24 12:00:19 +02:00
parent f775e13c6e
commit 603844cf98
2 changed files with 12 additions and 0 deletions

View file

@ -58,6 +58,10 @@ public:
} }
void markCursorAsRendered(); void markCursorAsRendered();
bool handlesOutputs() const {
return m_handlesOutputs;
}
Q_SIGNALS: Q_SIGNALS:
void cursorChanged(); void cursorChanged();
@ -66,6 +70,9 @@ protected:
void setSoftWareCursor(bool set); void setSoftWareCursor(bool set);
void updateCursorFromServer(); void updateCursorFromServer();
void updateCursorImage(Qt::CursorShape shape); void updateCursorImage(Qt::CursorShape shape);
void handleOutputs() {
m_handlesOutputs = true;
}
private Q_SLOTS: private Q_SLOTS:
void installThemeCursor(quint32 id, const QPoint &hotspot); void installThemeCursor(quint32 id, const QPoint &hotspot);
@ -79,6 +86,7 @@ private:
QPoint lastRenderedPosition; QPoint lastRenderedPosition;
} m_cursor; } m_cursor;
Wayland::WaylandCursorTheme *m_cursorTheme = nullptr; Wayland::WaylandCursorTheme *m_cursorTheme = nullptr;
bool m_handlesOutputs = false;
}; };
} }

View file

@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/
#include "wayland_server.h" #include "wayland_server.h"
#include "abstract_backend.h"
#include "screens.h" #include "screens.h"
#include "toplevel.h" #include "toplevel.h"
#include "workspace.h" #include "workspace.h"
@ -84,6 +85,9 @@ void WaylandServer::init(const QByteArray &socketName)
void WaylandServer::initOutputs() void WaylandServer::initOutputs()
{ {
if (m_backend && m_backend->handlesOutputs()) {
return;
}
Screens *s = screens(); Screens *s = screens();
Q_ASSERT(s); Q_ASSERT(s);
for (int i = 0; i < s->count(); ++i) { for (int i = 0; i < s->count(); ++i) {