Introducing xwayland and xf86-video-wlshm

Corentin Chary corentin.chary at
Tue Jun 21 06:39:27 PDT 2011


I started working a few weeks ago on Xorg hosted mode (X running as a
wayland client) which was available at .

With krh, we decided to rename it xwayland instead of hosted, mainly
because the goal of hosted was to provide an abstract mechanism to
host an X server inside another graphic system, but that abstraction
was dropped eventually.

The previous "hosted" code needed cooperation from the video driver,
and only xf86-video-intel available in krh's tree provided that. With
xwayland, we still need that, but since I don't have an intel video
card, I also created xf86-video-wlshm which is a "fake" video driver
that work without real hardware. This driver really make things easy
to test, since you don't need any specific hardware, and if it crash
or do something wrong, it will only crash a userspace process, and
your hardware won't burn into flames.

So, what's new in xwayland ?

- rebased on xorg's master
- updated to follow wayland changes
- new input code, using xf86 input drivers
- improved stability, fixed memory corruptions and removed some leaks

How can use it ?

I'll assume that you have a working wayland setup, if not, you can
always follow that:
I'll also assume that I'll your wayland stuff is installed in

$ cd xserver
$ git checkout -b xwayland origin/xwayland
$ CFLAGS="-O0 -ggdb3"
sh --prefix=/home/user/dev/wl/local --disable-dri
--disable-dri2 --disable-config-hal --enable-unix-transport
--enable-tcp-transport --disable-config-udev --disable-config-dbus
--disable-xaa --enable-libdrm --disable-xnest --disable-xvfb
--disable-dmx --disable-xvmc --disable-dga --disable-screensaver
--disable-xdmcp --disable-xdm-auth-1 --disable-glx --disable-xinerama
$ make
$ make install

$ cd xf86-video-wlshm
$ sh --prefix=/home/user/dev/wl/local
$ make
$ make install

$ cd xf86-video-intel
$ git checkout -b xwayland origin/xwayland
$ sh --prefix=/home/user/dev/wl/local
$ make
$ make install

$ mkdir -p /home/user/dev/wl/local/etc/X11
$ cat > /home/user/dev/wl/local/etc/X11/xorg.conf <<EOF
Section "Device"
        Identifier "Device"
        Driver "wlshm" # or intel
$ ./my-wayland-compositor
$ cd /home/uer/dev/wl/
$ ./local/bin/Xorg -wayland -rootless :1

And voila ! now you should be able to run some X client on DISPLAY=:1

Some results, using qwidget-compositor-mid:
- firefox + adobe-flash-plugin:
- dwm + xterm + xeyes:
- chrome + compiz + WolfenQt:

What's left to do ?

update screen geometry
how ? virtualbox have an .. interesting approach to do that.

window geometry
X11::_Screen::MoveWindow()     |  wl_shell_resize()
X11::_Screen::PositionWindow() |  wl_shell_move()
X11::_Screen::ResizeWindow()   |

wl_shell_listener::configure() | X11::ConfigureWindow()

- special path for X11<->X11 ? Does it work now ?
- how can we control X11 clipboard inside an extension ?
- Wayland -> wl_shell_create_selection()

how do will we do that on X11 side ?
For wayland, simpy use wl_shell_create_drag()

input grab
does that work ? don't think so...

What now ?

Feel free to come on #wayland if you want to discuss about it, and
more important, feel free to send patch to implement missing features

Special Thanks to krh, bnf, daniels others for their help !

Corentin Chary

More information about the wayland-devel mailing list