transactions: handle preemption properly

when a transaction interrupts an ongoing transaction, we must be careful
to handle the configures properly. This commit adds a new member to view
so that we can store the dimensions sent with the last configure in
order to determine if the preempting transaction should override the
ongoing configure or not.

Additionally, some views do not ack a configure if they already have the
requested dimensions. This can happen if a pending configure setting
alternative dimensions is overridden, so in this case we do not wait for
an ack before committing the transaction.
This commit is contained in:
Isaac Freund
2020-06-08 00:10:30 +02:00
parent 7b1e07d3d5
commit c0d7e71ec4
6 changed files with 94 additions and 37 deletions

View File

@ -58,13 +58,13 @@ pub fn init(self: *Self, view: *View, wlr_xwayland_surface: *c.wlr_xwayland_surf
}
/// Tell the client to take a new size
pub fn configure(self: Self, pending_box: Box) void {
pub fn configure(self: Self, box: Box) void {
c.wlr_xwayland_surface_configure(
self.wlr_xwayland_surface,
@intCast(i16, pending_box.x),
@intCast(i16, pending_box.y),
@intCast(u16, pending_box.width),
@intCast(u16, pending_box.height),
@intCast(i16, box.x),
@intCast(i16, box.y),
@intCast(u16, box.width),
@intCast(u16, box.height),
);
// Xwayland surfaces don't use serials, so we will just assume they have
// configured the next time they commit. Set pending serial to a dummy