From 16a3a05665b5d586be866d795a7da43062bf080e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 23 May 2024 10:05:22 +0200 Subject: [PATCH] frational-scale: Don't hard code denomainator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using the denominator 120 artificially limits the way of implementing fractional scaling that makes it impossible in certain situations to describe a configuration where a fullscreen window covers the whole monitor. In practice, it means a compositor who always uses the whole monitor resolution cannot agree on a common expected size of surface buffer sizes, as too much precision is lost when transferring the scale over the wire. This means compositors, in order to always be capable of getting the same resulting buffer size as clients, must artificially limit the scaling factor precision, which means it won't always be possible to get a logical fullscreen integer size to match screen resolution. Fix this by not hard coding the denominator, and allow compositors to transfer a factor without loosing precision. Compositors who want to continue to use scaling factors with less precision can hard code 120 in their own implementation to achieve the current behavior. Signed-off-by: Jonas Ã…dahl --- .../fractional-scale/fractional-scale-v1.xml | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/staging/fractional-scale/fractional-scale-v1.xml b/staging/fractional-scale/fractional-scale-v1.xml index 350bfc0..bf1aa96 100644 --- a/staging/fractional-scale/fractional-scale-v1.xml +++ b/staging/fractional-scale/fractional-scale-v1.xml @@ -44,7 +44,7 @@ rounding algorithm for subsurface position and size is not defined. - + A global interface for requesting surfaces to use fractional scales. @@ -76,7 +76,7 @@ - + An additional interface to a wl_surface object which allows the compositor to inform the client of the preferred scale. @@ -95,8 +95,24 @@ compositor suggests that the client should use. The sent scale is the numerator of a fraction with a denominator of 120. + + This event is deprecated in favor of preferred_scale2. It will not be + emitted when having bound version 2 or higher. + + + + + + Notification of a new preferred scale for this surface that the + compositor suggests that the client should use. + + The sent scale is the numerator and denomanator of a fraction. + + + +