[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

eric at webkit.org eric at webkit.org
Thu Feb 4 21:32:10 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit d34192987886a4b6320d0f5b5b4a58094dada675
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 29 14:00:29 2010 +0000

    2010-01-29  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Add support for Maemo zoom keys in QtLauncher
    
            https://bugs.webkit.org/show_bug.cgi?id=34160
    
            * QtLauncher/main.cpp:
            (LauncherWindow::LauncherWindow):
            (LauncherWindow::~LauncherWindow):
            (LauncherWindow::keyPressEvent):
            (LauncherWindow::grabZoomKeys):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54058 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index ea94d49..585d9a1 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-01-29  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Add support for Maemo zoom keys in QtLauncher
+
+        https://bugs.webkit.org/show_bug.cgi?id=34160
+
+        * QtLauncher/main.cpp:
+        (LauncherWindow::LauncherWindow):
+        (LauncherWindow::~LauncherWindow):
+        (LauncherWindow::keyPressEvent):
+        (LauncherWindow::grabZoomKeys):
+
 2010-01-29  Benjamin Poulain  <benjamin.poulain at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKitTools/QtLauncher/main.cpp b/WebKitTools/QtLauncher/main.cpp
index 825397f..9a71c11 100644
--- a/WebKitTools/QtLauncher/main.cpp
+++ b/WebKitTools/QtLauncher/main.cpp
@@ -49,12 +49,23 @@
 #include <qwebframe.h>
 #include <qwebinspector.h>
 #include <qwebsettings.h>
+
+#ifdef Q_WS_MAEMO_5
+#include <qx11info_x11.h>
+#endif
+
 #include "urlloader.h"
 #include "utils.h"
 #include "webinspector.h"
 #include "webpage.h"
 #include "webview.h"
 
+#ifdef Q_WS_MAEMO_5
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#undef KeyPress
+#endif
+
 #ifndef NDEBUG
 void QWEBKIT_EXPORT qt_drt_garbageCollector_collect();
 #endif
@@ -95,9 +106,52 @@ public:
         zoomLevels << 100;
         zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
 
+        grabZoomKeys(true);
+
         load(url);
     }
 
+    ~LauncherWindow()
+    {
+        grabZoomKeys(false);
+    }
+
+    void keyPressEvent(QKeyEvent* event)
+    {
+#ifdef Q_WS_MAEMO_5
+        switch (event->key()) {
+        case Qt::Key_F7:
+            zoomIn();
+            event->accept();
+            break;
+        case Qt::Key_F8:
+            zoomOut();
+            event->accept();
+            break;
+        }
+#endif
+        MainWindow::keyPressEvent(event);
+    }
+
+    void grabZoomKeys(bool grab)
+    {
+#ifdef Q_WS_MAEMO_5
+        if (!winId()) {
+            qWarning("Can't grab keys unless we have a window id");
+            return;
+        }
+
+        Atom atom = XInternAtom(QX11Info::display(), "_HILDON_ZOOM_KEY_ATOM", False);
+        if (!atom) {
+            qWarning("Unable to obtain _HILDON_ZOOM_KEY_ATOM");
+            return;
+        }
+
+        unsigned long val = (grab) ? 1 : 0;
+        XChangeProperty(QX11Info::display(), winId(), atom, XA_INTEGER, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&val), 1);
+#endif
+    }
+
 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
     void sendTouchEvent()
     {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list