diff options
author | Giulio Camuffo <giuliocamuffo@gmail.com> | 2012-11-04 14:42:09 +0100 |
---|---|---|
committer | Andy Nichols <andy.nichols@digia.com> | 2012-11-17 15:37:21 +0100 |
commit | 2246c0150c0f28a6ca9803ca2c454b2492030b8b (patch) | |
tree | bd59941716229312c224450c12db1f40dfd21248 /src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp | |
parent | 41c62a3b93869e2ea267e016aa4c293d15482c0b (diff) |
Initial implementation of decorations for EGL windows.
Change-Id: I7521e583bf18f3690ecc6baacd05a5e92e9fd890
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp')
-rw-r--r-- | src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp index bd6c33d5e..cb709736d 100644 --- a/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp +++ b/src/plugins/platforms/wayland/qwaylandshmbackingstore.cpp @@ -134,9 +134,9 @@ QWaylandShmBackingStore::QWaylandShmBackingStore(QWindow *window) , mBackBuffer(0) , mFrontBufferIsDirty(false) , mPainting(false) - , mWindowDecoration(0) , mFrameCallback(0) { + } QWaylandShmBackingStore::~QWaylandShmBackingStore() @@ -155,9 +155,9 @@ QWaylandShmBackingStore::~QWaylandShmBackingStore() QPaintDevice *QWaylandShmBackingStore::paintDevice() { - if (!mWindowDecoration) + if (!windowDecoration()) return mBackBuffer->image(); - return mBackBuffer->imageInsideMargins(mWindowDecoration->margins()); + return mBackBuffer->imageInsideMargins(windowDecorationMargins()); } void QWaylandShmBackingStore::beginPaint(const QRegion &) @@ -180,30 +180,8 @@ void QWaylandShmBackingStore::endPaint() void QWaylandShmBackingStore::ensureSize() { - bool decoration = false; - switch (window()->windowType()) { - case Qt::Window: - case Qt::Widget: - case Qt::Dialog: - case Qt::Tool: - case Qt::Drawer: - decoration = true; - break; - default: - break; - } - if (window()->windowFlags() & Qt::FramelessWindowHint) { - decoration = false; - } - - if (decoration) { - if (!mWindowDecoration) { - mWindowDecoration = new QWaylandDecoration(window(), this); - } - } else { - delete mWindowDecoration; - mWindowDecoration = 0; - } + waylandWindow()->setBackingStore(this); + waylandWindow()->createDecoration(); resize(mRequestedSize); } @@ -260,8 +238,8 @@ void QWaylandShmBackingStore::resize(const QSize &size) mBackBuffer = new QWaylandShmBuffer(mDisplay, sizeWithMargins, format); - if (mWindowDecoration) - mWindowDecoration->paintDecoration(); + if (windowDecoration()) + windowDecoration()->paintDecoration(); } QImage *QWaylandShmBackingStore::entireSurface() const |