xdg_shell: Adding a new shell protocol.

xdg_shell is a protocol aimed to substitute wl_shell in the long term,
but will not be part of the wayland core protocol. It starts as a
non-stable API, aimed to be used as a development place at first, and
once features are defined as required by several desktop shells, we can
finally make it stable.

It provides mainly two new interfaces: xdg_surface and xdg_popup.

The xdg_surface interface implements a desktop-style window, that can be
moved, resized, maximized, etc. It provides a request for creating
child/parent relationship, called xdg_surface.set_transient_for.

The xdg_popup interface implements a desktop-style popup/menu. A
xdg_popup is always transient for another surface, and also has implicit
grab.
shell: Remove SHELL_SURFACE_FULLSCREEN and SHELL_SURFACE_MAXIMIZED.

These surface types don't exist anymore inside weston desktop shell
implementation. They are just exposed as wl_shell surface types, but
internally the implementation is done with surface states.

The previous behavior (setting a surface type unsets another one) still
happens when using wl_shell. This change is mainly done as a refactory
to allow xdg-shell to use the same code.
shell: Remove SHELL_SURFACE_TRANSIENT.
shell: Move shell_surface_set_parent to wl_shell calls.

The parent update on set_maximized and set_fullscreen is a behavior of
wl_shell.

That does not happen on xdg-shell, so it can't be in the set_fullscreen
and set_maximized common code, but rather in the wl_shell_surface
interfaces.
xdg-shell: Implement xdg-shell interface.

The whole xdg-shell interface is implement, except from the "focused_set"
and "focused_unset" events.
xdg-shell: Add surface size to configure.

Also emit configure on unset_maximized and unset_fullscreen.
xdg-shell: xdg_surface_set_output should only affect fullscreen.
xdg-shell: Add key bindings for setting maximized and fullscreen.
logind: delay wakeup until DRM-device is resumed

The logind API was designed to allow any kind of devices and any number of
devices. It has no idea of "main DRM device" or similar. However, the
weston DRM backend was designed with a single DRM device as master.
Therefore, we wake it up unconditionally on session-wakeup. But this may
fail with logind as a session may be awake, but not all devices have been
resumed, yet.

Therefore, we change the weston-logind backend to deal with this case
correctly. Instead of waking up the compositor on session-wakeup, we wait
for the main DRM device to wake up. Once we get the event, we notify the
compositor.

For sleep, we reverse this logic. On *any* of the following events we
tell the compositor to go to sleep:
 - Session gets inactive
 - DRM device gets inactive
 - DRM device is removed
This guarantees, that weston is only active if *both*, the session and the
main DRM device are awake/active.

Note that we could actually rely solely on the DRM-device Pause/Resume
events from logind and drop all the Active-Prop-Changed handling. logind
guarantees proper ordering of both. However, in case we ever change weston
to support multiple GPUs, we need the per-device notification. Thus, keep
the code. This also makes weston more fail-safe in case logind fails to
send the PauseDevice event (for whatever reason..).
data-device: Fix surface configure function type

The commit "Remove the weston_view.geometry.width/height fields" changed
the type of the surface configure callback function, but did not change
the callbacks in data-device.c. This commit fixes the type of the
functions left needed to be changed.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Set the view to NULL when unmapping an X11 window

Fixes a crash caused by accessing a deleted view in weston_wm_window_schedule_repaint. It can be easily reproduced by switching between menus in Firefox.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Check for frame being NULL before setting/unsetting flags

Fixes a crash in Firefox when clicking an "install plugin" popup.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Check if the frame exists before reading its size

This fixes crashes caused by popup windows that don't have override_redirect
(e.g., menus in VLC and KDE apps).

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
tablet-shell: Remove

The tablet-shell is unmaintained and unused.  It is currently
dead-weight and a burden when we make changes to weston.  Let's
drop it for now, we can pull it out of git if we find a need for it later.
Move xwayland up one directory level
desktop-shell: Move to new desktop-shell subdirectory
desktop-shell: Split out exposay immplementation
desktop-shell: Split out input-panel code
gl: fix fallback definition of EGL_DEFAULT_DISPLAY

Compiling fbdev backend on RaspberryPi caused the following warning:

compositor-fbdev.c: In function 'fbdev_compositor_create':
compositor-fbdev.c:929:6: warning: passing argument 2 of
'gl_renderer->create' makes integer from pointer without a cast [enabled
by default]
compositor-fbdev.c:929:6: note: expected 'EGLNativeDisplayType' but
argument is of type 'void *'

Fix the definition of EGL_DEFAULT_DISPLAY to match the definition in
EGL/egl.h (of Mesa).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
rpi: compile in the common udev code

In a recent commit 37d38d932cea8a642e644d091747d0d9c046a00a, "rpi: Use
common udev_input for input device handling", the rpi-backend was made
to use the common udev code.

It just forgot to actually build the common udev code into the
rpi-backend.

Cc: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>