Compile fix for non-XKB builds

fcntl.h and unistd.h are required for non-XKB builds as well.

Change-Id: Ie3be5da919b37361ae2c235a308d4659cb455f80
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Make qtwaylandscanner generate correct interface versions.

Change-Id: I3e74b00c10a11fb60261e883cbcf25aa6d4589c2
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Send expose event when application changes size

When the geometry of a wayland window is changed from the application
itself (with QWindow::setGeometry) there should be an expose event sent,
so that for example the scene graph renderer updates the size of the
rendered view.

Change-Id: If78710a9ff2693596c105ab32d3bdc2e39dbdb02
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Fix the popups handling.

Use wl_shell_surface_set_popup() instead of wl_shell_surface_set_transient(),
since the latter is not supposed to make the surface follow the transient
parent movements.

Needs Weston master or 1.0.6, otherwise freezes will happen.
To have the best experience you should however use recent weston master.
The popups in QtCompositor are badly placed.

Change-Id: I3c86e5d74503514749840681b4e81c58cd73ca70
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Generic Wayland platform theme

In 10652f8dd675aa0d12c11597c165831c8ba0b8b4 we disabled desktop
settings awareness because it caused some problems like the GTK+
style being loaded even though it has X11 dependencies.

Unfortunately this prevents the platform theme plugin from being
loaded even for desktops that currently support Wayland.

So the idea is to wrap the generic platform theme around a Wayland
implementation that prevents platform themes for X11 desktop
environments from being loaded without consequences for desktops
supporting Wayland.

When more desktop environments will support Wayland it's worth
reconsidering how the platform theme plugin is loaded.

Change-Id: I0d683bfe491c9421acdb87a8e8f05d99de1ff21f
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Fix key handling.

Use the keymap sent by the compositor and improve the way the text
and the Qt::Key of the keysym is calculated, making the keypad work.

Change-Id: Icc4667dab0649ce47792c512fbcaa0193e2ffd45
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Add support for non default Wayland EGL implementations

There are some Wayland EGL implementations (i.MX6 Vivante) which support
Wayland EGL but do not use eglBindWaylandDisplayWL() to bind the wl_display
to the EGL display. They also do not contain EGL_WL_bind_wayland_display in
EGL_EXTENSIONS. Add support for a QT_WAYLAND_IGNORE_BIND_DISPLAY environment
variable to support such implementations.

Also improve error messages in WaylandEglIntegration::initializeHardware().

Change-Id: I714af939d0eae14a6879ffb2856978476cbaf26b
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Make test compile with Wayland 1.2

Tests still fail when running like before.

Change-Id: I9c0a5e8068fa7af7abc0018e6e9c4f08aa39533b
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Remove unused QtWayland::Object

Change-Id: I671a22602b1590a8ff5a7055cc2d9c6ca29a691f
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Fix transient and popup windows with the parent without a shell surface

Transient and popup surfaces may have the parent without a wl_shell_surface,
if the parent has the Qt::BypassWindowManagerHint flag set (like for
surfaces used for special purposes by a shell), so make them work anyway.

Change-Id: I20592a95b0a508a19506c9ea21ec44f9df5be9fb
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Do not create unused code with qtwaylandscanner

We do not use foreign wl_resource handles in the server code anymore.
Remove support for it from the generated code in qtwaylandscanner.

Change-Id: Id45235ceb4282db02858749c0bef04278be7322d
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
Quit when the wayland socket is closed.

wayland-client sets errno to EPIPE when the wayland connection is
closed (int read_events(wl_display*) in wayland-client.c).

Change-Id: Ifc984edf2fa018460f783a3af39c02ff08164860
Reviewed-by: Andy Nichols <andy.nichols@digia.com>