Merge branch 'Plasma/5.6'

This commit is contained in:
Martin Gräßlin 2016-03-10 17:07:21 +01:00
commit 93ec3d84e1
3 changed files with 11 additions and 2 deletions

View file

@ -88,6 +88,8 @@ void Integration::initialize()
// TODO: start initialize Wayland once the internal Wayland connection is created
connect(kwinApp(), &Application::screensCreated, this, &Integration::initializeWayland, Qt::QueuedConnection);
QPlatformIntegration::initialize();
m_dummyScreen = new Screen(nullptr);
screenAdded(m_dummyScreen);
}
QAbstractEventDispatcher *Integration::createEventDispatcher() const
@ -178,6 +180,10 @@ void Integration::initializeWayland()
void Integration::createWaylandOutput(quint32 name, quint32 version)
{
if (m_dummyScreen) {
destroyScreen(m_dummyScreen);
m_dummyScreen = nullptr;
}
using namespace KWayland::Client;
auto o = m_registry->createOutput(name, version, this);
connect(o, &Output::changed, this,

View file

@ -40,6 +40,8 @@ namespace KWin
namespace QPA
{
class Screen;
class Integration : public QObject, public QPlatformIntegration
{
Q_OBJECT
@ -74,6 +76,7 @@ private:
KWayland::Client::Compositor *m_compositor = nullptr;
KWayland::Client::Shell *m_shell = nullptr;
EGLDisplay m_eglDisplay = EGL_NO_DISPLAY;
Screen *m_dummyScreen = nullptr;
};
}

View file

@ -49,12 +49,12 @@ QImage::Format Screen::format() const
QRect Screen::geometry() const
{
return m_output->geometry();
return m_output ? m_output->geometry() : QRect(0, 0, 1, 1);
}
QSizeF Screen::physicalSize() const
{
return m_output->physicalSize();
return m_output ? m_output->physicalSize() : QPlatformScreen::physicalSize();
}
QPlatformCursor *Screen::cursor() const