diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2012-02-13 20:39:22 +0100 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2012-02-14 09:55:02 +0100 |
commit | 2ed43741ab4106c6a1e9eb3a5cb9a6c5ff34f450 (patch) | |
tree | 305297d6f665d3f43ef131f5f5577262fa325303 /src/compositor/wayland_wrapper/wlextendedsurface.cpp | |
parent | b61d1417dc81761276b3bac44775141b3551ef4e (diff) |
Added convenience properties in WaylandSurface for window orientation.
The new windowRotation property is especially useful for the compositor
to know how much the surface needs to be rotated in order to be
displayed correctly.
Change-Id: I81ee17880ceafd465c39b4439dee978f2cb80924
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src/compositor/wayland_wrapper/wlextendedsurface.cpp')
-rw-r--r-- | src/compositor/wayland_wrapper/wlextendedsurface.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compositor/wayland_wrapper/wlextendedsurface.cpp b/src/compositor/wayland_wrapper/wlextendedsurface.cpp index c5bde2580..e4dd6bf45 100644 --- a/src/compositor/wayland_wrapper/wlextendedsurface.cpp +++ b/src/compositor/wayland_wrapper/wlextendedsurface.cpp @@ -154,7 +154,11 @@ void ExtendedSurface::set_window_orientation(struct wl_client *client, { Q_UNUSED(client); ExtendedSurface *extended_surface = static_cast<ExtendedSurface *>(extended_surface_resource->data); + + Qt::ScreenOrientation oldOrientation = extended_surface->m_windowOrientation; extended_surface->m_windowOrientation = screenOrientationFromWaylandOrientation(orientation); + if (extended_surface->m_windowOrientation != oldOrientation) + emit extended_surface->m_surface->waylandSurface()->windowOrientationChanged(); } void ExtendedSurface::set_content_orientation(struct wl_client *client, @@ -163,7 +167,11 @@ void ExtendedSurface::set_content_orientation(struct wl_client *client, { Q_UNUSED(client); ExtendedSurface *extended_surface = static_cast<ExtendedSurface *>(extended_surface_resource->data); + + Qt::ScreenOrientation oldOrientation = extended_surface->m_contentOrientation; extended_surface->m_contentOrientation = screenOrientationFromWaylandOrientation(orientation); + if (extended_surface->m_windowOrientation != oldOrientation) + emit extended_surface->m_surface->waylandSurface()->contentOrientationChanged(); } void ExtendedSurface::setWindowFlags(WaylandSurface::WindowFlags flags) |