- 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.
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); >SetTransientPa rent (GTK_WINDOW (toplevel));
+ GtkWidget *toplevel = GTK_WIDGET_TOPLEVEL (toplevelCandidate) ?
toplevelCandidate : nsnull;
+
+ window-
Using something like if (GTK_WIDGET_ TOPLEVEL (toplevel)) ... else... would be
probably more readable.