Commit 211f0844 authored by Martin Flöser's avatar Martin Flöser
Browse files

[kwin_wayland] Keep the size in Surface

Technically the Surface itself does not have a size, it's the
ShellSurface or the size of the FullScreenShell's Output. But it
simplifies a lot if we keep track of the size in the Surface as that
way we can hide the fact which kind of Shell is used.

The user of the Surface must connect either the FullscreenShell's
Output or the ShellSurface to set the size on the Surface.
parent b892ae39
......@@ -118,6 +118,15 @@ void TestWaylandSurface::testStaticAccessor()
QCOMPARE(KWin::Wayland::Surface::all().first(), s1);
QCOMPARE(KWin::Wayland::Surface::get(*s1), s1);
QSignalSpy sizeChangedSpy(s1, SIGNAL(sizeChanged(QSize)));
const QSize testSize(200, 300);
QCOMPARE(s1->size(), testSize);
QCOMPARE(sizeChangedSpy.count(), 1);
QCOMPARE(sizeChangedSpy.first().first().toSize(), testSize);
// add another surface
KWin::Wayland::Surface *s2 = compositor.createSurface();
QCOMPARE(KWin::Wayland::Surface::all().count(), 2);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment