michaelforney/swc

Fix proper floating window support

Opened this issue · 1 comments

I was working at fixing floating windows in my wm, and couldn't get the floating windows to always be on top of the tiled ones. Tried a few tricks then decided to look at your velox code, and found this:

static void stack_arrange(struct layout * layout, struct window * window)
{
    /* TODO: Place window on top of stack when swc adds support for this. */
}

https://github.com/michaelforney/velox/blob/master/layout.c#L359

There are a few ways that this could be implemented.

This isn't the most important feature to add currently, but it shouldn't be forgotten either.

Yep, this is pretty high on my TODO. The biggest problem in terms of implementation is how to do damage tracking in a way that does not cause the entire screen to be repainted, even if the stacking order did not change.

One technique a window manager might want to do is to send all floating windows to the top (in the order that it wants them), every time the windows are arranged. However, from the compositor's perspective, if a window is sent to the top, it would be fully exposed, and so it would have to mark the entire clipped region as damaged. However, the next window may cover up the previous window, and so no repainting was actually necessary.

Maybe what we should do is add functions

swc_begin_restack()
swc_end_restack()

in which you can do all the restacking you want, but the only thing that matters is the ending order. I'll have to think about this.