[Question] ZaphodHeads, ServerLayout without position information, and touchscreens

Böszörményi Zoltán zboszor at pr.hu
Fri Jul 24 11:38:03 UTC 2020


Hi,

we use this kind of ServerLayout:

Section "ServerLayout"
         Identifier      "LAYOUT"
         Option          "AutoServerLayout" "on"
         Screen 0 "SCREEN0"
         Screen 1 "SCREEN1" RightOf "SCREEN0"
EndSection

This way, their canvases look like they are put side by side.
E.g. if the mouse pointer (core pointer) is moved to the right on
DISPLAY=:0.0, it immediately appears on the left side of DISPLAY=:0.1.

I am not sure how Xorg sets up screens related to each other in the
video RAM when the positional coordinates are used the way you quoted.

2020. 07. 24. 13:24 keltezéssel, Hugh Chang írta:
> Dear Böszörményi Zoltán,
> 
> Thank you for sharing "touchscreen-transform" program and giving a detailed explanation of it.
> 
>  > assumes they are put side by side.
>  > The output is a series of floats that is the TransformationMatrix
> 
> I found that the program is very handy to calculate transformation matrix values
> when the screens are put side by side in x direction and top-aligned in y direction.
> 
> The remaining problem is how to calculate the transformation matrix values
> for multiple screens with one graphic card using ZaphodHeads option
> when the origin of each screen is (0,0) as shown below:
> 
>      [xorg.conf]
>      Section "ServerLayout"
>          Screen 0 "Screen0" 0 0 # DISPLAY=":0.0"
>          Screen 1 "Screen1" 0 0 # DISPLAY=":0.1"
>      EndSection
> 
> I told my customer that the screens should not overlap and have different origins.
> However, my customer is saying that they are independent screens and do not overlap even 
> when the origins are all (0,0).
> How can I transform the input touch positions properly in this environment?
> 
> Best regards,
> Hugh Chang
> ------------------------------------------------------------------------------------------
> *From:* Böszörményi Zoltán [mailto:zboszor at pr.hu]
> *Sent:* Thursday, July 23, 2020, 02:47
> *To:* Hugh Chang; xorg at lists.x.org
> *Subject:* [Question] ZaphodHeads, ServerLayout without position information, and touchscreens
> 
>> Hi,
>>
>> 2020. 07. 17. 9:44 keltezéssel, Hugh Chang írta:
>>> Dear all,
>>>
>>> I'm writing a document to guide how to configure xorg.conf for multiple touchscreens as 
>>> attached.
>>> I think that I've almost finished it but I don't know how to configure xorg.conf
>>> when ServerLayout is described without position information for multi-seat setup with 
>>> one graphic card (zaphod heads).
>>> I could not find a proper solution and I'm asking your advice.
>>> I'll greatly appreciate for any hint from you.
>>
>> for dynamic seats, simply there is no solution.
>>
>> The "xinput map-to-output ..." command would be nice but
>> 1) it needs that Xorg has already started so preset configuration is out of question, and
>> 2) it doesn't survive hotplugging if the touchscreen device is USB based.
>>
>> For fixed configuration, I have solved this a while ago.
>>
>> What you need is xorg.conf template files for sed substitutions and this utility:
>> https://github.com/zboszor/touchscreen-transform , formerly known as
>> https://github.com/SICOM/touchscreen-transform
>>
>> Full disclosure: this utility blatantly copied the xinput 1.6.2 code
>> for computing the values for Option TransformationMatrix.
>>
>> ==========================================================
>> $ ./touchscreen-transform
>> Usage: ./touchscreen-transform [-i index] { -r NxM [-R {normal|left|right|inverted}] ... }
>> -r, --resolution NxM
>>     screen resolution
>> -R, --rotation {normal|left|right|inverted}
>>     screen rotation
>> -i index
>>     For multi-screen setup, the touchscreen is
>>     attached to the (zero based) indexth screen
>> Options -r and -R are positional and can be repeated.
>> ==========================================================
>>
>> The utility takes a series of -r (resolution) and -R (rotation)
>> options and an index for the 0 based array of screens/monitors
>> forming the whole canvas X works on and assumes they are put side by side.
>>
>> The output is a series of floats that is the TransformationMatrix
>> you can use for the touchscreen attached to the ith monitor.
>> See the INPUTDEVICE SECTION in man 5 xorg.conf about Option
>> TransformationMatrix.
>>
>> E.g.:
>>
>> $ ./touchscreen-transform -r 1024x768 -r 1024x768 -i 1
>> 0.50000 0.00000 0.50000 0.00000 1.00000 0.00000 0.00000 0.00000 1.00000
>>
>> For completing the configuration (e.g. binding the input device properly
>> to a given USB slot) is left to you to discover. "man 5 xorg.conf", "man 4 evdev"
>> and "man 4 libinput" should have everything you need.
>>
>> Best regards,
>> Zoltán Böszörményi
>>
>>>
>>> Best regards,
>>> Hugh Chang
>>>
>>> _______________________________________________
>>> xorg at lists.x.org: X.Org support
>>> Archives: http://lists.freedesktop.org/archives/xorg
>>> Info: https://lists.x.org/mailman/listinfo/xorg
>>> Your subscription address: %(user_address)s
>>>
>>



More information about the xorg mailing list