aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2021-06-08 02:55:06 +0000
committerIsaac Freund <ifreund@ifreund.xyz>2021-06-08 02:56:19 +0000
commit1bacaa5b4397e6432f35b73d52d35cf6646371ed (patch)
tree92d8dbee61b72cbd4659d72a283167840af61a86
parentcef6d5a0bee35600a6b2a308e381acfdd4f70581 (diff)
downloadriver-1bacaa5b4397e6432f35b73d52d35cf6646371ed.tar.gz
river-1bacaa5b4397e6432f35b73d52d35cf6646371ed.tar.xz
view: get rid of notifyConfiguredOrApplyPending()
This function is only called in one place, just inline the code.
-rw-r--r--river/View.zig16
-rw-r--r--river/XdgToplevel.zig14
2 files changed, 13 insertions, 17 deletions
diff --git a/river/View.zig b/river/View.zig
index 3c6f4f2..9329827 100644
--- a/river/View.zig
+++ b/river/View.zig
@@ -273,22 +273,6 @@ pub fn saveBuffers(self: *Self) void {
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(
surface: *wlr.Surface,
surface_x: c_int,
diff --git a/river/XdgToplevel.zig b/river/XdgToplevel.zig
index 39b2dc1..e74fcb2 100644
--- a/river/XdgToplevel.zig
+++ b/river/XdgToplevel.zig
@@ -261,7 +261,19 @@ fn handleCommit(listener: *wl.Listener(*wlr.Surface), surface: *wlr.Surface) voi
view.surface_box = new_box;
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 {
// If the client has not yet acked our configure, we need to send a
// frame done event so that it commits another buffer. These