Commit 0ab135a7 authored by Martin Flöser's avatar Martin Flöser
Browse files

[kwin_wayland] Create a dedicated Surface class

A Surface class is split out which holds a wl_surface and supports
attaching a buffer, setting the damage and emitting a signal when the
frame callback got called.

It doesn't come with a unit test yet as it first needs the ShmPool
and Buffer properly split out to easily set it up.
parent c1e1d1db
......@@ -22,6 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// KWin
#include "../../wayland_client/connection_thread.h"
#include "../../wayland_client/shell.h"
#include "../../wayland_client/surface.h"
#include "../../wayland_client/registry.h"
// Wayland
#include <wayland-client-protocol.h>
......@@ -151,7 +152,9 @@ void TestWaylandShell::testShell()
KWin::Wayland::Shell shell;
shell.setup(registry.bindShell(announced.first().first().value<quint32>(), announced.first().last().value<quint32>()));
wl_display_flush(connection.display());
KWin::Wayland::ShellSurface *surface = shell.createSurface(wl_compositor_create_surface(compositor), &shell);
KWin::Wayland::Surface s;
s.setup(wl_compositor_create_surface(compositor));
KWin::Wayland::ShellSurface *surface = shell.createSurface(&s, &shell);
QSignalSpy sizeSpy(surface, SIGNAL(sizeChanged(QSize)));
QVERIFY(sizeSpy.isValid());
QCOMPARE(surface->size(), QSize());
......@@ -167,6 +170,7 @@ void TestWaylandShell::testShell()
shell.release();
QVERIFY(!surface->isValid());
s.release();
wl_compositor_destroy(compositor);
}
......
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