diff --git a/wayland_server.cpp b/wayland_server.cpp index afdbbaa849..3fe0773890 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 "screens.h" #include "toplevel.h" #include "workspace.h" @@ -68,12 +69,19 @@ void WaylandServer::init(const QByteArray &socketName) m_shell = m_display->createShell(m_display); m_shell->create(); m_display->createShm(); +} - // we need a dummy output - OutputInterface *output = m_display->createOutput(m_display); - output->setPhysicalSize(QSize(10, 10)); - output->addMode(QSize(1024, 768)); - output->create(); +void WaylandServer::initOutputs() +{ + Screens *s = screens(); + Q_ASSERT(s); + for (int i = 0; i < s->count(); ++i) { + OutputInterface *output = m_display->createOutput(m_display); + // TODO: fixme + output->setPhysicalSize(QSize(269, 168)); + output->addMode(s->size(i)); + output->create(); + } } } diff --git a/wayland_server.h b/wayland_server.h index 68054e34d4..68399d97d0 100644 --- a/wayland_server.h +++ b/wayland_server.h @@ -45,6 +45,7 @@ class KWIN_EXPORT WaylandServer : public QObject public: virtual ~WaylandServer(); void init(const QByteArray &socketName = QByteArray()); + void initOutputs(); KWayland::Server::Display *display() { return m_display;