Closed Bug 116924 Opened 23 years ago Closed 23 years ago

Looks like --display is wrong handled for plugins

Categories

(Core Graveyard :: Plug-ins, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: avm, Assigned: srgchrpv)

Details

Attachments

(1 file, 2 obsolete files)

During viewing flash Mozilla crashed, when running with --display option.

Steps to reproduce:

1)set DISPLAY environment variable to something wrong(e.g other machine)
2)Run mozilla with --display <right_display> option
3)Load any page with flash data(required flash plugin)
Note: Mozilla crashed with following messages in console:
About to create new ws_info...
About to create new xtbin of 149 X 20 from 0x8420f08...
About to show xtbin(0x84a7b00)...
completed gtk_widget_show(0x84a7b00)
Nullplugin: plugin received window resize.
Window=(139134180)
W=(149) H=(20)
Gdk-ERROR **: BadWindow (invalid Window parameter)
  serial 8 error_code 3 request_code 1 minor_code 


When using DISPLAY variable,not --display option all works fine.
Look at gtkxtbin.c method xtbin_new().

When we initialize the Xt toolkit, we create new X connecton with:
    xtdisplay = XtOpenDisplay(app_context, NULL, NULL,
                              "Wrapper", NULL, 0, &mArgc, mArgv);

Second parameter of XtOpenDisplay() is display we should use. In case it's NULL,
XtOpenDisplay() uses DISPLAY environment variable. So, if DISPLAY variable and
--display option parameter differs, we have wrong conditions for plugin window
creating.

I think, every time we'd like to create xtbin, we already have gdk initialized,
with correct display (where --display is more significant than DISPLAY var).
So, we can use gdk_get_display() call. This call returns actual display.
Attached patch Proposed fix. (obsolete) — Splinter Review
Fix for bug, please review.
Keywords: patch, review
Sergi, could you attach a unified diff instead of a context diff?  Those are 
much easier to review..

Also, does the xlib or qt code need a similar change?
Serge, would you please take a look?
Neither xlib code nor qt code contains opening of new display.
Only gtk. Do not know why, but initializing of Xt on display was
opened by gdk freezes gdk activity. So in gtk/gdk case we need new
connection to X.
Attached patch Same patch, unified diff. (obsolete) — Splinter Review
Attachment #62756 - Attachment is obsolete: true
Attachment #62845 - Attachment is obsolete: true
--- Mass reassigning Unix bugs to serge ---
Assignee: av → serge
Comment on attachment 62846 [details] [diff] [review]
Same patch, unified diff.

you are right, r=serge
Attachment #62846 - Flags: review+
Target Milestone: --- → mozilla0.9.9
Does this still need super review?
Yes!
Comment on attachment 62846 [details] [diff] [review]
Same patch, unified diff.

sr=beard
Attachment #62846 - Flags: superreview+
checked in on the trunk (pre-branch).
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
v
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: