Closed Bug 514408 Opened 15 years ago Closed 15 years ago

improved plugin clipping

Categories

(Core Graveyard :: Widget: OS/2, defect)

x86
OS/2
defect
Not set
normal

Tracking

(status1.9.2 beta1-fixed)

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: dragtext, Assigned: dragtext)

Details

Attachments

(1 file)

The current method for clipping plugin widgets by resizing their windows hasn't been as successful as expected because:
- plugin setup code resizes the widget's window after the OS/2 code has already clipped it, causing it to overlay other content until the first scroll occurs;
- some plugins (most notably, mplayer) ignore the dimensions passed to them by NPP_SetWindow() and resize their content based on the size of the widget's window.

The attached patch resolves these issues by implementing Kp Myung-hun's suggestion to use a separate window to do the clipping.  It inserts a PM window between the base page & the plugin widget, then alters the window's size and the widget's position within it to clip the widget as needed.
Attachment #398370 - Flags: review?(mozilla)
Comment on attachment 398370 [details] [diff] [review]
implement plugin clipping windows

I'm not yet sure if I understand the new functions correctly. One stupid question upfront: if there are several plugins on the same page do they all get the same mClipWnd assigned to them? The page is just one nsWindow instance now, right?
(In reply to comment #1)
> if there are several plugins on the same page do they all get the same
> mClipWnd assigned to them? The page is just one nsWindow instance now, right?

The page may be one nsWindow, but so is each plugin widget - and each one has its own clipping window stored in mClipWnd.  For nsWindows that aren't plugins, mClipWnd will be null.

If you have PMTree, you can see how the windows are arranged when you visit Heiko Nitzsche's GBM Demo page <http://heikon.home.tlink.de/frames/gbm_plugin_mozilla_test_embed.html>.  Drill down to the page's window and you'll see 12 'nsClipWnd' children.  Each of them will have a MozillaWindowClass child:  that's the plugin window it's clipping.
Comment on attachment 398370 [details] [diff] [review]
implement plugin clipping windows

Of course, thanks for the reminder. I think this change actually leads to more readable code. :-)
Attachment #398370 - Flags: review?(mozilla) → review+
I'll try to fix my Hg setup to check this in, but this won't be quick. So maybe someone else can do it.
Keywords: checkin-needed
Whiteboard: c-n: mozilla-central and mozilla-1.9.2 (NPOTB)
http://hg.mozilla.org/mozilla-central/rev/3bd7c1481a4a
http://hg.mozilla.org/releases/mozilla-1.9.2/rev/7b3519c07c35
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: c-n: mozilla-central and mozilla-1.9.2 (NPOTB)
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: