diff options
-rw-r--r-- | config.tests/wayland_egl/main.cpp | 2 | ||||
-rw-r--r-- | src/compositor/wayland_wrapper/wlcompositor.cpp | 8 | ||||
-rw-r--r-- | src/compositor/wayland_wrapper/wlsurface.cpp | 22 | ||||
-rw-r--r-- | src/compositor/wayland_wrapper/wlsurface.h | 2 | ||||
-rw-r--r-- | wayland_sha1.txt | 2 |
5 files changed, 27 insertions, 9 deletions
diff --git a/config.tests/wayland_egl/main.cpp b/config.tests/wayland_egl/main.cpp index 8a0c7465b..9899a0eb5 100644 --- a/config.tests/wayland_egl/main.cpp +++ b/config.tests/wayland_egl/main.cpp @@ -42,7 +42,7 @@ int main() { - struct wl_egl_pixmap *pm = wl_egl_pixmap_create(100,100,0); + struct wl_egl_window *window = wl_egl_window_create(0,100,100); return 0; } diff --git a/src/compositor/wayland_wrapper/wlcompositor.cpp b/src/compositor/wayland_wrapper/wlcompositor.cpp index 841e2ea38..8c1b05736 100644 --- a/src/compositor/wayland_wrapper/wlcompositor.cpp +++ b/src/compositor/wayland_wrapper/wlcompositor.cpp @@ -63,6 +63,9 @@ #include <qpa/qplatformscreenpageflipper.h> #include <QDebug> +#include <QtCore/QAbstractEventDispatcher> +#include <QtGui/private/qguiapplication_p.h> + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -109,7 +112,6 @@ void Compositor::bind_func(struct wl_client *client, void *data, wl_client_add_object(client,&wl_compositor_interface, &compositor_interface, id,data); } - Compositor *Compositor::instance() { return compositor; @@ -172,6 +174,9 @@ Compositor::Compositor(WaylandCompositor *qt_compositor) QSocketNotifier *sockNot = new QSocketNotifier(fd, QSocketNotifier::Read, this); connect(sockNot, SIGNAL(activated(int)), this, SLOT(processWaylandEvents())); + QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher; + connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(processWaylandEvents())); + qRegisterMetaType<SurfaceBuffer*>("SurfaceBuffer*"); //initialize distancefieldglyphcache here } @@ -267,6 +272,7 @@ void Compositor::processWaylandEvents() int ret = wl_event_loop_dispatch(m_loop, 0); if (ret) fprintf(stderr, "wl_event_loop_dispatch error: %d\n", ret); + wl_display_flush_clients(m_display->handle()); } void Compositor::surfaceDestroyed(Surface *surface) diff --git a/src/compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/wlsurface.cpp index a348cdd8d..d05f36b52 100644 --- a/src/compositor/wayland_wrapper/wlsurface.cpp +++ b/src/compositor/wayland_wrapper/wlsurface.cpp @@ -399,6 +399,14 @@ bool Surface::postBuffer() { return false; } +void Surface::commit() +{ + if (!m_bufferQueue.isEmpty() && !m_backBuffer) + advanceBufferQueue(); + + doUpdate(); +} + void Surface::attach(struct wl_buffer *buffer) { SurfaceBuffer *last = m_bufferQueue.size()?m_bufferQueue.last():0; @@ -429,11 +437,6 @@ void Surface::damage(const QRect &rect) surfaceBuffer->setDamage(rect); else qWarning() << "Surface::damage() null buffer"; - - if (!m_bufferQueue.isEmpty() && !m_backBuffer) - advanceBufferQueue(); - - doUpdate(); } const struct wl_surface_interface Surface::surface_interface = { @@ -442,7 +445,8 @@ const struct wl_surface_interface Surface::surface_interface = { Surface::surface_damage, Surface::surface_frame, Surface::surface_set_opaque_region, - Surface::surface_set_input_region + Surface::surface_set_input_region, + Surface::surface_commit }; void Surface::surface_destroy(struct wl_client *, struct wl_resource *surface_resource) @@ -491,6 +495,12 @@ void Surface::surface_set_input_region(struct wl_client *client, struct wl_resou surface->m_inputRegion = region ? resolve<Region>(region)->region() : QRegion(QRect(QPoint(), surface->size())); } +void Surface::surface_commit(wl_client *client, wl_resource *resource) +{ + Q_UNUSED(client); + resolve<Surface>(resource)->commit(); +} + void Surface::setTitle(const QString &title) { if (m_title != title) { diff --git a/src/compositor/wayland_wrapper/wlsurface.h b/src/compositor/wayland_wrapper/wlsurface.h index e9141b268..642e8f790 100644 --- a/src/compositor/wayland_wrapper/wlsurface.h +++ b/src/compositor/wayland_wrapper/wlsurface.h @@ -166,6 +166,7 @@ private: SurfaceBuffer *createSurfaceBuffer(struct wl_buffer *buffer); void frameFinishedInternal(); bool postBuffer(); + void commit(); void attach(struct wl_buffer *buffer); @@ -180,6 +181,7 @@ private: struct wl_resource *region); static void surface_set_input_region(struct wl_client *client, struct wl_resource *resource, struct wl_resource *region); + static void surface_commit(struct wl_client *client, struct wl_resource *resource); }; diff --git a/wayland_sha1.txt b/wayland_sha1.txt index 8aba759a2..dad1dd36d 100644 --- a/wayland_sha1.txt +++ b/wayland_sha1.txt @@ -1,3 +1,3 @@ This version of Qt-Compositor is checked against the following sha1 from the Wayland repository: -4b681a7fd4bee01c4d3385e69ee47ed3856c2229 +1f521a4f7760df73e1d1d8a6791d1c7bf536584e |