[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#20645: Various patches to let nspluginviewer work with DjVu.
From:       Leon Bottou <leonb () research ! att ! com>
Date:       2001-03-09 15:49:44
[Download RAW message or body]

Stefan Schimanski wrote:
> Dejavu really works quite well now. Some crashes of nspluginviewer on
> http://www.djvuzone.org/djvu/cat/index.html while shutting down the plugin,
> but nothing which crashs konqi. Great work already!

I have found two main causes for crashes.
One was related to the debug messages in qt_set_socket_handler.
The second seems to be related to the premature destruction
of the windows created by nspluginviewer. 
Here is what I suspect happens when konqi 
deletes the nspluginloader.

NsPluginLoader::~NSPluginLoader() is called.
  That causes a call to shutdown().
  The nspluginviewer then destroys the XtAppShell widget.
  That puts a XDestroyWindow message in the X connection.
  It might be flushed or not.

KJavaEmbed::~KJavaEmbed() is called.
  It tries to unmap the XtAppShell window that may or 
  may not be destroyed already.  Finally it destroys its
  widget window, therefore destroying all subwindows as well
  (including possibly the XtAppShell widghet window).

In other words, too many process are trying to destroy the same window.
Attached are a few more patches for kjavaembed.cpp.
I am not sure they fix everything, but these cannot hurt.
The first part makes sure that KJavaEmbed will indeed receive
DestroyNotify messages for the embedded window (selecting the right
event mask).
The second part makes sure that destroying the KJaveEmbed object will
not zap the embedded window before nspluginviewer.
 
> Flash still works fine too, so I think it may be good to get them tested as
> good as possible by applying them to cvs. I will that in a minute...

Cool thanks.

- Leon Bottou



P.S.1:
So far I have been unable to load a DjVu using an <embed...> tag.
Do you have an idea about the cause?


P.S.2:
I contacted the Lizardtech people about fixing the 
obnoxious toolbar dialog in the DjVu plugin.  
Here is what they say:

> Subject: FW: Various patches to let nspluginviewer work with DjVu.
> Date: Thu, 8 Mar 2001 16:02:44 -0800
> From: Bill Riemers <bcr@lizardtech.com>
> CC: "'leonb@research.att.com'" 
> 
> Stefan and Leon,
> 
> Thankyou for your very good work.  I'm
> forwarding your message to Ming Chen, the
> person currently in charge of plug-in development.
> 
> Is the annoying dialog that pops up, the one asking
> whether it should show the toolbar with too small of
> a window?
> 
> If so, I'll make sure the next version of the plug-in
> has a "do not this dialog box ever again" type checkbox,
> if we don't just remove the dialog all together.
> 
> BTW.  I've noticed some browsers don't pass CGI-BIN arguments
> from the <frame src="..."> string.  So purhaps it would be
> better to use an <EMBED> command.
> 
>                      Bill
> 
> p.s. Leon, please forward this reply to Stefan Schimanski.
["javaembed.cpp.diff" (text/plain)]

--- javaembed.cpp.orig	Fri Mar  9 10:20:42 2001
+++ javaembed.cpp	Fri Mar  9 10:28:50 2001
@@ -490,8 +490,15 @@
     XWithdrawWindow( qt_xdisplay(), window, qt_xscreen() );
     QApplication::flushX();
 
+    //make sure we will receive destroy notifications for the embedded window.
+    XWindowAttributes xwattr;
+    XGetWindowAttributes(qt_xdisplay(), winId(), &xwattr);
+    XSelectInput(qt_xdisplay(), winId(), SubstructureNotifyMask | xwattr.your_event_mask);
+
     //now reparent the window to be swallowed by the KJavaEmbed widget
     XReparentWindow( qt_xdisplay(), window, winId(), 0, 0 );
+    //and add it to the save set in case this window gets destroyed before
+    XAddToSaveSet(qt_xdisplay(), window);
     QApplication::syncX();
 
     //now resize it


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic