Closed Bug 188987 Opened 22 years ago Closed 22 years ago

[gtk2] java plugins crashes due to incorrect focus switching

Categories

(Core :: XUL, defect)

x86
Linux
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 191072

People

(Reporter: iamawalrus, Assigned: iamawalrus)

Details

(Keywords: crash)

Attachments

(2 files, 1 obsolete file)

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.
Attached patch patch (obsolete) — Splinter Review
Attached file 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...
Attachment #111461 - Flags: review?(blizzard)
Comment on attachment 111461 [details] [diff] [review]
patch

it might not be a good idea. I will figure out a better way.
Attachment #111461 - Flags: review?(blizzard)
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.
Severity: normal → critical
Attached patch patchSplinter Review
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.
Attachment #111461 - Attachment is obsolete: true
Blocks: 191072
No longer blocks: gtk2
No longer blocks: 191072
Depends on: 191072
No longer depends on: 191072
Depends on: 191072

*** This bug has been marked as a duplicate of 191072 ***
Status: NEW → RESOLVED
Closed: 22 years ago
No longer depends on: 191072
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: