View: fix/simplify logic in applyPending()

In particular, this fixes a crash that can happen if a client is made
non-fullscreen and then, while that transaction is ongoing, made
fullscreen again.
This commit is contained in:
Isaac Freund
2022-02-03 21:23:02 +01:00
parent 79d7775a3d
commit be870e058d
3 changed files with 22 additions and 27 deletions

View File

@ -273,8 +273,10 @@ fn handleSetClass(listener: *wl.Listener(*wlr.XwaylandSurface), _: *wlr.Xwayland
fn handleRequestFullscreen(listener: *wl.Listener(*wlr.XwaylandSurface), xwayland_surface: *wlr.XwaylandSurface) void {
const self = @fieldParentPtr(Self, "request_fullscreen", listener);
self.view.pending.fullscreen = xwayland_surface.fullscreen;
self.view.applyPending();
if (self.view.pending.fullscreen != xwayland_surface.fullscreen) {
self.view.pending.fullscreen = xwayland_surface.fullscreen;
self.view.applyPending();
}
}
/// Some X11 clients will minimize themselves regardless of how we respond.