window: Delay showing default browser dialog
The set_parent used to happen in the main window's show
handler but at
that point the main window isn't mapped yet under Wayland (as there's no
buffer attached):
[3694190.560] -> xdg_toplevel@46.set_parent(nil)
[3694198.318] -> xdg_toplevel@53.set_parent(xdg_toplevel@46)
[3694251.530] -> wl_surface@48.attach(wl_buffer@60, 0, 0)
Conformant wayland compositors should ignore the set_parent
in that
case. Citing the xdg-shell's set_parent() documentation:
Only mapped surfaces can have child surfaces. Setting a parent which is not mapped is equivalent to setting a null parent. If a surface …
Thus the default browser dialog would appear below the main window (but still grabbing all input hence making epiphany look "frozen").
Moving the gtk_window_present()
into idle fixes this.
Moving to adwaita's bottom sheets would likely fix this as well but I think it makes sense to have the current case fixed first.
Closes: World/Phosh/phoc#367 (closed)
EDIT: I assume mutter doesn't hit this due to the gtk_shell
's set_modal
request but other compositors like e.g. wayfire are affected as well