Currently, we use enter/leave notify to switch the focus between mozilla and java plugins. However, we do not check if the enter/leave does happen between mozilla and java plugins. When java plugin popes up/close a window and the enter/leave notify happen between two java plugin windows, the focus changing has done by java plugin itself and the extra switching done by us may cause mozilla crash. In the patch, I add some check to make sure the enter/leave is between mozilla and plugin by checking if the notify detail is NONLINEAR.
Created attachment 111462 [details] java test case 1.use this test case as a java applete in a html page 2. click on the combo box on the right bottom of the plugin and choose 'line'. Don't release the button 3. move mouse to the canvas, release the button and a line is drawn. 4. move the mouse out of the mozilla result: the mozilla crashes and get an error message: The error was 'BadMatch (invalid parameter attributes)'. (Details: serial 23339 error_code 8 request_code 42 minor_code 0) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the --sync command line option to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) aborting...
Comment on attachment 111461 [details] [diff] [review] patch it might not be a good idea. I will figure out a better way.
By the definitions on <http://bugzilla.mozilla.org/bug_status.html#severity> and <http://bugzilla.mozilla.org/enter_bug.cgi?format=guided>, crashing and dataloss bugs are of critical or possibly higher severity. Only changing open bugs to minimize unnecessary spam. Keywords to trigger this would be crash, topcrash, topcrash+, zt4newcrash, dataloss.
Created attachment 112042 [details] [diff] [review] patch In this patch, when non-xembed plugin gets focus, I set gFocusWindow as the nsWindow that contains the plugin. I remove the manual focus switch in OnLeaveNotify. It is quite dangerous. Instead, I call gtk_window_show to let the window get back the focus by itself in SetFocus() which is the actual time we need to switch focus.
*** This bug has been marked as a duplicate of 191072 ***