FW: xrandr and xwayland

2021-08-03 Thread David Deyo


From: David Deyo
Sent: Monday, August 2, 2021 3:53 PM
To: Pekka Paalanen
Subject: RE: xrandr and xwayland

On Fri, 30 Jul 2021 23:30:38 +0100
Carsten Haitzler  wrote:

> On Fri, 30 Jul 2021 16:28:02 + David Deyo  said:
>
> No - this is up to the compositor itself to do in its own internal ways. Far
> too many abuses have happened over the years with xrandr available to any
> client anywhere. While in theory a wayland compositor could create an 
> extension
> that works like xrandr, it'd be problematic to make it general-access like
> xrandr.

>>>Indeed.

> >
> > Hello  everyone,
> >
> > I need to rotate  my screen 90 degrees and back to normal in xwayland on an
> > iMX8 running gatesgarth distro.

>>>Maybe you could explain your top-level use case for this, and the
>>>general system architecture (which relevant programs are running and
>>>what their responsibilities are)?

Distro:
I am working on a product that our company is creating.  It uses an imx8 som 
from Boundary.  The system is not a normal desktop.
The DISTRO is created by yocto using the gatesgarth branch.  Just recently we 
were notified that Xwayland was working, so I don’t expect we will be removing 
it just yet.


Use case:
We will have a kiosk-looking desktop.  Some of our pages will have the option 
for the end user to enter text from an on-screen keyboard.
Since our display will be so small (68.04mm (2.68") x 120.96mm (4.76")), we 
will have to turn our unit sideways to make the keyboard fit.  We have already 
done this on a smaller screen (1.0).
On our 1.0 product, we used Segger as our graphics library.  Compared to 
Android, and the like, it seems like rotating the screen would be a standard 
capability.

I believe our compositor (Weston) can do it, transform=90, but to use this 
method, it has to be restarted; causing our gui app to crash and lose all 
entered data.
The client probably needs to drive the orientation.   Considering our gui will 
likely be in python3/tkinter, I will need some way create a page and rotate the 
display.

I am somewhat limited by the packages available to me in my distro.

Thanks,

-dwd


>>>Quite likely the solution will start by removing Xwayland from the
>>>equation, and to have the compositor you use to automatically apply
>>>that rotation when needed, but how to achieve that depends on your use
>>>case. Can the compositor do it all on its own, does the client need to
>>>synchronise to the orientation change, does the client need to drive
>>>the orientation change, etc.

>>>Also sounds like this might not be a normal desktop system you are
>>>working on, which means you have more options on how to design this
>>>than on normal desktop systems with arbitrary applications.


>>>Thanks,
>>>pq

> >
> > Does anyone know if xrandr can be coerced/modified to make rotations work?
> > I’m in the middle of xserver, libX11, libxrandr and xrandr source.
> >
> > How would a client communicating to Xwayland as the xserver request a
> > rotation?  Does Xwayland listen to a unix socket and pass commands on to the
> > kernel?
> >
> > (Thanks Hans,)
> >
> > -dwd
> >  
> > David


 David 
Deyo
[cid:image003.png@01D787B6.7E306F20]

Firmware Engineer
TPI- Tire Profiles
O: 214-396-3063
E:   dd...@tireprofiles.com | W:  
www.tireprofiles.com
A: 3010 Story Rd W, Irving, TX 75038


From: Pekka Paalanen
Sent: Monday, August 2, 2021 3:54 AM
To: David Deyo
Cc: Carsten Haitzler; 
wayland-devel@lists.freedesktop.org
Subject: Re: xrandr and xwayland

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.




Re: FW: xrandr and xwayland

2021-08-03 Thread Carsten Haitzler
On Tue, 3 Aug 2021 13:04:11 + David Deyo  said:

