view: get rid of notifyConfiguredOrApplyPending()

This function is only called in one place, just inline the code.
This commit is contained in:
Isaac Freund 2021-06-08 02:55:06 +00:00
parent cef6d5a0be
commit 1bacaa5b43
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
2 changed files with 13 additions and 17 deletions

View File

@ -273,22 +273,6 @@ pub fn saveBuffers(self: *Self) void {
self.surface.?.forEachSurface(*std.ArrayList(SavedBuffer), saveBuffersIterator, &self.saved_buffers); self.surface.?.forEachSurface(*std.ArrayList(SavedBuffer), saveBuffersIterator, &self.saved_buffers);
} }
/// If this commit is in response to our configure and the
/// transaction code is tracking this configure, notify it.
/// Otherwise, apply the pending state immediately.
pub fn notifyConfiguredOrApplyPending(self: *Self) void {
self.pending_serial = null;
if (self.shouldTrackConfigure()) {
server.root.notifyConfigured();
} else {
const self_tags_changed = self.pending.tags != self.current.tags;
self.current = self.pending;
self.commitOpacityTransition();
if (self_tags_changed) self.output.sendViewTags();
self.output.damage.addWhole();
}
}
fn saveBuffersIterator( fn saveBuffersIterator(
surface: *wlr.Surface, surface: *wlr.Surface,
surface_x: c_int, surface_x: c_int,

View File

@ -261,7 +261,19 @@ fn handleCommit(listener: *wl.Listener(*wlr.Surface), surface: *wlr.Surface) voi
view.surface_box = new_box; view.surface_box = new_box;
if (s == self.xdg_surface.configure_serial) { if (s == self.xdg_surface.configure_serial) {
view.notifyConfiguredOrApplyPending(); // If this commit is in response to our configure and the
// transaction code is tracking this configure, notify it.
// Otherwise, apply the pending state immediately.
view.pending_serial = null;
if (view.shouldTrackConfigure()) {
server.root.notifyConfigured();
} else {
const self_tags_changed = view.pending.tags != view.current.tags;
view.current = view.pending;
view.commitOpacityTransition();
if (self_tags_changed) view.output.sendViewTags();
view.output.damage.addWhole();
}
} else { } else {
// If the client has not yet acked our configure, we need to send a // If the client has not yet acked our configure, we need to send a
// frame done event so that it commits another buffer. These // frame done event so that it commits another buffer. These