libopie2/qte: fix bad cursor key rotation on some devices
authorPaul Eggleton <bluelightning@bluelightning.org>
Wed, 27 May 2009 23:17:01 +0000 (00:17 +0100)
committerPaul Eggleton <bluelightning@bluelightning.org>
Wed, 27 May 2009 23:17:01 +0000 (00:17 +0100)
 * Should fix bad cursor key rotation with respect to the screen on
   some devices and hopefully won't affect devices that were OK.
 * All responsibility for rotating the cursor keys now lies with
   ODevice (libopie2). Any further fixes need to be applied there.
 * Refer to OE bug #3678 for more information.

recipes/libopie/libopie2/rotate_fix.patch [new file with mode: 0644]
recipes/libopie/libopie2_1.2.4.bb
recipes/qte/qte-2.3.10/disable-dup-rotation.patch
recipes/qte/qte-mt_2.3.10.bb
recipes/qte/qte_2.3.10.bb

diff --git a/recipes/libopie/libopie2/rotate_fix.patch b/recipes/libopie/libopie2/rotate_fix.patch
new file mode 100644 (file)
index 0000000..c6a5984
--- /dev/null
@@ -0,0 +1,87 @@
+--- libopie2/opiecore/device/odevice_ipaq.cpp  24 May 2009 20:09:49 -0000      1.40
++++ libopie2/opiecore/device/odevice_ipaq.cpp  27 May 2009 21:16:24 -0000
+@@ -35,6 +35,7 @@
+ #include <qfile.h>
+ #include <qtextstream.h>
+ #include <qwindowsystem_qws.h>
++#include <qgfx_qws.h>
+ /* OPIE */
+ #include <qpe/config.h>
+@@ -335,11 +336,11 @@
+             int quarters;
+             switch (d->m_rotation) {
+                 case Rot0:   quarters = 0/*0deg*/; break;
+-                case Rot90:  quarters = 1/*90deg*/; break;
++                case Rot90:  quarters = 3/*90deg*/; break;
+                 case Rot180: quarters = 2/*180deg*/; break;
+-                case Rot270: quarters = 3/*270deg*/; break;
++                case Rot270: quarters = 1/*270deg*/; break;
+             }
+-            newkeycode = Key_Left + ( keycode - Key_Left + quarters ) % 4;
++            newkeycode = Key_Left + ( keycode - Key_Left + quarters + qt_screen->transformOrientation() ) % 4;
+             break;
+         }
+--- libopie2/opiecore/device/odevice_zaurus.cpp        24 May 2009 20:09:49 -0000      1.57
++++ libopie2/opiecore/device/odevice_zaurus.cpp        27 May 2009 21:16:24 -0000
+@@ -807,16 +807,8 @@
+         case Key_Up   :
+         case Key_Down :
+         {
+-            if (d->m_model == Model_Zaurus_SLC3000) {
+-                // This ensures that the cursor keys work correctly and that the
+-                // side wheel works as expected when the screen is flipped over
+-                if (rotation() == Rot270)
+-                    newkeycode = Key_Left + ( keycode - Key_Left + 1 ) % 4;
+-            }
+-            else {
+-                if (rotation()==Rot90)
+-                    newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4;
+-            }
++            if (rotation()==Rot90)
++                newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4;
+             break;
+             
+         }
+--- libopie2/opiecore/device/odevice_palm.cpp  2009-05-27 22:28:37.000000000 +0100
++++ libopie2/opiecore/device/odevice_palm.cpp  2009-05-27 22:28:09.000000000 +0100
+@@ -295,25 +295,21 @@
+ {
+     int newkeycode = keycode;
+-    if (qt_screen->transformOrientation() != Rot0){
+-
+-        switch ( keycode ) {
+-          case Key_Left :
+-            case Key_Right:
+-            case Key_Up   :
+-            case Key_Down :
+-                  newkeycode = Key_Left + ( keycode - Key_Left + 4 ) % 4;
+-          default:
+-              break;
+-        }
++    switch ( keycode ) {
++        case Key_Left :
++        case Key_Right:
++        case Key_Up   :
++        case Key_Down :
++            newkeycode = Key_Left + ( keycode - Key_Left + qt_screen->transformOrientation() ) % 4;
++        default:
++            break;
++    }
+-        if (newkeycode!=keycode) {
+-            if ( newkeycode != Key_unknown ) {
+-                QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat );
+-            }
+-            return true;
++    if (newkeycode!=keycode) {
++        if ( newkeycode != Key_unknown ) {
++            QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat );
+         }
+-
++        return true;
+     }
+     return false;
index 0634ad7..d66cf3f 100644 (file)
@@ -1,10 +1,11 @@
 require ${PN}.inc
 
-PR = "r1"
+PR = "r2"
 
 SRC_URI = "${HANDHELDS_CVS};tag=${TAG};module=opie/libopie2 \
            file://include.pro \
            file://libopie2-tosa.patch;patch=1 \
-           file://c7x0_w100_disable.patch;patch=1"
+           file://c7x0_w100_disable.patch;patch=1 \
+           file://rotate_fix.patch;patch=1"
 
 SRC_URI_append_poodle = " file://poodle-2.6-hotkeys.patch;patch=1"
index 8a2a022..6874ba5 100644 (file)
@@ -4,7 +4,7 @@
      case Qt::Key_Down:
          unicode = 0xffff;
          mod_key = false;
-+#if defined(QT_QWS_IPAQ) || defined(QT_QWS_SL5XXX)
++#if 0
          if (qt_screen->isTransformed())
              qtKeyCode = static_cast<Qt::Key>( xform_dirkey(static_cast<int>( qtKeyCode ) ) );
 +#endif
index 32afeda..71873dc 100644 (file)
@@ -1,5 +1,5 @@
 require qte-common_${PV}.inc
-PR = "r27"
+PR = "r28"
 
 EXTRA_OECONF += "-thread"
 
index 68825b6..1183bc2 100644 (file)
@@ -1,3 +1,3 @@
 require qte-common_${PV}.inc
-PR = "r52"
+PR = "r53"