FW: xrandr and xwayland

Carsten Haitzler raster at rasterman.com
Tue Aug 3 15:47:28 UTC 2021


On Tue, 3 Aug 2021 15:00:44 +0000 David Deyo <ddeyo at tireprofiles.com> said:

> 
> 
> From: Carsten Haitzler<mailto:raster at rasterman.com>
> Sent: Tuesday, August 3, 2021 9:38 AM
> To: David Deyo<mailto:ddeyo at tireprofiles.com>
> Cc:
> wayland-devel at lists.freedesktop.org<mailto:wayland-devel at 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 +0000 David Deyo <ddeyo at tireprofiles.com> said:
> 
> > From: Carsten Haitzler<mailto:raster at rasterman.com>
> > Sent: Tuesday, August 3, 2021 8:13 AM
> > To: David Deyo<mailto:ddeyo at tireprofiles.com>
> > Cc:
> > wayland-devel at lists.freedesktop.org<mailto:wayland-devel at 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 +0000 David Deyo <ddeyo at tireprofiles.com> said:
> >
> > >
> > >
> > > From: David Deyo<mailto:ddeyo at tireprofiles.com>
> > > Sent: Monday, August 2, 2021 3:53 PM
> > > To: Pekka Paalanen<mailto:ppaalanen at gmail.com>
> > > Subject: RE: xrandr and xwayland
> > >
> > > On Fri, 30 Jul 2021 23:30:38 +0100
> > > Carsten Haitzler <raster at rasterman.com> wrote:
> > >
> > > > On Fri, 30 Jul 2021 16:28:02 +0000 David Deyo <ddeyo at tireprofiles.com>
> > > > 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 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.
> Excellent, along with rotation, I will also need to keep touch working
> correctly. Does that decide any of the ways over the other?

Again - Weston would deal with this and probably already does. Glue it all in
with the protocol. :)


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
Carsten Haitzler - raster at rasterman.com



More information about the wayland-devel mailing list