summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper/qwlextendedsurface.cpp
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-03-03 17:24:26 +0200
committerPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2014-07-31 19:06:30 +0200
commit00d7933816d37f5e7bb8d61624c4d4ca38bb014f (patch)
tree9823c47e7b81ead86cacd15643baac62ff8d8f60 /src/compositor/wayland_wrapper/qwlextendedsurface.cpp
parentd6fd07906286562c6fa3103aa671f6166d99db90 (diff)
Use wayland core interfaces to signal output rotation
The wl_output interface has an event for signaling the rotation of the display, so use that instead of our own thing. Change-Id: I8a017d575ee456a7a81649e19a015085fb784805 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/qwlextendedsurface.cpp')
-rw-r--r--src/compositor/wayland_wrapper/qwlextendedsurface.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp
index 47bbafbf1..f8dea98d5 100644
--- a/src/compositor/wayland_wrapper/qwlextendedsurface.cpp
+++ b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp
@@ -142,6 +142,11 @@ Qt::ScreenOrientation ExtendedSurface::contentOrientation() const
return m_contentOrientation;
}
+Qt::ScreenOrientations ExtendedSurface::contentOrientationMask() const
+{
+ return m_contentOrientationMask;
+}
+
void ExtendedSurface::extended_surface_set_content_orientation(Resource *resource, int32_t orientation)
{
Q_UNUSED(resource);
@@ -151,6 +156,28 @@ void ExtendedSurface::extended_surface_set_content_orientation(Resource *resourc
emit m_surface->waylandSurface()->contentOrientationChanged();
}
+void ExtendedSurface::extended_surface_set_content_orientation_mask(Resource *resource, int32_t orientation)
+{
+ Q_UNUSED(resource);
+ Qt::ScreenOrientations mask = 0;
+ if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_PORTRAITORIENTATION)
+ mask |= Qt::PortraitOrientation;
+ if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_LANDSCAPEORIENTATION)
+ mask |= Qt::LandscapeOrientation;
+ if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDPORTRAITORIENTATION)
+ mask |= Qt::InvertedPortraitOrientation;
+ if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_INVERTEDLANDSCAPEORIENTATION)
+ mask |= Qt::InvertedLandscapeOrientation;
+ if (orientation & QT_EXTENDED_SURFACE_ORIENTATION_PRIMARYORIENTATION)
+ mask |= Qt::PrimaryOrientation;
+
+ Qt::ScreenOrientations oldMask = m_contentOrientationMask;
+ m_contentOrientationMask = mask;
+
+ if (mask != oldMask)
+ emit m_surface->waylandSurface()->orientationUpdateMaskChanged();
+}
+
QVariantMap ExtendedSurface::windowProperties() const
{
return m_windowProperties;