So Lionel just gave me a link to the the bugentry and I have attached now the
more complete workaround.
On Friday, June 25, 2010 11:04:56 Johannes Zellner wrote:
> Hi,
>
> since flashplugin version 10.1.53.64 qtwebkit crashes, since gtk_init() was
> not called before loading flash.
> According to Lionel this will be fixed in qtwebkit2.
>
> So the attached patch calls gtk_init(); from rekonq's main in order to
> workaround this crash. Unfortunately my cmake skills are not sufficient to
> only include gtk for the affected qtwebkit versions.
>
> So the patch is just the rare fix, sorry about that.
>
> Thanks,
> Johannes
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6f29bb2..a57ce15 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,6 +73,8 @@ ELSE(KDE4_FOUND)
MESSAGE(STATUS "")
ENDIF(KDE4_FOUND)
+# ----------------------------------- X11 -------------------------------------
+FIND_LIBRARY(xlib X11)
##### FINAL RESULTS #####
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d0e5721..825af27 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -90,6 +90,7 @@ INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${KDE4_INCLUDES}
${QT4_INCLUDES}
+ ${X11_INCLUDE_DIRS}
)
@@ -113,6 +114,7 @@ TARGET_LINK_LIBRARIES ( kdeinit_rekonq
${KDE4_KIO_LIBS}
${KDE4_KPARTS_LIBS}
${KDE4_THREADWEAVER_LIBRARIES}
+ ${X11_LIBRARIES}
)
diff --git a/src/main.cpp b/src/main.cpp
index 6b1f123..df1914e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -24,6 +24,7 @@
* ============================================================ */
+
// version include
#include "../version.h"
@@ -36,13 +37,36 @@
#include <KCmdLineArgs>
#include <KDebug>
+// includes needed for workaround recent flashplugins
+#include <QtCore/QLibrary>
+#include <X11/Xlib.h>
static const char description[] =
I18N_NOOP("A lightweight Web Browser for KDE based on WebKit");
+typedef void gtkInitFunc(int *argc, char ***argv);
extern "C" KDE_EXPORT int kdemain(int argc, char **argv)
{
+ // WORKAROUND: Prevent gtk based plugin crashes such as BR# 40567 by
+ // explicitly forcing the initializing of Gtk, i.e. calling gtk_init,
+ // whenver the symbol is present in the plugin library loaded above.
+ // Note that this workaround is based on code from the NSPluginClass ctor
+ // in KDE's kdebase/apps/nsplugins/viewer/nsplugin.cpp file.
+ gtkInitFunc* gtkInit;
+
+ QLibrary libgtk(QLatin1String("gtk-x11-2.0"), 0, 0);
+ gtkInit = (gtkInitFunc*)libgtk.resolve("gtk_init");
+ if (gtkInit) {
+ // Prevent gtk_init() from replacing the X error handlers, since the Gtk
+ // handlers abort when they receive an X error, thus killing the viewer.
+ int (*old_error_handler)(Display*, XErrorEvent*) = XSetErrorHandler(0);
+ int (*old_io_error_handler)(Display*) = XSetIOErrorHandler(0);
+ gtkInit(0, 0);
+ XSetErrorHandler(old_error_handler);
+ XSetIOErrorHandler(old_io_error_handler);
+ }
+
KAboutData about("rekonq",
0,
ki18n("rekonq"),
_______________________________________________
rekonq mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/rekonq