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;
}
#include <qpa/qplatformscreenpageflipper.h>
#include <QDebug>
+#include <QtCore/QAbstractEventDispatcher>
+#include <QtGui/private/qguiapplication_p.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
wl_client_add_object(client,&wl_compositor_interface, &compositor_interface, id,data);
}
-
Compositor *Compositor::instance()
{
return 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
}
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)
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;
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 = {
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)
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) {
SurfaceBuffer *createSurfaceBuffer(struct wl_buffer *buffer);
void frameFinishedInternal();
bool postBuffer();
+ void commit();
void attach(struct wl_buffer *buffer);
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);
};
This version of Qt-Compositor is checked against the following sha1 from the
Wayland repository:
-4b681a7fd4bee01c4d3385e69ee47ed3856c2229
+1f521a4f7760df73e1d1d8a6791d1c7bf536584e