Comment 4 for bug 21753

Revision history for this message
In , Mpgritti (mpgritti) wrote :

Comment on attachment 184942
updated patch

Some comments:

- The approach looks correct to me. The toplevel window is not specified by the
caller but nsWindow is determining it, so I think it's nsWindow job to keep it
updated. Though, I'd like someone with more knowledge of the code to take a
look.

- While we are at it I think we should fix also the dialog case. We should
probably connect the signal just after get_toplevel and have SetToplevelWindow
deal with both cases.

+ mParentContainer = parentMozContainer;

Would probably be cleaner to just store this as class member.

+ GtkWidget *toplevelCandidate = gtk_widget_get_toplevel (container);
+ GtkWidget *toplevel = GTK_WIDGET_TOPLEVEL (toplevelCandidate) ?
toplevelCandidate : nsnull;
+
+ window->SetTransientParent (GTK_WINDOW (toplevel));

Using something like if (GTK_WIDGET_TOPLEVEL (toplevel)) ... else... would be
probably more readable.