Determine the X Display edge in a multi X screen configuration

Evgeny Zubok evgeny.zubok at tochka.ru
Thu Oct 26 16:15:04 UTC 2017


Adam Jackson <ajax at nwnk.net> writes:

> On Sat, 2017-10-21 at 13:08 -0700, Jim Westfall wrote:
>
>> I'm wanting to determine when the mouse pointer is near the edge of the X 
>> Display.  
>> 
>> In the case when there is only one X screen, the edge of the X screen 
>> will be the edge of the X Display.  However when multiple separate X 
>> screens (zaphod) make up the X Display using this method is not 
>> possible.  For each X screen, there will be at least one edge that is 
>> adjacent to another X screen.  As such those edges are not the edge of the 
>> X display.
>> 
>> Originally I figured I would just be able to query the X server for 
>> details about the arrangement of the X screens and from that figure out 
>> the adjacent X screen edges.  However I've been unable to find any function 
>> that provides this information.  Does such a function exist? and/or is 
>> there some better way to determine if a given X screen edge is the edge of 
>> the X display?
>
> Such a function does not exist. As far as the protocol is concerned,
> screens do not have any relative geometry.

Can the pointer barriers which were introduced in X Fixes extention
serve a purpose? [1][2]

12. Pointer Barriers

Compositing managers and desktop environments may have UI elements in
particular screen locations such that for a single-headed display they
correspond to easy targets according to Fitt's Law, for example, the top
left corner.  For a multi-headed environment these corners should still
be semi-impermeable.  Pointer barriers allow the application to define
additional constraint on cursor motion so that these areas behave as
expected even in the face of multiple displays.

Absolute positioning devices like touchscreens do not obey pointer
barriers.  There's no advantage to target acquisition to do so, since on
a touchscreen all points are in some sense equally large, whereas for a
relative positioning device the edges and corners are infinitely large.

[1]
http://who-t.blogspot.ru/2012/12/whats-new-in-xi-23-pointer-barrier.html
[2] https://www.x.org/releases/X11R7.7/doc/fixesproto/fixesproto.txt



More information about the xorg-devel mailing list