diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-05-08 17:06:15 +0200 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-05-08 17:06:15 +0200 |
| commit | 14ffe91a52f4e5a6a706f02882bf19999b6a6739 (patch) | |
| tree | a6413363a17b4c743afb2541ecc8f4b25a82e7b7 | |
| parent | 0902e048bed7cfd4a63729051db811b6c889a440 (diff) | |
| download | river-14ffe91a52f4e5a6a706f02882bf19999b6a6739.tar.gz river-14ffe91a52f4e5a6a706f02882bf19999b6a6739.tar.xz | |
Better handle transactions with xwayland views
| -rw-r--r-- | src/XwaylandView.zig | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/XwaylandView.zig b/src/XwaylandView.zig index 56beec8..2530f19 100644 --- a/src/XwaylandView.zig +++ b/src/XwaylandView.zig @@ -66,6 +66,12 @@ pub fn configure(self: Self, pending_box: Box) void { @intCast(u16, pending_box.width), @intCast(u16, pending_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 + // value to indicate that a transaction has started. Note: we can't just + // call notifyConfigured() here as the transaction has not yet been fully + // initiated. + self.view.pending_serial = 0x66666666; } /// Inform the xwayland surface that it has gained focus @@ -145,7 +151,13 @@ fn handleUnmap(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void { } /// Called when the surface is comitted +/// TODO: check for unexpected change in size and react as needed fn handleCommit(listener: ?*c.wl_listener, data: ?*c_void) callconv(.C) void { const self = @fieldParentPtr(Self, "listen_commit", listener.?); - // TODO: check for unexpected change in size and react as needed + const view = self.view; + // See comment in XwaylandView.configure() + if (view.pending_serial != null) { + view.output.root.notifyConfigured(); + view.pending_serial = null; + } } |