> 
> 
> From: David Deyo
> Sent: Monday, August 2, 2021 3:53 PM
> To: Pekka Paalanen
> Subject: RE: xrandr and xwayland
> 
> On Fri, 30 Jul 2021 23:30:38 +0100
> Carsten Haitzler  wrote:
> 
> > On Fri, 30 Jul 2021 16:28:02 + David Deyo  said:
> >
> > No - this is up to the compositor itself to do in its own internal ways. Far
> > too many abuses have happened over the years with xrandr available to any
> > client anywhere. While in theory a wayland compositor could create an
> > extension that works like xrandr, it'd be problematic to make it
> > general-access like xrandr.
> 
> >>>Indeed.
> 
> > >
> > > Hello  everyone,
> > >
> > > I need to rotate  my screen 90 degrees and back to normal in xwayland on
> > > an iMX8 running gatesgarth distro.
> 
> >>>Maybe you could explain your top-level use case for this, and the
> >>>general system architecture (which relevant programs are running and
> >>>what their responsibilities are)?
> 
> Distro:
> I am working on a product that our company is creating.  It uses an imx8 som
> from Boundary.  The system is not a normal desktop. The DISTRO is created by
> yocto using the gatesgarth branch.  Just recently we were notified that
> Xwayland was working, so I don’t expect we will be removing it just yet.
> 
> 
> Use case:
> We will have a kiosk-looking desktop.  Some of our pages will have the option
> for the end user to enter text from an on-screen keyboard. Since our display
> will be so small (68.04mm (2.68") x 120.96mm (4.76")), we will have to turn
> our unit sideways to make the keyboard fit.  We have already done this on a
> smaller screen (1.0). On our 1.0 product, we used Segger as our graphics
> library.  Compared to Android, and the like, it seems like rotating the
> screen would be a standard capability.
> 
> I believe our compositor (Weston) can do it, transform=90, but to use this
> method, it has to be restarted; causing our gui app to crash and lose all
> entered data. The client probably needs to drive the orientation.
> Considering our gui will likely be in python3/tkinter, I will need some way
> create a page and rotate the display.
> 
> I am somewhat limited by the packages available to me in my distro.

The right way here is to modify Weston to do on-the-fly rotation without a
restart. You also will want a custom protocol from client to compositor to
indicate when a client surface wants rotation. This way the compositor can
correctly rotate the client content and any other on-screen content at the time
(e.g. keyboard) when that client surface is the active visible one (as a kiosk
style only one will be active/visible at a time - except for things like
keyboard etc.). When you switch which surface is the active one then the
compositor can re-evaluate how to draw on the screen based on what that client
has requested rotation-wise.

-- 
- Codito, ergo sum - "I code, therefore I am" --
Carsten Haitzler - ras...@rasterman.com



RE: FW: xrandr and xwayland

2021-08-03 Thread David Deyo
From: Carsten Haitzler
Sent: Tuesday, August 3, 2021 8:13 AM
To: David Deyo
Cc: 
wayland-devel@lists.freedesktop.org
Subject: Re: FW: xrandr and xwayland

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On Tue, 3 Aug 2021 13:04:11 + David Deyo  said:

>
>
> From: David Deyo
> Sent: Monday, August 2, 2021 3:53 PM
> To: Pekka Paalanen
> Subject: RE: xrandr and xwayland
>
> On Fri, 30 Jul 2021 23:30:38 +0100
> Carsten Haitzler  wrote:
>
> > On Fri, 30 Jul 2021 16:28:02 + David Deyo  said:
> >
> > No - this is up to the compositor itself to do in its own internal ways. Far
> > too many abuses have happened over the years with xrandr available to any
> > client anywhere. While in theory a wayland compositor could create an
> > extension that works like xrandr, it'd be problematic to make it
> > general-access like xrandr.
>
> >>>Indeed.
>
> > >
> > > Hello  everyone,
> > >
> > > I need to rotate  my screen 90 degrees and back to normal in xwayland on
> > > an iMX8 running gatesgarth distro.
>
> >>>Maybe you could explain your top-level use case for this, and the
> >>>general system architecture (which relevant programs are running and
> >>>what their responsibilities are)?
>
> Distro:
> I am working on a product that our company is creating.  It uses an imx8 som
> from Boundary.  The system is not a normal desktop. The DISTRO is created by
> yocto using the gatesgarth branch.  Just recently we were notified that
> Xwayland was working, so I don’t expect we will be removing it just yet.
>
>
> Use case:
> We will have a kiosk-looking desktop.  Some of our pages will have the option
> for the end user to enter text from an on-screen keyboard. Since our display
> will be so small (68.04mm (2.68") x 120.96mm (4.76")), we will have to turn
> our unit sideways to make the keyboard fit.  We have already done this on a
> smaller screen (1.0). On our 1.0 product, we used Segger as our graphics
> library.  Compared to Android, and the like, it seems like rotating the
> screen would be a standard capability.
>
> I believe our compositor (Weston) can do it, transform=90, but to use this
> method, it has to be restarted; causing our gui app to crash and lose all
> entered data. The client probably needs to drive the orientation.
> Considering our gui will likely be in python3/tkinter, I will need some way
> create a page and rotate the display.
>
> I am somewhat limited by the packages available to me in my distro.

