You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want every frame to be perfect - every buffer shown at its native size, no windows overlaying (in the tiled layout), etc. Accomplishing this is non-trivial.
Atomic tree updates
Atomic modeset updates
Atomic fullscreen toggle
Atomic floating windows
Atomic focus updates
The plan is, in discrete tasks:
1. Refactor arrange_windows
Currently, arrange_windows lays out the windows, writes the desired boxes of everything to the tree, and sends configure events to clients. This needs to be broken into three steps, which will currently just be called at once (not attempting to be atomic, just refactoring the current behavior). The three steps are:
Call arrange_layout, which should most of the work arrange_windows does today, but outputs a list of:
Notably, we don't call apply_layout. Instead, we stow the pending layout somewhere and we update the ack_configure handler for the shell to look up the pending layout.
Something else to consider is that eventually we'll probably want to have some kind of callback function that gets hit when it's time to apply the layout, in addition to simply applying it. This could be used, for example, during modeswitching (arrange layout for the new mode, wait for all clients to be ready, then change the mode and apply the layout) or workspace switching (wait to actually switch the workspace until the new focused client has acked the focus change).
We want every frame to be perfect - every buffer shown at its native size, no windows overlaying (in the tiled layout), etc. Accomplishing this is non-trivial.
The plan is, in discrete tasks:
1. Refactor arrange_windows
Currently,
arrange_windows
lays out the windows, writes the desired boxes of everything to the tree, and sends configure events to clients. This needs to be broken into three steps, which will currently just be called at once (not attempting to be atomic, just refactoring the current behavior). The three steps are:Call
arrange_layout
, which should most of the workarrange_windows
does today, but outputs a list of:We will call this list the "layout". Next, call
configure_layout
, which should send configure events to clients affected by the layout update.Finally, call
apply_layout
to syncronize a potential layout with the actual sway tree.Now, let's change
arrange_windows
to look like this:2. Wait to apply layouts until all clients are ready
We now need to stash the configure serials for each client that was notified of pending changes. We define this data structure:
Then we update
arrange_windows
:Notably, we don't call
apply_layout
. Instead, we stow the pending layout somewhere and we update theack_configure
handler for the shell to look up the pending layout.Milestone: non-interactive updates will be atomic (mode changes, switch layout from splitv to splith, etc)
3. Stash textures on each ack configure
Then we can render the latest known good version of old clients, even if they ack different frames at different times.
Milestone: interactive updates will be atomic, but may be laggy
4. Time out pending layouts to deal with slow clients
Periodically check the list of pending layouts and apply them anyway if they get too old.
Milestone: interactive updates are atomic for fast clients but don't let slow clients cause lag (will instead render slow clients incorrectly)
The text was updated successfully, but these errors were encountered: