diff --git a/3rdparty b/3rdparty index aee1bf50ed6733635ac6ae7389657a4563a8a7f7..63f1510d708ce6e90354c63655fa21bd4906e52e 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit aee1bf50ed6733635ac6ae7389657a4563a8a7f7 +Subproject commit 63f1510d708ce6e90354c63655fa21bd4906e52e diff --git a/patches/0001-Hide-the-definition-of-MessagePumpGtk-GetDefaultXDis.patch b/patches/0001-Hide-the-definition-of-MessagePumpGtk-GetDefaultXDis.patch new file mode 100644 index 0000000000000000000000000000000000000000..20b614d56db195bd5c7ef77852b3cd4ddb9796de --- /dev/null +++ b/patches/0001-Hide-the-definition-of-MessagePumpGtk-GetDefaultXDis.patch @@ -0,0 +1,34 @@ +From 717b027460dbda87c965ea0069fd11bbe7aad59f Mon Sep 17 00:00:00 2001 +From: Jocelyn Turcotte <jocelyn.turcotte@digia.com> +Date: Fri, 20 Sep 2013 15:01:41 +0200 +Subject: [PATCH] Hide the definition of MessagePumpGtk::GetDefaultXDisplay. + +--- + base/message_loop/message_pump_gtk.cc | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/base/message_loop/message_pump_gtk.cc b/base/message_loop/message_pump_gtk.cc +index ad65113..af59685 100644 +--- a/base/message_loop/message_pump_gtk.cc ++++ b/base/message_loop/message_pump_gtk.cc +@@ -85,6 +85,9 @@ void MessagePumpGtk::DispatchEvents(GdkEvent* event) { + DidProcessEvent(event); + } + ++// FIXME: Get our own MessagePumpUI to avoid this. ++// Comment out this version so that our Qt version in shared_globals.cpp is used. ++/* + // static + Display* MessagePumpGtk::GetDefaultXDisplay() { + static GdkDisplay* display = gdk_display_get_default(); +@@ -96,6 +99,7 @@ Display* MessagePumpGtk::GetDefaultXDisplay() { + } + return GDK_DISPLAY_XDISPLAY(display); + } ++*/ + + void MessagePumpGtk::WillProcessEvent(GdkEvent* event) { + FOR_EACH_OBSERVER(MessagePumpObserver, observers(), WillProcessEvent(event)); +-- +1.8.4 + diff --git a/patches/patch-chromium.sh b/patches/patch-chromium.sh index 510237a5acff57286e83b4aed830b82f111513c8..2c3834b081cd5ac480f887fc011798374123920c 100755 --- a/patches/patch-chromium.sh +++ b/patches/patch-chromium.sh @@ -68,6 +68,7 @@ git am $PATCH_DIR/0001-remove-Wno-deprecated-register-from-common.gypi.patch git am $PATCH_DIR/0001-Solve-conflicts-when-including-both-QtOpenGL-headers.patch git am $PATCH_DIR/0001-Do-not-forward-declare-UIResourceRequest-Identity-an.patch git am $PATCH_DIR/0001-Fix-the-build-with-a-GL-ES2-configured-Qt.patch +git am $PATCH_DIR/0001-Hide-the-definition-of-MessagePumpGtk-GetDefaultXDis.patch cd $CHROMIUM_SRC_DIR/third_party/WebKit echo "Entering $PWD" diff --git a/shared/shared.pro b/shared/shared.pro index a125819e05b5d25c134a055c0c7fddff18a6c564..6c35063a8a516fcc8ab6c8dba673a76baf91f10a 100644 --- a/shared/shared.pro +++ b/shared/shared.pro @@ -23,6 +23,7 @@ PER_CONFIG_DEFINES = QTWEBENGINEPROCESS_PATH=\\\"$$getOutDir()/%config/$$QTWEBEN CONFIG(release, debug|release): DEFINES += NDEBUG QT += gui +QT_PRIVATE += gui-private SOURCES = \ resource_bundle_qt.cpp \ diff --git a/shared/shared_globals.cpp b/shared/shared_globals.cpp index 70ef901dba4ac6863458c451377a64b569486543..3d20ad45d6b40c21528b298babddec3eedff77a0 100644 --- a/shared/shared_globals.cpp +++ b/shared/shared_globals.cpp @@ -41,10 +41,17 @@ #include "shared_globals.h" +#include "base/message_loop/message_pump_gtk.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" +#include <QGuiApplication> #include <QScreen> #include <QWindow> +#include <qpa/qplatformnativeinterface.h> + +#if defined(USE_X11) +#include <X11/Xlib.h> +#endif void GetScreenInfoFromNativeWindow(QWindow* window, WebKit::WebScreenInfo* results) { @@ -63,6 +70,23 @@ void GetScreenInfoFromNativeWindow(QWindow* window, WebKit::WebScreenInfo* resul *results = r; } +namespace base { + +#if defined(USE_X11) +Display* MessagePumpGtk::GetDefaultXDisplay() { + static void *display = qApp->platformNativeInterface()->nativeResourceForScreen(QByteArrayLiteral("display"), qApp->primaryScreen()); + if (!display) { + // XLib isn't available or has not been initialized, which is a decision we wish to + // support, for example for the GPU process. + static Display* xdisplay = XOpenDisplay(NULL); + return xdisplay; + } + return static_cast<Display*>(display); +} +#endif + +} + namespace content { class WebContentsImpl; class WebContentsViewPort;