Skip to content
  • Guido Günther's avatar
    window: Delay showing default browser dialog · 650105b3
    Guido Günther authored
    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.
    
    Closes: World/Phosh/phoc#367
    650105b3