Wayland compositor (wlroots)
git clone https://git.lucas.co/cce-compositor.git
Window: fix first configure timeout handling
river/Window.zig | 6 ++++--
rivercompat/Window.zig | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/river/Window.zig b/river/Window.zig
index 9ae8d0a..e38f674 100644
--- a/river/Window.zig
+++ b/river/Window.zig
@@ -714,8 +714,10 @@ pub fn updateRenderingStart(window: *Window) void {
node_v1.sendPosition(scheduled_box.x, scheduled_box.y);
}
}
- if (window.rendering_scheduled.resend_dimensions or
- scheduled_box.width != sent.box.width or scheduled_box.height != sent.box.height)
+ // The check for 0 width/height is necessary to handle timeout of the first configure sent.
+ if (!scheduled_box.empty() and
+ (window.rendering_scheduled.resend_dimensions or
+ scheduled_box.width != sent.box.width or scheduled_box.height != sent.box.height))
{
if (window.object) |window_v1| {
window_v1.sendDimensions(scheduled_box.width, scheduled_box.height);
diff --git a/rivercompat/Window.zig b/rivercompat/Window.zig
index 2f64353..4aa2ede 100644
--- a/rivercompat/Window.zig
+++ b/rivercompat/Window.zig
@@ -145,7 +145,8 @@ pub fn updateWindowing(window: *Window, wm: *WindowManager) void {
pub fn updateRendering(window: *Window, wm: *WindowManager) void {
_ = wm;
- {
+
+ if (window.rendering.width != 0 and window.rendering.height != 0) {
window.shadow_surface.attach(window.shadow_buffer, 0, 0);
window.shadow_surface.damageBuffer(0, 0, math.maxInt(i32), math.maxInt(i32));
window.shadow_viewport.setDestination(window.rendering.width, window.rendering.height);