summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-06-06 12:22:49 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2012-06-06 13:53:54 +0200
commit825db7e265e4e6b5bbab68aeb3e9673ba78f92e5 (patch)
tree4ad3118f50488d0822143e1c2d596e9f5a0b74c7 /src/plugins/platforms/wayland
parent077067bc8f68a3146430b941ea0f0daa61781f91 (diff)
Implemented orientationUpdateMask support in WaylandSurface.
Used to find out whether the client wants orientation updates. Change-Id: Ibefc98df7b346cbfe13cb021c932dab3d6c5d758 Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Diffstat (limited to 'src/plugins/platforms/wayland')
-rw-r--r--src/plugins/platforms/wayland/qwaylandextendedoutput.cpp14
-rw-r--r--src/plugins/platforms/wayland/qwaylandextendedoutput.h2
-rw-r--r--src/plugins/platforms/wayland/qwaylandscreen.cpp6
-rw-r--r--src/plugins/platforms/wayland/qwaylandscreen.h2
4 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp b/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp
index 96eb0ad4f..c0e011adf 100644
--- a/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp
+++ b/src/plugins/platforms/wayland/qwaylandextendedoutput.cpp
@@ -86,6 +86,20 @@ Qt::ScreenOrientation QWaylandExtendedOutput::currentOrientation() const
return m_orientation;
}
+void QWaylandExtendedOutput::setOrientationUpdateMask(Qt::ScreenOrientations orientations)
+{
+ int mask = 0;
+ if (orientations & Qt::PortraitOrientation)
+ mask |= WL_EXTENDED_OUTPUT_ROTATION_PORTRAITORIENTATION;
+ if (orientations & Qt::LandscapeOrientation)
+ mask |= WL_EXTENDED_OUTPUT_ROTATION_LANDSCAPEORIENTATION;
+ if (orientations & Qt::InvertedPortraitOrientation)
+ mask |= WL_EXTENDED_OUTPUT_ROTATION_INVERTEDPORTRAITORIENTATION;
+ if (orientations & Qt::InvertedLandscapeOrientation)
+ mask |= WL_EXTENDED_OUTPUT_ROTATION_INVERTEDLANDSCAPEORIENTATION;
+ wl_extended_output_set_orientation_update_mask(m_extended_output, mask);
+}
+
void QWaylandExtendedOutput::set_screen_rotation(void *data, wl_extended_output *wl_extended_output, int32_t rotation)
{
Q_UNUSED(wl_extended_output);
diff --git a/src/plugins/platforms/wayland/qwaylandextendedoutput.h b/src/plugins/platforms/wayland/qwaylandextendedoutput.h
index 6ca6220b2..5f39d959f 100644
--- a/src/plugins/platforms/wayland/qwaylandextendedoutput.h
+++ b/src/plugins/platforms/wayland/qwaylandextendedoutput.h
@@ -62,6 +62,8 @@ public:
QWaylandExtendedOutput(QWaylandScreen *screen, struct wl_extended_output *extended_output);
Qt::ScreenOrientation currentOrientation() const;
+ void setOrientationUpdateMask(Qt::ScreenOrientations mask);
+
private:
struct wl_extended_output *m_extended_output;
QWaylandScreen *m_screen;
diff --git a/src/plugins/platforms/wayland/qwaylandscreen.cpp b/src/plugins/platforms/wayland/qwaylandscreen.cpp
index 0373239eb..14b8f4eaf 100644
--- a/src/plugins/platforms/wayland/qwaylandscreen.cpp
+++ b/src/plugins/platforms/wayland/qwaylandscreen.cpp
@@ -89,6 +89,12 @@ QImage::Format QWaylandScreen::format() const
return mFormat;
}
+void QWaylandScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask)
+{
+ if (mExtendedOutput)
+ mExtendedOutput->setOrientationUpdateMask(mask);
+}
+
Qt::ScreenOrientation QWaylandScreen::orientation() const
{
if (mExtendedOutput)
diff --git a/src/plugins/platforms/wayland/qwaylandscreen.h b/src/plugins/platforms/wayland/qwaylandscreen.h
index b76b0ed04..d5d267cd1 100644
--- a/src/plugins/platforms/wayland/qwaylandscreen.h
+++ b/src/plugins/platforms/wayland/qwaylandscreen.h
@@ -60,6 +60,8 @@ public:
int depth() const;
QImage::Format format() const;
+ void setOrientationUpdateMask(Qt::ScreenOrientations mask);
+
Qt::ScreenOrientation orientation() const;
qreal refreshRate() const;