summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow.cpp
diff options
context:
space:
mode:
authorJan Arne Petersen <jan.petersen@kdab.com>2014-08-10 06:54:55 +0200
committerJan Arne Petersen <jan.petersen@kdab.com>2014-08-13 21:24:40 +0200
commitc288de20291eb5d9a3dc3e3eae16d007fd08afa3 (patch)
treed1fcf22a9e1d84978f76c1b10de255feb8fbbe95 /src/client/qwaylandwindow.cpp
parentbbae1f2afe5aaa8522dfeb6de6c759c54c4292ef (diff)
Add support for setMask to set input region
Also fix input region handling in compositor. Change-Id: If88ad6a03443526eddee045d7af54daf5057373a Done-with: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r--src/client/qwaylandwindow.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index a6190c0d1..a3e9b53cf 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -88,6 +88,7 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
, mMouseDevice(0)
, mMouseSerial(0)
, mState(Qt::WindowNoState)
+ , mMask()
{
init(mDisplay->createSurface(static_cast<QtWayland::wl_surface *>(this)));
@@ -124,6 +125,7 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
setOrientationMask(window->screen()->orientationUpdateMask());
setWindowFlags(window->flags());
setGeometry_helper(window->geometry());
+ setMask(window->mask());
setWindowStateInternal(window->windowState());
handleContentOrientationChange(window->contentOrientation());
}
@@ -262,6 +264,24 @@ void QWaylandWindow::lower()
mShellSurface->lower();
}
+void QWaylandWindow::setMask(const QRegion &mask)
+{
+ if (mMask == mask)
+ return;
+
+ mMask = mask;
+
+ if (mMask.isEmpty()) {
+ set_input_region(0);
+ } else {
+ struct ::wl_region *region = mDisplay->createRegion(mMask);
+ set_input_region(region);
+ wl_region_destroy(region);
+ }
+
+ commit();
+}
+
void QWaylandWindow::configure(uint32_t edges, int32_t width, int32_t height)
{
QMutexLocker resizeLocker(&mResizeLock);