> > > >The right way here is to modify Weston to do on-the-fly rotation without 
> > > >a
> > > >restart. You also will want a custom protocol from client to compositor 
> > > >to
> > > >indicate when a client surface wants rotation. This way the compositor 
> > > >can
> > > >correctly rotate the client content and any other on-screen content at 
> > > >the time
> > > > (e.g. keyboard) when that client surface is the active visible one (as 
> > > > a kiosk
> > > >style only one will be active/visible at a time - except for things like
> > > >keyboard etc.). When you switch which surface is the active one then the
> > > >compositor can re-evaluate how to draw on the screen based on what that 
> > > >client
> > > >has requested rotation-wise.
Thank you,
A custom protocol makes sense.

  1.   What’s the best way to communicate with Weston, socket, message, 
function  call?
  2.  How would Weston actually rotate the display, in particular on the fly?
In the Weston documentation, it states that a super-kbd key and middle mouse 
button should rotate the display (if supported).
I’d like to find where that is, as well.

-dwd
--
- Codito, ergo sum - "I code, therefore I am" --
Carsten Haitzler - ras...@rasterman.com



Re: FW: xrandr and xwayland

2021-08-03 Thread Carsten Haitzler
On Tue, 3 Aug 2021 13:40:25 + David Deyo  said:

> From: Carsten Haitzler
> Sent: Tuesday, August 3, 2021 8:13 AM
> To: David Deyo
> Cc:
> wayland-devel@lists.freedesktop.org
> Subject: Re: FW: xrandr and xwayland
> 
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you recognize the sender and know the
> content is safe.
> 
> 
> On Tue, 3 Aug 2021 13:04:11 + David Deyo  said:
> 
> >
> >
> > From: David Deyo
> > Sent: Monday, August 2, 2021 3:53 PM
> > To: Pekka Paalanen
> > Subject: RE: xrandr and xwayland
> >
> > On Fri, 30 Jul 2021 23:30:38 +0100
> > Carsten Haitzler  wrote:
> >
> > > On Fri, 30 Jul 2021 16:28:02 + David Deyo 
> > > said:
> > >
> > > No - this is up to the compositor itself to do in its own internal ways.
> > > Far too many abuses have happened over the years with xrandr available to
> > > any client anywhere. While in theory a wayland compositor could create an
> > > extension that works like xrandr, it'd be problematic to make it
> > > general-access like xrandr.
> >
> > >>>Indeed.
> >
> > > >
> > > > Hello  everyone,
> > > >
> > > > I need to rotate  my screen 90 degrees and back to normal in xwayland on
> > > > an iMX8 running gatesgarth distro.
> >
> > >>>Maybe you could explain your top-level use case for this, and the
> > >>>general system architecture (which relevant programs are running and
> > >>>what their responsibilities are)?
> >
> > Distro:
> > I am working on a product that our company is creating.  It uses an imx8 som
> > from Boundary.  The system is not a normal desktop. The DISTRO is created by
> > yocto using the gatesgarth branch.  Just recently we were notified that
> > Xwayland was working, so I don’t expect we will be removing it just yet.
> >
> >
> > Use case:
> > We will have a kiosk-looking desktop.  Some of our pages will have the
> > option for the end user to enter text from an on-screen keyboard. Since our
> > display will be so small (68.04mm (2.68") x 120.96mm (4.76")), we will have
> > to turn our unit sideways to make the keyboard fit.  We have already done
> > this on a smaller screen (1.0). On our 1.0 product, we used Segger as our
> > graphics library.  Compared to Android, and the like, it seems like
> > rotating the screen would be a standard capability.
> >
> > I believe our compositor (Weston) can do it, transform=90, but to use this
> > method, it has to be restarted; causing our gui app to crash and lose all
> > entered data. The client probably needs to drive the orientation.
> > Considering our gui will likely be in python3/tkinter, I will need some way
> > create a page and rotate the display.
> >
> > I am somewhat limited by the packages available to me in my distro.
> 
> > > > >The right way here is to modify Weston to do on-the-fly rotation
> > > > >without a restart. You also will want a custom protocol from client to
> > > > >compositor to indicate when a client surface wants rotation. This way
> > > > >the compositor can correctly rotate the client content and any other
> > > > >on-screen content at the time
> > > > > (e.g. keyboard) when that client surface is the active visible one
> > > > > (as a kiosk
> > > > >style only one will be active/visible at a time - except for things
> > > > >like keyboard etc.). When you switch which surface is the active one
> > > > >then the compositor can re-evaluate how to draw on the screen based on
> > > > >what that client has requested rotation-wise.
> Thank you,
> A custom protocol makes sense.
> 
>   1.   What’s the best way to communicate with Weston, socket, message,
> function  call?

