Skip to content

Commit

Permalink
doc: Fix the InputCapture barrier examples
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
whot authored and jadahl committed Oct 12, 2023
1 parent 6e1211b commit 6a29509
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions data/org.freedesktop.portal.InputCapture.xml
Original file line number Diff line number Diff line change
Expand Up @@ -205,21 +205,24 @@
(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
0,0 and 1920,0, respectively. (i.e. a left-right dual-monitor setup).
The following pointer barriers are permitted:
<itemizedlist>
<listitem><para>top edge of left screen: <literal>x1=0,y1=0,x2=1920,y1=0</literal></para></listitem>
<listitem><para>bottom edge of left screen: <literal>x1=0,y1=1080,x2=1920,y1=1080</literal></para></listitem>
<listitem><para>top edge of right screen: <literal>x1=1920,y1=0,x2=3840,y1=0</literal></para></listitem>
<listitem><para>bottom edge of right screen: <literal>x1=1920,y1=1080,x2=3840,y1=1080</literal></para></listitem>
<listitem><para>left edge of left screen: <literal>x1=0,y1=0,x2=0,y1=1080</literal></para></listitem>
<listitem><para>right edge of right screen: <literal>x1=3840,y1=0,x2=3840,y1=1080</literal></para></listitem>
<listitem><para>top edge of left screen: <literal>x1=0,y1=0,x2=1919,y1=0</literal></para></listitem>
<listitem><para>bottom edge of left screen: <literal>x1=0,y1=1080,x2=1919,y1=1080</literal></para></listitem>
<listitem><para>top edge of right screen: <literal>x1=1920,y1=0,x2=3839,y1=0</literal></para></listitem>
<listitem><para>bottom edge of right screen: <literal>x1=1920,y1=1080,x2=3839,y1=1080</literal></para></listitem>
<listitem><para>left edge of left screen: <literal>x1=0,y1=0,x2=0,y1=1079</literal></para></listitem>
<listitem><para>right edge of right screen: <literal>x1=3840,y1=0,x2=3840,y1=1079</literal></para></listitem>
</itemizedlist>
A pointer barrier is considered triggered when the pointer would
Expand Down

0 comments on commit 6a29509

Please sign in to comment.