summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwindow.cpp33
-rw-r--r--src/gui/kernel/qwindow.h3
-rw-r--r--src/gui/kernel/qwindow_p.h1
3 files changed, 37 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 69ae30389e..33fd4954eb 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -791,6 +791,39 @@ qreal QWindow::opacity() const
}
/*!
+ Sets the mask of the window.
+
+ The mask is a hint to the windowing system that the application does not
+ want to receive mouse or touch input outside the given \a region.
+
+ The window manager may or may not choose to display any areas of the window
+ not included in the mask, thus it is the application's responsibility to
+ clear to transparent the areas that are not part of the mask.
+
+ Setting the mask before the window has been created has no effect.
+*/
+void QWindow::setMask(const QRegion &region)
+{
+ Q_D(QWindow);
+ if (!d->platformWindow)
+ return;
+ d->platformWindow->setMask(region);
+ d->mask = region;
+}
+
+/*!
+ Returns the mask set on the window.
+
+ The mask is a hint to the windowing system that the application does not
+ want to receive mouse or touch input outside the given region.
+*/
+QRegion QWindow::mask() const
+{
+ Q_D(const QWindow);
+ return d->mask;
+}
+
+/*!
Requests the window to be activated, i.e. receive keyboard focus.
\sa isActive(), QGuiApplication::focusWindow()
diff --git a/src/gui/kernel/qwindow.h b/src/gui/kernel/qwindow.h
index 4b8f0ca3e7..0842e9ceb6 100644
--- a/src/gui/kernel/qwindow.h
+++ b/src/gui/kernel/qwindow.h
@@ -163,6 +163,9 @@ public:
void setOpacity(qreal level);
qreal opacity() const;
+ void setMask(const QRegion &region);
+ QRegion mask() const;
+
void requestActivate();
bool isActive() const;
diff --git a/src/gui/kernel/qwindow_p.h b/src/gui/kernel/qwindow_p.h
index bcbface370..e92f37c34f 100644
--- a/src/gui/kernel/qwindow_p.h
+++ b/src/gui/kernel/qwindow_p.h
@@ -143,6 +143,7 @@ public:
PositionPolicy positionPolicy;
Qt::ScreenOrientation contentOrientation;
qreal opacity;
+ QRegion mask;
QSize minimumSize;
QSize maximumSize;