Wayland protocol. You can create extensions as XML files and use
wayland-scanner to generate C code to handle that protocol.

>   2.  How would Weston actually rotate the display, in particular on the fly?
> In the Weston documentation, it states that a super-kbd key and middle mouse
> button should rotate the display (if supported). I’d like to find where that
> is, as well.

Any number of ways. It could modify the KMS device properties for that output
to rotate. It could render rotated (in GL transform the triangle coordinates
when rendering) or in software render the pixels rotated as you read and write
them from one place to another (various algorithms can be used here). Weston
already can do these so it's just a matter of gluing together the code with
your protocol and some logic.

> -dwd
> --
> - Codito, ergo sum - "I code, therefore I am" --
> Carsten Haitzler - ras...@rasterman.com
> 


-- 
- Codito, ergo sum - "I code, therefore I am" --
Carsten Haitzler - ras...@rasterman.com



RE: FW: xrandr and xwayland

2021-08-03 Thread David Deyo


From: Carsten Haitzler
Sent: Tuesday, August 3, 2021 9:38 AM
To: David Deyo
Cc: 
wayland-devel@lists.freedesktop.org
Subject: Re: FW: xrandr and xwayland

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On Tue, 3 Aug 2021 13:40:25 + David Deyo  said:

> From: Carsten Haitzler
> Sent: Tuesday, August 3, 2021 8:13 AM
> To: David Deyo
> Cc:
> wayland-devel@lists.freedesktop.org
> Subject: Re: FW: xrandr and xwayland
>
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you recognize the sender and know the
> content is safe.
>
>
> On Tue, 3 Aug 2021 13:04:11 + David Deyo  said:
>
> >
> >
> > From: David Deyo
> > Sent: Monday, August 2, 2021 3:53 PM
> > To: Pekka Paalanen
> > Subject: RE: xrandr and xwayland
> >
> > On Fri, 30 Jul 2021 23:30:38 +0100
> > Carsten Haitzler  wrote:
> >
> > > On Fri, 30 Jul 2021 16:28:02 + David Deyo 
> > > said:
> > >
> > > No - this is up to the compositor itself to do in its own internal ways.
> > > Far too many abuses have happened over the years with xrandr available to
> > > any client anywhere. While in theory a wayland compositor could create an
> > > extension that works like xrandr, it'd be problematic to make it
> > > general-access like xrandr.
> >
> > >>>Indeed.
> >
> > > >
> > > > Hello  everyone,
> > > >
> > > > I need to rotate  my screen 90 degrees and back to normal in xwayland on
> > > > an iMX8 running gatesgarth distro.
> >
> > >>>Maybe you could explain your top-level use case for this, and the
> > >>>general system architecture (which relevant programs are running and
> > >>>what their responsibilities are)?
> >
> > Distro:
> > I am working on a product that our company is creating.  It uses an imx8 som
> > from Boundary.  The system is not a normal desktop. The DISTRO is created by
> > yocto using the gatesgarth branch.  Just recently we were notified that
> > Xwayland was working, so I don’t expect we will be removing it just yet.
> >
> >
> > Use case:
> > We will have a kiosk-looking desktop.  Some of our pages will have the
> > option for the end user to enter text from an on-screen keyboard. Since our
> > display will be so small (68.04mm (2.68") x 120.96mm (4.76")), we will have
> > to turn our unit sideways to make the keyboard fit.  We have already done
> > this on a smaller screen (1.0). On our 1.0 product, we used Segger as our
> > graphics library.  Compared to Android, and the like, it seems like
> > rotating the screen would be a standard capability.
> >
> > I believe our compositor (Weston) can do it, transform=90, but to use this
> > method, it has to be restarted; causing our gui app to crash and lose all
> > entered data. The client probably needs to drive the orientation.
> > Considering our gui will likely be in python3/tkinter, I will need some way
> > create a page and rotate the display.
> >
> > I am somewhat limited by the packages available to me in my distro.
>
> > > > >The right way here is to modify Weston to do on-the-fly rotation
> > > > >without a restart. You also will want a custom protocol from client to
> > > > >compositor to indicate when a client surface wants rotation. This way
> > > > >the compositor can correctly rotate the client content and any other
> > > > >on-screen content at the time
> > > > > (e.g. keyboard) when that client surface is the active visible one
> > > > > (as a kiosk
> > > > >style only one will be active/visible at a time - except for things
> > > > >like keyboard etc.). When you switch which surface is the active one
> > > > >then the compositor can re-evaluate how to draw on the screen based on
> > > > >what that client has requested rotation-wise.
> Thank you,
> A custom protocol makes sense.
>
>   1.   What’s the best way to communicate with Weston, socket, message,
> function  call?

