window: Initialize workspace state before first roundtrip

The workspace state parameters were initialized after the first
roundtrip. If a workspace manager state event was received during this
roundtrip the state parameters were cleared leaving an incorrect state.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
evdev-touchpad: Twiddle finger_state correctly

The original code always set the finger_state to the appropriate bitmask
irrespective of whether the event was a press or a release. It would also blat
all members of the bitmask rather than ORing in the new bit for the event.

Cc:Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
tty: Log error if we cannot setup a valid tty keyboard mode

The previous logging code would never be reached - this change makes sure a
message is reported if changing keyboard mode to either the desired (K_OFF) or
fallback (K_RAW with handler that drops the events) fails.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
evdev: Avoid unintended case drop through

e->code is in the same range for ABS_ and for REL_. As the code currently
stands and for the current values in Linux's input.h there is no risk of a
problem. However just in case it would be wise to break after evaluating the
relative events.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
evdev-touchpad: Iterate over the touchpad spec table correctly

The original code would overrun since the calculation of the range did not
take into consideration the size of the entries in the table.

Cc:Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
backlight: Avoid buffer overflow in the use of readlink

readlink() returns the number of bytes that it has written excluding any NUL
byte (since it does not write that itself.) This could lead to attempting to
access beyond the end of buffer if the destination of the link is exactly 100
bytes long. The standard solution to this is to subtract one from the buffer
when passing it into readlink().

Signed-off-by: Rob Bradford <rob@linux.intel.com>
keyboard: Avoid access beyond end off buffer

If the for loop does not match on a button it will fall through and try and
dereference into the array using the terminating value of the loop. This
terminating value of the loop is the dimension of the array and thus beyond
its bounds.

Cc: Jan Arne Petersen <jpetersen@openismus.com>
Signed-off-by: Rob Bradford <rob@linux.intel.com>
compositor-drm: Avoid leak during output configuration error path

Signed-off-by: Rob Bradford <rob@linux.intel.com>
backlight: Jump to cleanup code if synthesizing backlight string fails

This applies the same pattern as used in other error cases in this block - and
cleans up the file desciptors and allocated memory too.

Signed-off-by: Rob Bradford <rob@linux.intel.com>
shell: restore correct layer in shell_unset_fullscreen

This fixes the bug where surface is above panel_layer
just after it is restored from fullscreen mode.

How to reproduce:
* move surface under panel
* set surface fullscreen
* restore surface to normal mode
clients: Set title for all shell surface demos.
compositor-wayland: Make sure border fields are set before wayland_compositor_create_output and document some function dependencies.
compositor-wayland: Use some nicer border sizes.
toytoolkit: Don't draw shadows for maximized windows.

Add THEME_FRAME_MAXIMIZED flag so the theming system can know not to draw
shadows for maximized windows. This allows maximized surfaces' content to be
sized and placed in a more expectable fashion.
window: Add getters for fullscreen and maximized state

This lets us eliminate a bit of redundancy in the clienst where they track
fullscreen state themselves.
terminal: Use window_get_fullscreen() instead of tracking that state manually
terminal: Don't snap resize if we're maximized

We allow fullscreen to fill the requested size, do the same for maximize.
toytoolkit: Take into account transform when sending output allocation.
Update to new fd and wl_registry APIs

This commit updates the clients and the wayland compositor backend to
use the new wl_registry mechanism and the thread safe fd API.
compositor: make wl_surface.attach double-buffered

This change depends on the Wayland commit
"protocol: double-buffered state for wl_surface".

Clients are now required to issue wl_surface.commit for the
wl_surface.attach to take effect.

While changing this, change the surface argument to
weston_surface_attach() from wl_surface into weston_surface, for
consistency.

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