summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2012-02-13 20:39:22 +0100
committerJørgen Lind <jorgen.lind@nokia.com>2012-02-14 09:55:02 +0100
commit2ed43741ab4106c6a1e9eb3a5cb9a6c5ff34f450 (patch)
tree305297d6f665d3f43ef131f5f5577262fa325303 /src/compositor/wayland_wrapper
parentb61d1417dc81761276b3bac44775141b3551ef4e (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')
-rw-r--r--src/compositor/wayland_wrapper/wlcompositor.cpp5
-rw-r--r--src/compositor/wayland_wrapper/wlcompositor.h1
-rw-r--r--src/compositor/wayland_wrapper/wlextendedsurface.cpp8
-rw-r--r--src/compositor/wayland_wrapper/wloutput.h1
4 files changed, 15 insertions, 0 deletions
diff --git a/src/compositor/wayland_wrapper/wlcompositor.cpp b/src/compositor/wayland_wrapper/wlcompositor.cpp
index 545d14e3d..27378f19f 100644
--- a/src/compositor/wayland_wrapper/wlcompositor.cpp
+++ b/src/compositor/wayland_wrapper/wlcompositor.cpp
@@ -360,6 +360,11 @@ void Compositor::setOutputGeometry(const QRect &geometry)
m_output_global.setGeometry(geometry);
}
+QRect Compositor::outputGeometry() const
+{
+ return m_output_global.geometry();
+}
+
InputDevice* Compositor::defaultInputDevice()
{
return m_default_input_device;
diff --git a/src/compositor/wayland_wrapper/wlcompositor.h b/src/compositor/wayland_wrapper/wlcompositor.h
index 03cd1db55..b2d4ef6e7 100644
--- a/src/compositor/wayland_wrapper/wlcompositor.h
+++ b/src/compositor/wayland_wrapper/wlcompositor.h
@@ -117,6 +117,7 @@ public:
void setScreenOrientation(Qt::ScreenOrientation orientation);
Qt::ScreenOrientation screenOrientation() const;
void setOutputGeometry(const QRect &geometry);
+ QRect outputGeometry() const;
void enableTouchExtension();
TouchExtensionGlobal *touchExtension() { return m_touchExtension; }
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)
diff --git a/src/compositor/wayland_wrapper/wloutput.h b/src/compositor/wayland_wrapper/wloutput.h
index f678547a2..b637d2d3f 100644
--- a/src/compositor/wayland_wrapper/wloutput.h
+++ b/src/compositor/wayland_wrapper/wloutput.h
@@ -57,6 +57,7 @@ public:
OutputGlobal();
void setGeometry(const QRect &geometry);
+ QRect geometry() const { return m_geometry; }
int x() const { return m_geometry.x(); }
int y() const { return m_geometry.y(); }