Xwayland on demand (Re: [PATCH xwayland 3/3] xwayland: Handle the case of windows being realized before redirection)

Carlos Garnacho carlosg at gnome.org
Wed Jan 16 12:46:10 UTC 2019


Hi!,

On Wed, Jan 16, 2019 at 10:54 AM Matthieu Herrb <matthieu at herrb.eu> wrote:
>
> On Wed, Jan 16, 2019 at 10:35:13AM +0200, Pekka Paalanen wrote:
> > On Tue, 15 Jan 2019 23:21:05 +0100
> > Carlos Garnacho <carlosg at gnome.org> wrote:
> >
> > > If Xwayland gets to realize a window meant for composition before the
> > > compositor redirected windows (i.e. redirect mode is not RedirectDrawManual
> > > yet), the window would stay "invisible" as we wouldn't create a
> > > wl_surface/wl_shell_surface for it at any later point.
> > >
> > > This scenario may happen if the wayland compositor raises Xwayland on
> > > demand for a X11 client being started. In this case the first data on
> > > the socket is the client's, the compositor can hardly beat that in
> > > order to redirect subwindows before the client realizes a Window.
> > >
> > > In order to handle this case, allow the late creation of a matching
> > > (shell) surface for the WindowPtr on SetWindowPixmapProc, so it is ensured
> > > to be created after the compositor set up redirection.
> > >
> > > Signed-off-by: Carlos Garnacho <carlosg at gnome.org>
> > > ---
> > >  hw/xwayland/xwayland.c | 37 +++++++++++++++++++++++++++++++++++++
> > >  hw/xwayland/xwayland.h |  1 +
> > >  2 files changed, 38 insertions(+)
> >
> > Hi Carlos,
> >
> > this reminds me of other ordering issues with starting Xwayland on
> > demand: xrdb. I presume the X resources should be merged before any app
> > X11 client is processed, so that they see the user's resources at
> > start-up. AFAIK, that cannot happen if Xwayland is started on-demand.
> > Either it is too late if app start-up triggers it, or then you launch
> > Xwayland at desktop start-up, essentially not doing on-demand anymore.
> > Have you seen people complain about that?
> >
> > Could that be fixed somehow?
> >
> > Pass the X11 app socket to Xwayland later after the XWM init is
> > complete? Stall non-XWM clients inside Xwayland by default until XWM is
> > ready?
>
> Hi,
>
> At least for traditional Xlib/Xt applications, The ~/.Xdefaults file is
> read by applications. It's less efficient than having resouces loaded
> in the X server by xrdb, but you can always link .Xdefaults to
> .Xresources for this kind of situation.
>
> Not sure if Gtk/Qt/whatever use the Xlib functions or if they have
> their own code that would ignore .Xdefaults.

I just checked gtk+, and it seems indeed that XGetDefault is called
along gtk+ initialization, mainly pango and cairo which seem to make
sense. I'm not sure about Qt.

However, those are often not the ones to worry about :), as it's
likely they'll run on wayland backends. Probably more of a concern for
the other apps that won't/can't detach from x11, and maybe harder to
get an homogeneous response there. Still, sounds like a possibility.

Cheers,
  Carlos


More information about the xorg-devel mailing list