diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-01-17 10:03:32 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-17 12:21:56 +0100 |
commit | 14e237816da2eaabc4ff1f7fd17aae211e160a6b (patch) | |
tree | d0181c529f0a790c3fa25b75ed3ef909bf4a2c28 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | bc02ef882ba013e996380b625a15e95a2e0168a2 (diff) |
Add support for QWindow::setOrientation on Harmattan
Set the _MEEGOTOUCH_ORIENTATION_ANGLE property on the window, just like
Qt Components for MeeGo and MeegoTouch itself.
Change-Id: I0b9adf4550593678bbcba89a2d4f1f65c1f4bd20
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 2cd2a15fb7..760605bca6 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -1148,6 +1148,23 @@ void QXcbWindow::requestActivateWindow() connection()->sync(); } +#if XCB_USE_MAEMO_WINDOW_PROPERTIES +void QXcbWindow::setOrientation(Qt::ScreenOrientation orientation) +{ + int angle = 0; + switch (orientation) { + case Qt::PortraitOrientation: angle = 270; break; + case Qt::LandscapeOrientation: angle = 0; break; + case Qt::InvertedPortraitOrientation: angle = 90; break; + case Qt::InvertedLandscapeOrientation: angle = 180; break; + case Qt::UnknownOrientation: break; + } + Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window, + atom(QXcbAtom::MeegoTouchOrientationAngle), XCB_ATOM_CARDINAL, 32, + 1, &angle)); +} +#endif + QSurfaceFormat QXcbWindow::format() const { // ### return actual format |