diff options
author | Pawel "l0ner" Soltys <pwslts@gmail.com> | 2012-02-02 14:23:19 +0100 |
---|---|---|
committer | Pawel "l0ner" Soltys <pwslts@gmail.com> | 2012-02-02 14:23:19 +0100 |
commit | ed2b6731ab373ac335fde87af177351facbd2f15 (patch) | |
tree | 81cc3d45c8c30aceadb4f597be819dc2863a3a3a /opensuse/core/tdebase/nsplugin-init-gtk.diff | |
parent | 021036598a306d8cf7204d6d62ff090278f7ecf1 (diff) | |
parent | 5f93960dbb108c2c6d09964d1ee0d2e390b1498c (diff) | |
download | tde-packaging-ed2b6731ab373ac335fde87af177351facbd2f15.tar.gz tde-packaging-ed2b6731ab373ac335fde87af177351facbd2f15.zip |
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tde-packaging
Diffstat (limited to 'opensuse/core/tdebase/nsplugin-init-gtk.diff')
-rw-r--r-- | opensuse/core/tdebase/nsplugin-init-gtk.diff | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/opensuse/core/tdebase/nsplugin-init-gtk.diff b/opensuse/core/tdebase/nsplugin-init-gtk.diff new file mode 100644 index 000000000..882c12443 --- /dev/null +++ b/opensuse/core/tdebase/nsplugin-init-gtk.diff @@ -0,0 +1,49 @@ +--- nsplugins/viewer/nsplugin.h~ 2008-02-13 10:40:38.000000000 +0100 ++++ nsplugins/viewer/nsplugin.h 2010-09-22 23:31:58.721961990 +0200 +@@ -315,6 +315,10 @@ private: + QPtrList<NSPluginInstance> _trash; + + QCString _app; ++ ++ // If plugins use gtk, we call the gtk_init function for them --- ++ // but only do it once. ++ static bool s_initedGTK; + }; + + +--- nsplugins/viewer/nsplugin.cpp~ 2008-02-13 10:40:38.000000000 +0100 ++++ nsplugins/viewer/nsplugin.cpp 2010-09-22 23:31:58.775909705 +0200 +@@ -1330,6 +1330,9 @@ DCOPRef NSPluginViewer::newClass( QStrin + + /****************************************************************************/ + ++bool NSPluginClass::s_initedGTK = false; ++ ++typedef void gtkInitFunc(int *argc, char ***argv); + + NSPluginClass::NSPluginClass( const QString &library, + QObject *parent, const char *name ) +@@ -1377,6 +1380,23 @@ NSPluginClass::NSPluginClass( const QStr + + // initialize plugin + kdDebug(1431) << "Plugin library " << library << " loaded!" << endl; ++ ++ // see if it uses gtk ++ if (!s_initedGTK) { ++ gtkInitFunc* gtkInit = (gtkInitFunc*)_handle->symbol("gtk_init"); ++ if (gtkInit) { ++ kdDebug(1431) << "Calling gtk_init for the plugin" << endl; ++ // 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); ++ s_initedGTK = true; ++ } ++ } ++ + _constructed = true; + _error = initialize()!=NPERR_NO_ERROR; + } |