Closed Bug 168116 Opened 22 years ago Closed 19 years ago

Need to implement nsIWidget::SetParent on GTK

Categories

(Core Graveyard :: GFX, defect, P3)

x86
Linux
defect

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: kmcclusk, Assigned: MatsPalmgren_bugz)

References

()

Details

(Keywords: helpwanted, testcase, top100, Whiteboard: whitebox)

Attachments

(2 files, 1 obsolete file)

this bug was broken off from bug 129034.

The platform specific widget library needs to support reparenting existing
nsIWidget's by implementing the nsIWidget::SetParent method. Until this is
Mozilla's print preview will sometimes display iframes and other elements which
require native widgets on the wrong page.

CC'ing peterl since plugin's also need this capability.
Keywords: top100
Keywords: nsbeta1
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.2beta
Looking at it
Attached patch possible patch for this (obsolete) — Splinter Review
This patch assumes that what we really need to reparent is either mShell or
mMozArea. Rod, do you have a test case that you can apply this patch to? I'd
suggest having blizzard or bryner look at this patch (I cc'd him and bryner)
and see if my assumptions about mShell and mMozArea in this context are
correct.
In your build open this testcase:
mozilla/layout/html/tests/printer/iframe_2nd_page/index.html

The IFrame should show correct on the 2nd page in PP
I just applied the fix and looked at the test in PP and the IFrame is still on
the 1st page. BUT! I am now updating my tree to make sure I have all the other
checkins for this.
Comment on attachment 99699 [details] [diff] [review]
possible patch for this

I don't think it makes sense to reparent mShell, since mShell represents a
toplevel window.  I think what we want to do here is reparent mSuperWin, if we
have one.  I'll let blizzard give a definitive answer though.
Attachment #99699 - Flags: needs-work+
There are a few things to worry about here:

o If the widget that you are reparenting has an mMozArea or an mShell it's going
to be tough.  The mMozArea and mSuperWin in that case are linked and you can't
just unparent the superwin from the mozarea and go.

o Reparenting the superwin isn't as easy as it sounds, I don't think that I've
ever tried it, frankly.  You have to worry about the focus changes and you have
to worry about making sure that it's properly destroyed.
At the moment it will only be called for Print Preview so in this case the focus
won't matter.
I don't know if this will help simplify the solution. The SetParent will only be
called for a child window. In addition, the child window will specify a new
parent which will always be a descendant of the same top level window the child
was originally placed in. We will never move a window between top-level windows
and we will never reparent a top-level window to be a child of another top-level
window.

That does help a bit, yeah.
Target Milestone: mozilla1.2beta → mozilla1.3alpha
Whiteboard: whitebox
Blocks: 135263
nsbeta1-. 
Keywords: nsbeta1helpwanted, nsbeta1-
Priority: -- → P3
Target Milestone: mozilla1.3alpha → Future
This needs to be fixed to fix print preview bugs. (And eventually, to fix column
layout bugs.)
Assignee: rods → caillon
Status: ASSIGNED → NEW
Attached file Testcase
Attached patch Like so?Splinter Review
This fixes the first testcase on GTK1 and GTK2.
Robert, you said something about column layout - do you have a suggestion for a

testcase I can try?
Attachment #99699 - Attachment is obsolete: true
Attachment #190270 - Flags: superreview?(roc)
Attachment #190270 - Flags: review?(bryner)
Comment on attachment 190270 [details] [diff] [review]
Like so?

This won't be necessary in 1.9 because we'll move to no-child-windows but for
1.8 this is probably worth having. It's low risk because in the rare cases
where this gets called we currently just do something really really stupid.
Attachment #190270 - Flags: superreview?(roc)
Attachment #190270 - Flags: superreview+
Attachment #190270 - Flags: review?(bryner)
Attachment #190270 - Flags: review+
Attachment #190270 - Flags: approval1.8b4?
Assignee: caillon → mats.palmgren
Attachment #190270 - Flags: approval1.8b4? → approval1.8b4+
Checked in to trunk at 2005-08-08 19:40 PDT.

-> FIXED
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
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: