Skip to content
  • Vlad Zahorodnii's avatar
    wayland: Properly handle async xdg-decoration updates · acb0683e
    Vlad Zahorodnii authored
    Currently, if a window switches between SSD and CSD, it is possible to
    encounter a "corrupted" state where the server-side decoration is wrapped
    around the window while it still has the client-side decoration.
    
    The xdg-decoration protocol fixes this problem by saying that decoration
    updates are bound to xdg_surface configure events.
    
    At the moment, kwin sort of applies decoration updates immediately. With
    this change, decoration updates will be done according to the spec.
    
    If the compositor wants to create a decoration, it will send a configure
    event and apply the decoration when the configure event is acked by the
    client. In order to send the configure event with a good window geometry
    size, kwin will create the decoration to query the border size but not
    assign it to the client yet. As is, KDecoration api doesn't make
    querying the border size ahead of time easy. The decoration plugin can
    assign arbitrary border sizes to windows as it pleases it. We could change
    that, but it effectively means starting KDecoration3 and setting existing
    window deco ecosystem around kwin on fire the second time, that's off the
    table.
    
    If the compositor wants to remove the decoration, it will send a
    configure event. When the configure event is acked and the surface is
    committed, the window decoration will be destroyed.
    
    Sync'ing decoration updates to configure events ensures that we cannot
    end up with having both client-side and server-side decoration. It also
    helps us to fix a bunch of geometry related issues caused by creating
    and destroying the decoration without any surface buffer attached yet.
    
    BUG: 445259
    acb0683e