Detect Konqueror and use glib event loop instead of Xt one

Unfortunately, while Konqueror pretends to have an Xt event loop, it is
completely non-functional. Block hooks will not run, because it is a Qt
event loop polling Xt. Work procs also do not work because Xt does not
report them in XtAppPending. A timeout should, in theory, work, but
Konqueror doesn't even enable its Xt bridge most of the time! If the
plug-in requests XEmbed (as Flash does), a PluginHostXt is never created
and XtEvents::enable is never called. Instead of fighting all this, just
use the glib event loop. They have a bridge and Qt uses the glib event
loop these days anyway.

The only reason it used to work is because, not supporting windowless
plug-ins, most of communication was from browser to plug-in. Requests
would just get queued up and (with luck) not time out. With the new
delayed sync mechanism, we are unable to register the delayed sync and
instead the plug-in hangs.
This commit is contained in:
David Benjamin 2011-05-15 15:26:43 -04:00
parent fe3a3e5416
commit 2cd26d4902
1 changed files with 4 additions and 1 deletions

View File

@ -3947,7 +3947,10 @@ static void plugin_init(int is_NP_Initialize)
mozilla_funcs.getvalue(NULL, NPNVToolkit, (void *)&toolkit);
// Initialize RPC events listener, try to attach it to the main event loop
if (toolkit == NPNVGtk12 || toolkit == NPNVGtk2) { // GLib
if (toolkit == NPNVGtk12 || toolkit == NPNVGtk2
|| toolkit == 0xFEEDABEE) { // GLib
// We use the glib event loop in Konqueror (0xFEEDABEE) because
// its Xt event loop bridge is completely broken and non-functional.
D(bug(" trying to attach RPC listener to main GLib event loop\n"));
g_rpc_source = rpc_event_source_new(g_rpc_connection);
g_source_set_priority(g_rpc_source, G_PRIORITY_LOW);