> > > > > >Wayland protocol. You can create extensions as XML files and use
> > > > > >wayland-scanner to generate C code to handle that protocol.
Ok, thanks.

>   2.  How would Weston actually rotate the display, in particular on the fly?
> In the Weston documentation, it states that a super-kbd key and middle mouse
> button should rotate the display (if supported). I’d like to find where that
> is, as well.

> > > > > >Any number of ways. It could modify the KMS device properties for 
> > > > > >that output
> > > > > >to rotate. It could render rotated (in GL transform the triangle 
> > > > > >coordinates
> > > > > >when rendering) or in software render the pixels rotated as you read 
> > > > > >and write
> > > > > >them from one place to another (various

Re: FW: xrandr and xwayland

2021-08-03 Thread Carsten Haitzler
On Tue, 3 Aug 2021 15:00:44 + David Deyo  said:

> 
> 
> From: Carsten Haitzler
> Sent: Tuesday, August 3, 2021 9:38 AM
> To: David Deyo
> Cc:
> wayland-devel@lists.freedesktop.org
> Subject: Re: FW: xrandr and xwayland
> 
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you recognize the sender and know the
> content is safe.
> 
> 
> On Tue, 3 Aug 2021 13:40:25 + David Deyo  said:
> 
> > From: Carsten Haitzler
> > Sent: Tuesday, August 3, 2021 8:13 AM
> > To: David Deyo
> > Cc:
> > wayland-devel@lists.freedesktop.org
> > Subject: Re: FW: xrandr and xwayland
> >
> > CAUTION: This email originated from outside of the organization. Do not
> > click links or open attachments unless you recognize the sender and know the
> > content is safe.
> >
> >
> > On Tue, 3 Aug 2021 13:04:11 + David Deyo  said:
> >
> > >
> > >
> > > From: David Deyo
> > > Sent: Monday, August 2, 2021 3:53 PM
> > > To: Pekka Paalanen
> > > Subject: RE: xrandr and xwayland
> > >
> > > On Fri, 30 Jul 2021 23:30:38 +0100
> > > Carsten Haitzler  wrote:
> > >
> > > > On Fri, 30 Jul 2021 16:28:02 + David Deyo 
> > > > said:
> > > >
> > > > No - this is up to the compositor itself to do in its own internal ways.
> > > > Far too many abuses have happened over the years with xrandr available
> > > > to any client anywhere. While in theory a wayland compositor could
> > > > create an extension that works like xrandr, it'd be problematic to make
> > > > it general-access like xrandr.
> > >
> > > >>>Indeed.
> > >
> > > > >
> > > > > Hello  everyone,
> > > > >
> > > > > I need to rotate  my screen 90 degrees and back to normal in xwayland
> > > > > on an iMX8 running gatesgarth distro.
> > >
> > > >>>Maybe you could explain your top-level use case for this, and the
> > > >>>general system architecture (which relevant programs are running and
> > > >>>what their responsibilities are)?
> > >
> > > Distro:
> > > I am working on a product that our company is creating.  It uses an imx8
> > > som from Boundary.  The system is not a normal desktop. The DISTRO is
> > > created by yocto using the gatesgarth branch.  Just recently we were
> > > notified that Xwayland was working, so I don’t expect we will be removing
> > > it just yet.
> > >
> > >
> > > Use case:
> > > We will have a kiosk-looking desktop.  Some of our pages will have the
> > > option for the end user to enter text from an on-screen keyboard. Since
> > > our display will be so small (68.04mm (2.68") x 120.96mm (4.76")), we
> > > will have to turn our unit sideways to make the keyboard fit.  We have
> > > already done this on a smaller screen (1.0). On our 1.0 product, we used
> > > Segger as our graphics library.  Compared to Android, and the like, it
> > > seems like rotating the screen would be a standard capability.
> > >
> > > I believe our compositor (Weston) can do it, transform=90, but to use this
> > > method, it has to be restarted; causing our gui app to crash and lose all
> > > entered data. The client probably needs to drive the orientation.
> > > Considering our gui will likely be in python3/tkinter, I will need some
> > > way create a page and rotate the display.
> > >
> > > I am somewhat limited by the packages available to me in my distro.
> >
> > > > > >The right way here is to modify Weston to do on-the-fly rotation
> > > > > >without a restart. You also will want a custom protocol from client
> > > > > >to compositor to indicate when a client surface wants rotation. This
> > > > > >way the compositor can correctly rotate the client content and any
> > > > > >other on-screen content at the time
> > > > > > (e.g. keyboard) when that client surface is the active visible one
> > > > > > (as a kiosk
> > > > > >style only one will be active/visible at a time - except for things
> > > > > >like keyboard etc.). When you switch which surface is the active one
> > > > > >then the compositor can re-evaluate how to draw on the screen based
> > > > > >on what that client has requested rotation-wise.
> > Thank you,
> > A custom protocol makes sense.
> >
> >   1.   What’s the best way to communicate with Weston, socket, message,
> > function  call?
> 
> > > > > > >Wayland protocol. You can create extensions as XML files and use
> > > > > > >wayland-scanner to generate C code to handle that protocol.
> Ok, thanks.
> 
> >   2.  How would Weston actually rotate the display, in particular on the
> > fly? In the Weston documentation, it states that a super-kbd key and middle
> > mouse button should rotate the display (if supported). I’d like to find
> > where that is, as well.
> 
> > > > > > >Any number of ways. It could modify the KMS device properties 

RE: FW: xrandr and xwayland

2021-08-03 Thread David Deyo


From: Carsten Haitzler
Sent: Tuesday, August 3, 2021 10:47 AM
To: David Deyo
Cc: 
wayland-devel@lists.freedesktop.org
Subject: Re: FW: xrandr and xwayland

CAUTION: This email originated from outside of the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe.


On Tue, 3 Aug 2021 15:00:44 + David Deyo  said:

>
>
> From: Carsten Haitzler
> Sent: Tuesday, August 3, 2021 9:38 AM
> To: David Deyo
> Cc:
> wayland-devel@lists.freedesktop.org
> Subject: Re: FW: xrandr and xwayland
>
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you recognize the sender and know the
> content is safe.
>
>
> On Tue, 3 Aug 2021 13:40:25 + David Deyo  said:
>
> > From: Carsten Haitzler
> > Sent: Tuesday, August 3, 2021 8:13 AM
> > To: David Deyo
> > Cc:
> > wayland-devel@lists.freedesktop.org
> > Subject: Re: FW: xrandr and xwayland
> >
> > CAUTION: This email originated from outside of the organization. Do not
> > click links or open attachments unless you recognize the sender and know the
> > content is safe.
> >
> >
> > On Tue, 3 Aug 2021 13:04:11 + David Deyo  said:
> >
> > >
> > >
> > > From: David Deyo
> > > Sent: Monday, August 2, 2021 3:53 PM
> > > To: Pekka Paalanen
> > > Subject: RE: xrandr and xwayland
> > >
> > > On Fri, 30 Jul 2021 23:30:38 +0100
> > > Carsten Haitzler  wrote:
> > >
> > > > On Fri, 30 Jul 2021 16:28:02 + David Deyo 
> > > > said:
> > > >
> > > > No - this is up to the compositor itself to do in its own internal ways.
> > > > Far too many abuses have happened over the years with xrandr available
> > > > to any client anywhere. While in theory a wayland compositor could
> > > > create an extension that works like xrandr, it'd be problematic to make
> > > > it general-access like xrandr.
> > >
> > > >>>Indeed.
> > >
> > > > >
> > > > > Hello  everyone,
> > > > >
> > > > > I need to rotate  my screen 90 degrees and back to normal in xwayland
> > > > > on an iMX8 running gatesgarth distro.
> > >
> > > >>>Maybe you could explain your top-level use case for this, and the
> > > >>>general system architecture (which relevant programs are running and
> > > >>>what their responsibilities are)?
> > >
> > > Distro:
> > > I am working on a product that our company is creating.  It uses an imx8
> > > som from Boundary.  The system is not a normal desktop. The DISTRO is
> > > created by yocto using the gatesgarth branch.  Just recently we were
> > > notified that Xwayland was working, so I don’t expect we will be removing
> > > it just yet.
> > >
> > >
> > > Use case:
> > > We will have a kiosk-looking desktop.  Some of our pages will have the
> > > option for the end user to enter text from an on-screen keyboard. Since
> > > our display will be so small (68.04mm (2.68") x 120.96mm (4.76")), we
> > > will have to turn our unit sideways to make the keyboard fit.  We have
> > > already done this on a smaller screen (1.0). On our 1.0 product, we used
> > > Segger as our graphics library.  Compared to Android, and the like, it
> > > seems like rotating the screen would be a standard capability.
> > >
> > > I believe our compositor (Weston) can do it, transform=90, but to use this
> > > method, it has to be restarted; causing our gui app to crash and lose all
> > > entered data. The client probably needs to drive the orientation.
> > > Considering our gui will likely be in python3/tkinter, I will need some
> > > way create a page and rotate the display.
> > >
> > > I am somewhat limited by the packages available to me in my distro.
> >
> > > > > >The right way here is to modify Weston to do on-the-fly rotation
> > > > > >without a restart. You also will want a custom protocol from client
> > > > > >to compositor to indicate when a client surface wants rotation. This
> > > > > >way the compositor can correctly rotate the client content and any
> > > > > >other on-screen content at the time
> > > > > > (e.g. keyboard) when that client surface is the active visible one
> > > > > > (as a kiosk
> > > > > >style only one will be active/visible at a time - except for things
> > > > > >like keyboard etc.). When you switch which surface is the active one
> > > > > >then the compositor can re-evaluate how to draw on the screen based
> > > > > >on what that client has requested rotation-wise.
> > Thank you,
> > A custom protocol makes sense.
> >
> >   1.   What’s the best way to communicate with Weston, socket, message,
> > function  call?
>
> > > > > > >Wayland protocol. You can create extensions as XML files and use
> > 

Re: FW: xrandr and xwayland

2021-08-03 Thread Emmanuel Gil Peyrot
Hi,

On Tue, Aug 03, 2021 at 01:04:11PM +, David Deyo wrote:
[…]
> I believe our compositor (Weston) can do it, transform=90, but to use this 
> method, it has to be restarted; causing our gui app to crash and lose all 
> entered data.
> The client probably needs to drive the orientation.   Considering our gui 
> will likely be in python3/tkinter, I will need some way create a page and 
> rotate the display.

I once implemented such a plugin[1] for Weston, it never got merged
because it had issues I don’t completely remember, but could be a good
starting point.

It relies on the iio subsystem to provide accelerometer data, and then
automatically rotates once it detects the display is sideways.

Hope it’ll help. :)

[1] https://lists.freedesktop.org/archives/wayland-devel/2016-August/030396.html

-- 
Emmanuel Gil Peyrot


signature.asc
Description: PGP signature