[PATCH] Fix XEMBED support

Gwenole Beauchesne gb.public at free.fr
Sat Dec 6 10:33:57 UTC 2008


Hi,

Here is a rework of the XEMBED hack code that fixes lost-events  
regressions.

I learnt something crucial: without nspluginwrapper, i.e. in in- 
process plugins mode, the browser (and actually Gtk2) never destroys  
the plugin window, even on NPP_Destroy(), or GtkSocket destroy. Never.  
I assume the X server takes care of that on XCloseDisplay(). One thing  
is sure, the GtkSocket windows are never XDestroyWindow()'ed for the  
lifetime of the program.

In out-of-process mode, i.e. with nspluginwrapper, a GtkSocket  
"destroy" will cause all windows in the hierarchy to be destroyed. In  
my opinion, that mismatch in behaviour is a bug in GtkPlug / GtkSocket  
implementation.

So, I decided to mimic that behaviour, but in a smarter way. i.e. keep  
the GtkPlug / GtkSocket for correct XEMBED implementation (focus...)  
but never destroy the plugin window... until NPP_Destroy(). So far,  
the patch in attachment accomplishes this by catching the  
WM_DELETE_WINDOW event sent by the parent GtkSocket and simply don't  
propagate it into the actual window destruction code. Then, the  
NPP_Destroy() will trigger a normal window destruction through the  
GtkPlug destructor.

Note: this patch depends on current Gtk2 implementations. If Gtk3  
someday changes this process, then we probably will fail again.  
However, considering the way GtkPlug / GtkSocket / GdkWindow are  
implemented, I pretty doubt anybody would want to change that (even  
for the above-mentionned bug) as there are interesting ways to break  
existing applications. e.g. Firefox will start crashing without  
nspluginwrapper the same way nspluginwrapper is crashing today without  
the following patch...

nspluginwrapper 1.2.0 is almost complete now. There is a remaining  
regression yet to be fixed (the one noticed by Warren). I have an idea  
I will test this weekend.

Regards,
Gwenole.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nspluginwrapper-fix-XEMBED.patch
Type: application/octet-stream
Size: 4465 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/nspluginwrapper-devel-list/attachments/20081206/16bdb758/attachment.obj>
-------------- next part --------------






More information about the Nspluginwrapper-devel-list mailing list