From a05c797e4a7b32f933569aec6cfba180bc693528 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 17 Jul 2025 22:04:14 +0200 Subject: [PATCH] compositor: properly set infinite region on null input fixes #11065 --- src/protocols/core/Compositor.cpp | 2 +- src/protocols/types/SurfaceState.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index 21f9e0a7..5efe020c 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -219,7 +219,7 @@ CWLSurfaceResource::CWLSurfaceResource(SP resource_) : m_resource(re m_pending.updated.bits.input = true; if (!region) { - m_pending.input = CBox{{}, m_pending.bufferSize}; + m_pending.input = CBox{{}, Vector2D{INT32_MAX - 1, INT32_MAX - 1}}; return; } diff --git a/src/protocols/types/SurfaceState.hpp b/src/protocols/types/SurfaceState.hpp index 0876709a..e11692cf 100644 --- a/src/protocols/types/SurfaceState.hpp +++ b/src/protocols/types/SurfaceState.hpp @@ -26,12 +26,12 @@ struct SSurfaceState { bool rejected = false; // initial values, copied from protocol text - CHLBufferReference buffer = {}; // The initial surface contents are void - CRegion damage, bufferDamage; // The initial value for pending damage is empty - CRegion opaque; // The initial value for an opaque region is empty - CRegion input = CBox{{}, {INT32_MAX, INT32_MAX}}; // The initial value for an input region is infinite - wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL; // A newly created surface has its buffer transformation set to normal - int scale = 1; // A newly created surface has its buffer scale set to 1 + CHLBufferReference buffer = {}; // The initial surface contents are void + CRegion damage, bufferDamage; // The initial value for pending damage is empty + CRegion opaque; // The initial value for an opaque region is empty + CRegion input = CBox{{}, {INT32_MAX - 1, INT32_MAX - 1}}; // The initial value for an input region is infinite + wl_output_transform transform = WL_OUTPUT_TRANSFORM_NORMAL; // A newly created surface has its buffer transformation set to normal + int scale = 1; // A newly created surface has its buffer scale set to 1 // these don't have well defined initial values in the protocol, but these work Vector2D size, bufferSize;