protocol: use transient flags for activate or not surfaces

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
shm: Add request for resizing pools
Introduce libwayland-cursor, a cursor helper library

The purpose of this library is to be the equivalent of libXcursor in
the X world. This library is compatible with X cursor themes and loads
them directly into an shm pool making it easy for the clients to get
buffer for each cursor image.

The code for handling the X cursor theme was taken from libXcursor. The
files cursor/xcursor.[ch] are a stripped down version of that library
containing only the interfaces necessary for implementing the wayland
counterpart.
server: Initialise serial number counter for wl_display

This ends up propagating through and creating a valgrind error like:

==22573== Conditional jump or move depends on uninitialised value(s)
==22573==    at 0x409E57: pointer_attach (compositor.c:1999)
==22573==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==22573==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==22573==    by 0x5674C45: wl_closure_invoke (connection.c:770)
==22573==    by 0x566ECCB: wl_client_connection_data (wayland-server.c:255)
==22573==    by 0x56722F1: wl_event_source_fd_dispatch (event-loop.c:79)
==22573==    by 0x5672C91: wl_event_loop_dispatch (event-loop.c:410)
==22573==    by 0x56705F4: wl_display_run (wayland-server.c:1003)
==22573==    by 0x40C775: main (compositor.c:2937)
shm: Zero busy count for allocated buffers

This avoids a valgrind error like:

==31496== Conditional jump or move depends on uninitialised value(s)
==31496==    at 0x407620: weston_buffer_post_release (compositor.c:928)
==31496==    by 0x406AEB: weston_surface_attach (compositor.c:725)
==31496==    by 0x409EB8: pointer_attach (compositor.c:2009)
==31496==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==31496==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==31496==    by 0x5674C4D: wl_closure_invoke (connection.c:770)
==31496==    by 0x566ECCB: wl_client_connection_data (wayland-server.c:255)
==31496==    by 0x56722F9: wl_event_source_fd_dispatch (event-loop.c:79)
==31496==    by 0x5672C99: wl_event_loop_dispatch (event-loop.c:410)
==31496==    by 0x56705FF: wl_display_run (wayland-server.c:1004)
==31496==    by 0x40C775: main (compositor.c:2937)
==31496==  Uninitialised value was created by a heap allocation
==31496==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==31496==    by 0x5670EA7: shm_pool_create_buffer (wayland-shm.c:113)
==31496==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==31496==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==31496==    by 0x5674C4D: wl_closure_invoke (connection.c:770)
==31496==    by 0x566ECCB: wl_client_connection_data (wayland-server.c:255)
==31496==    by 0x56722F9: wl_event_source_fd_dispatch (event-loop.c:79)
==31496==    by 0x5672C99: wl_event_loop_dispatch (event-loop.c:410)
==31496==    by 0x56705FF: wl_display_run (wayland-server.c:1004)
==31496==    by 0x40C775: main (compositor.c:2937)
cursor: Fix unsigned/signed comparisons
fix typo
Wayland: Add missing extern "C"

Add extern "C" macro definition for C++.
shm: use mremap on pool resize
wayland-cursor: remove enum wl_cursor_type

Defining a list of all cursors a theme, client or toolkit should have
is not the purpose of libwayland-cursor. The cursor type enum existed
for making lookups faster, but this kind of optmization belongs in the
toolkits.
wayland-cursor: load all cursors from a theme on wl_cursor_theme_load
data-device: fix crash when a client dies during a drag with an icon

The commit that split wl_input_device into wl_seat and friends changed
erroneously the drag icon destroy listener, causing it to operate into
an invalid pointer to a wl_seat.
data-device: implement drags with no data source for self-dnd

Properly handle a drag with no data source, i.e., don't crash and send
events only to the client that initiated the drag. This way a client can
do self drag and drop without offering anything to other clients.
cursor: Link libwayland-cursor to libwayland-client

LDADD is only used when linking programs not libraries.

Spotted-by: Pekka Paalanen <ppaalanen@gmail.com>
build: add uninstalled pkg-config files

Required for building apps against wayland libraries that have not been
installed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
tests: update gitignore

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Wayland: logging

The core libwayland libraries should not handle logging, only passing
the error messages to subscribed functions.
An application linked to libwayland-server or libwayland-client
will be able to set own functions (one per library) to handle error
messages.

Change in this series: make the wl_log return int, because
of compatibility with printf. It will return the number of bytes logged.
Wayland: logging: replace printf by wl_log
cursor: Fix warning with objdir != srcdir build

Make sure we find the right include paths.

krh: Edited to use $(top_builddir)

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Always reset keyboard and pointer focus

If wl_pointer_set_focus or wl_keyboard_set_focus have been called before
a listener has been established for that seat and client combination,
the focus window will be set but the focus resource will be NULL.  This
changes these functions to always attempt to search for the relevant
focus resource, allowing the resource to be set by calling
wl_keyboard_set_focus and wl_pointer_set_focus again when a listener has
been established.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>