From ebcf3e92fcb0dcf2a3c1a7e34a7e001791c52b43 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 16 Mar 2012 09:45:32 +0100 Subject: [PATCH] Send expose events and resize events according to spec MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ia2452cd00e11c42d8ee7e8a1f8c39d82de3f4f37 Reviewed-by: Samuel Rødal --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 8 +++++++- src/plugins/platforms/wayland/qwaylandwindow.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 2fb65aa..07a9c46 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -70,6 +70,7 @@ QWaylandWindow::QWaylandWindow(QWindow *window) , mBuffer(0) , mWaitingForFrameSync(false) , mFrameCallback(0) + , mSentInitialResize(false) { static WId id = 1; mWindowId = id++; @@ -121,11 +122,16 @@ void QWaylandWindow::setVisible(bool visible) { if (visible) { + if (!mSentInitialResize) { + QWindowSystemInterface::handleSynchronousGeometryChange(window(), geometry()); + mSentInitialResize = true; + } + QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size())); if (mBuffer) { wl_surface_attach(mSurface, mBuffer->buffer(),0,0); - QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size())); } } else { + QWindowSystemInterface::handleSynchronousExposeEvent(window(), QRect(QPoint(), geometry().size())); wl_surface_attach(mSurface, 0,0,0); } } diff --git a/src/plugins/platforms/wayland/qwaylandwindow.h b/src/plugins/platforms/wayland/qwaylandwindow.h index 1f31097..8fcfd8f 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.h +++ b/src/plugins/platforms/wayland/qwaylandwindow.h @@ -106,6 +106,8 @@ protected: struct wl_callback *mFrameCallback; QWaitCondition mFrameSyncWait; + bool mSentInitialResize; + private: static const wl_callback_listener callbackListener; static void frameCallback(void *data, struct wl_callback *wl_callback, uint32_t time); -- 2.7.4