From 6a29509dfffca4a04215d715cf28b7577ba141fc Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 10 Oct 2023 15:40:34 +1000 Subject: [PATCH] doc: Fix the InputCapture barrier examples A barrier is either at the top or at the left edge, not both. This means the actual barriers need to go from zone->x to zone->width - 1, the next pixel (zone->x + zone->width) is the first pixel of the adjacent zone if any. We could allow this in the spec but it makes implementations a lot harder: on a two-screen setup the edge pixel would need special casing, the barrier 0-1920 and 1920-3840 are both valid on either screen despite having a single-pixel overlap. An easier approach is to make sure each barrier only covers the pixels intended, i.e. 0-1919 and 1920 to 3839 in this case. --- data/org.freedesktop.portal.InputCapture.xml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/data/org.freedesktop.portal.InputCapture.xml b/data/org.freedesktop.portal.InputCapture.xml index ea7da2d74..b12ce9b27 100644 --- a/data/org.freedesktop.portal.InputCapture.xml +++ b/data/org.freedesktop.portal.InputCapture.xml @@ -205,8 +205,11 @@ (from compositor-determined input devices) are sent to the application via the transport layer. - Pointer barriers are situated on the top or left of their respective pixels and a - pointer barrier must be situated at the outside boundary of the union of all zones. + Pointer barriers are situated on the top (for horizontal barriers) or left + (for vertical barriers) edge of their respective pixels and their width or height + is inclusive each pixel's width or height. In other words, a barrier spanning + x1=0, x2=1 is exactly two pixels wide. A pointer barrier must be situated at the + outside boundary of the union of all zones. A pointer barrier must be fully contained within one zone. For example, consider two zones of size 1920x1080 with offsets @@ -214,12 +217,12 @@ The following pointer barriers are permitted: - top edge of left screen: x1=0,y1=0,x2=1920,y1=0 - bottom edge of left screen: x1=0,y1=1080,x2=1920,y1=1080 - top edge of right screen: x1=1920,y1=0,x2=3840,y1=0 - bottom edge of right screen: x1=1920,y1=1080,x2=3840,y1=1080 - left edge of left screen: x1=0,y1=0,x2=0,y1=1080 - right edge of right screen: x1=3840,y1=0,x2=3840,y1=1080 + top edge of left screen: x1=0,y1=0,x2=1919,y1=0 + bottom edge of left screen: x1=0,y1=1080,x2=1919,y1=1080 + top edge of right screen: x1=1920,y1=0,x2=3839,y1=0 + bottom edge of right screen: x1=1920,y1=1080,x2=3839,y1=1080 + left edge of left screen: x1=0,y1=0,x2=0,y1=1079 + right edge of right screen: x1=3840,y1=0,x2=3840,y1=1079 A pointer barrier is considered triggered when the pointer would