Skip to content
  • Carlos Garnacho's avatar
    wayland: Use xdg-activation for non-startup initiated focus requests · 4dcacff3
    Carlos Garnacho authored
    Currently, we have all the plumbing in place so that GTK consumes the
    startup notification ID when focusing a window through the xdg-activation
    protocol.
    
    This however misses the case that a window might be requested to be
    focused with no startup ID (i.e. via interaction with the application,
    not through GApplication or other application launching logic).
    
    In this case, we let the application create a token that will be
    consumed by itself. The serial used is that from the last
    interaction, so the compositor will still be able to do focus prevention
    logic if it applies.
    
    Since we already do have a last serial at hand, prefer xdg-activation
    all the way over the now stale gtk-shell focusing support. The timestamp
    argument becomes unused, but that is a weak argument to prefer the
    private protocol over the standard one. The gtk-shell protocol support
    is so far left for interaction with older Mutter.
    4dcacff3