diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-01-05 11:10:28 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-01-25 18:07:36 (GMT) |
commit | 9d5675645dfb4b527932e7090f503ede2cc21efc (patch) | |
tree | 7fa9116592781aaa2b1bd91a8235ec5147cbf93a | |
parent | 37207d16cb51616c0b506dcc57126ff06c9073a9 (diff) | |
download | Qt-9d5675645dfb4b527932e7090f503ede2cc21efc.zip Qt-9d5675645dfb4b527932e7090f503ede2cc21efc.tar.gz Qt-9d5675645dfb4b527932e7090f503ede2cc21efc.tar.bz2 |
Fix Wayland plugin to work with Wayland after some interfaces changed
such as
wl_display_create -> wl_display_connect
wl_surface_attach (attributes)
wl_surface_map -> wl_surface_map_toplevel
wl_shell_listener
wl_output_listener
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandintegration.cpp | 17 | ||||
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandintegration.h | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index 82789c8..61f696c 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp @@ -259,7 +259,6 @@ const struct wl_drm_listener QWaylandDisplay::drmListener = { void QWaylandDisplay::shellHandleConfigure(void *data, struct wl_shell *shell, uint32_t time, uint32_t edges, struct wl_surface *surface, - int32_t x, int32_t y, int32_t width, int32_t height) { Q_UNUSED(data); @@ -268,7 +267,7 @@ void QWaylandDisplay::shellHandleConfigure(void *data, struct wl_shell *shell, Q_UNUSED(edges); QWaylandWindow *ww = (QWaylandWindow *) wl_surface_get_user_data(surface); - ww->configure(time, edges, x, y, width, height); + ww->configure(time, edges, 0, 0, width, height); } const struct wl_shell_listener QWaylandDisplay::shellListener = { @@ -277,14 +276,15 @@ const struct wl_shell_listener QWaylandDisplay::shellListener = { void QWaylandDisplay::outputHandleGeometry(void *data, struct wl_output *output, - int32_t width, int32_t height) + int32_t x, int32_t y, + int32_t width, int32_t height) { Q_UNUSED(output); QWaylandDisplay *qwd = (QWaylandDisplay *) data; QWaylandScreen *screen; screen = new QWaylandScreen(); - screen->mGeometry = QRect(0, 0, width, height); + screen->mGeometry = QRect(x, y, width, height); screen->mDepth = 32; screen->mFormat = QImage::Format_ARGB32_Premultiplied; screen->mOutput = output; @@ -344,7 +344,7 @@ static void forceRoundtrip(struct wl_display *display) wl_display_iterate(display, WL_DISPLAY_READABLE); } -static const char socket_name[] = "\0wayland"; +static const char *socket_name = NULL; void QWaylandDisplay::eventDispatcher(void) { @@ -376,7 +376,7 @@ void QWaylandDisplay::flushRequests(void) QWaylandDisplay::QWaylandDisplay(void) : mWriteNotifier(0) { - mDisplay = wl_display_create(socket_name, sizeof socket_name); + mDisplay = wl_display_connect(socket_name); if (mDisplay == NULL) { fprintf(stderr, "failed to create display: %m\n"); return; @@ -483,9 +483,8 @@ void QWaylandWindow::attach(QWaylandBuffer *buffer) mBuffer = buffer; if (mSurface) { - wl_surface_attach(mSurface, mBuffer->mBuffer); - wl_surface_map(mSurface, geometry.x(), geometry.y(), - geometry.width(), geometry.height()); + wl_surface_attach(mSurface, mBuffer->mBuffer,geometry.x(),geometry.y()); + wl_surface_map_toplevel(mSurface); } } diff --git a/src/plugins/platforms/wayland/qwaylandintegration.h b/src/plugins/platforms/wayland/qwaylandintegration.h index 611ce43..84afcb4 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.h +++ b/src/plugins/platforms/wayland/qwaylandintegration.h @@ -115,12 +115,12 @@ private: static void outputHandleGeometry(void *data, struct wl_output *output, + int32_t x, int32_t y, int32_t width, int32_t height); static void shellHandleConfigure(void *data, struct wl_shell *shell, uint32_t time, uint32_t edges, struct wl_surface *surface, - int32_t x, int32_t y, int32_t width, int32_t height); static int sourceUpdate(uint32_t mask, void *data); |