[Qt][WK2] Implement PageClient::isViewWindowActive()
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Mar 2012 15:23:56 +0000 (15:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Mar 2012 15:23:56 +0000 (15:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=81143

Patch by Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> on 2012-03-24
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

This patch implements PageClient::isViewWindowActive()
now that QQuickCanvas::isActive() is available (from QWindow).

* UIProcess/qt/QtPageClient.cpp:
(QtPageClient::isViewWindowActive):

Tools:

Fix the WrapperWindow from our PlatformWebView
so it correctly creates the platform related
stuff for QWindow, which is not created unless
QWindow::setVisible() or QWindow::show() are called.

* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::PlatformWebView::PlatformWebView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111993 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/qt/QtPageClient.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp

index e66db37..53a473d 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-24  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        [Qt][WK2] Implement PageClient::isViewWindowActive()
+        https://bugs.webkit.org/show_bug.cgi?id=81143
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        This patch implements PageClient::isViewWindowActive()
+        now that QQuickCanvas::isActive() is available (from QWindow).
+
+        * UIProcess/qt/QtPageClient.cpp:
+        (QtPageClient::isViewWindowActive):
+
 2012-03-23  Alexey Proskuryakov  <ap@apple.com>
 
         [Mac] No need for platform-specific ENABLE_BLOB values
index d7049cb..af0797b 100644 (file)
@@ -29,6 +29,7 @@
 #include "qquickwebview_p.h"
 #include "qquickwebview_p_p.h"
 #include <QGuiApplication>
+#include <QQuickCanvas>
 #include <WebCore/Cursor.h>
 #include <WebCore/DragData.h>
 #include <WebCore/FloatRect.h>
@@ -255,8 +256,9 @@ WebCore::IntSize QtPageClient::viewSize()
 
 bool QtPageClient::isViewWindowActive()
 {
-    // FIXME: The scene graph does not have the concept of being active or not when this was written.
-    return true;
+    if (!m_webView || !m_webView->canvas())
+        return false;
+    return m_webView->canvas()->isActive();
 }
 
 bool QtPageClient::isViewFocused()
index f4ac27d..9efaff9 100644 (file)
@@ -1,3 +1,18 @@
+2012-03-24  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
+
+        [Qt][WK2] Implement PageClient::isViewWindowActive()
+        https://bugs.webkit.org/show_bug.cgi?id=81143
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix the WrapperWindow from our PlatformWebView
+        so it correctly creates the platform related
+        stuff for QWindow, which is not created unless
+        QWindow::setVisible() or QWindow::show() are called.
+
+        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+        (WTR::PlatformWebView::PlatformWebView):
+
 2012-03-23  Dirk Pranke  <dpranke@chromium.org>
 
         nrwt: don't wait for safari to exit before exiting after showing the results file
index 7f51239..f0fa640 100644 (file)
@@ -76,6 +76,12 @@ PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGro
 {
     QQuickWebViewExperimental experimental(m_view);
     experimental.setRenderToOffscreenBuffer(true);
+
+    // QWindow does not create the underlying platform
+    // specific bits unless QWindow::setVisible() or QWindow::show() are called,
+    // and without it QWindow::isActive() will always return false.
+    // For these cases QWindow::create() is provided.
+    m_window->create();
 }
 
 PlatformWebView::~PlatformWebView()