summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h4
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp17
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h4
-rw-r--r--src/plugins/platforms/xcb/xcb.pro13
5 files changed, 36 insertions, 5 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp
index ca21b1eb9d..afc6c18c4f 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection.cpp
@@ -909,6 +909,9 @@ static const char * xcb_atomnames = {
"Abs MT Pressure\0"
"Abs MT Tracking ID\0"
"Max Contacts\0"
+#if XCB_USE_MAEMO_WINDOW_PROPERTIES
+ "_MEEGOTOUCH_ORIENTATION_ANGLE\0"
+#endif
};
xcb_atom_t QXcbConnection::atom(QXcbAtom::Atom atom)
diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h
index c227b4c863..1feba558c9 100644
--- a/src/plugins/platforms/xcb/qxcbconnection.h
+++ b/src/plugins/platforms/xcb/qxcbconnection.h
@@ -243,6 +243,10 @@ namespace QXcbAtom {
AbsMTTrackingID,
MaxContacts,
+#if XCB_USE_MAEMO_WINDOW_PROPERTIES
+ MeegoTouchOrientationAngle,
+#endif
+
NPredefinedAtoms,
_QT_SETTINGS_TIMESTAMP = NPredefinedAtoms,
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
diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h
index f0b6437699..a0e0d85ca2 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.h
+++ b/src/plugins/platforms/xcb/qxcbwindow.h
@@ -79,6 +79,10 @@ public:
void requestActivateWindow();
+#if XCB_USE_MAEMO_WINDOW_PROPERTIES
+ void setOrientation(Qt::ScreenOrientation orientation);
+#endif
+
bool setKeyboardGrabEnabled(bool grab);
bool setMouseGrabEnabled(bool grab);
diff --git a/src/plugins/platforms/xcb/xcb.pro b/src/plugins/platforms/xcb/xcb.pro
index 2498581eb7..823a12b0f4 100644
--- a/src/plugins/platforms/xcb/xcb.pro
+++ b/src/plugins/platforms/xcb/xcb.pro
@@ -46,11 +46,14 @@ contains(QT_CONFIG, xcb-xlib) {
DEFINES += XCB_USE_XLIB
LIBS += -lX11 -lX11-xcb
- linux-g++-maemo:contains(QT_CONFIG, xinput2) {
- # XInput2 support for Harmattan.
- DEFINES += XCB_USE_XINPUT2_MAEMO
- SOURCES += qxcbconnection_maemo.cpp
- LIBS += -lXi
+ linux-g++-maemo {
+ contains(QT_CONFIG, xinput2) {
+ # XInput2 support for Harmattan.
+ DEFINES += XCB_USE_XINPUT2_MAEMO
+ SOURCES += qxcbconnection_maemo.cpp
+ LIBS += -lXi
+ }
+ DEFINES += XCB_USE_MAEMO_WINDOW_PROPERTIES
}
}