src/Makefile.am: Fix git-version.h for out of tree builds

Use --git-dir instead of --work-tree, see
http://marc.info/?l=git&m=120390208721287&w=2

Signed-off-by: Andre Heider <a.heider@gmail.com>
compositor-drm: Inspect result of gbm_create_device.
compositor: Keep a z-ordered list of planes

This let us clear a plane's opaque region without adding code in the
backend, and will be used in a following commit to change how we track
damage.
gl-renderer: Don't change the region supplied to output repaint

The core uses this region to clear from the primary plane damage the
area that was repainted. If we add the old buffer damage to that, it
may end up clearing more damage from the primary plane than it was
intended.
compositor: Don't rely on surface->clip to cull overlay obscured damage

Before this change, surface->clip would contain the region of this the
surface that is obscured by opaque containing of other surfaces in any
plane. If a surface was obscured only by a surface in another plane and
the renderer was told to draw that region, the rendering would be
clipped because of that.

This patch changes the clip to be plane specific, so that it contains
only the region of the surface obscured by other surfaces in the same
plane. We also calculate a per plane clip, so that we don't tell the
renderer to draw regions of the primary plane that are obscured by
other planes. This damage remains on the primary plane until the its
clip changes so that they are not obscured anymore.
gl-renderer: Use EXT_buffer_age and don't assume double buffering

Now that we have EXT_buffer_age in mesa, we should stop assuming double
buffering and use the buffer age instead.

Note: this will cause system without the extension to repaint the whole
screen every frame.
Fix memory leaks

Fix a couple leaks caught by valgrind.
Eat scroll event if a key binding function is executed because of it.

When an axis (scroll) event results in a key binding function
being executed, eat the scroll event so the underlying window
doesn't receive it.
Thanks to Scott Moreau for helping me solve this.
compositor: remove redundant geometry dirtying

Remove redundant geometry dirtying from surface_commit() to simplify
further changes.

This code was added in commit 5df8ecac5d31467122a9d8bda6241d5957ae6848
"compositor: Fix partial repaints"

as the fix to:
https://bugs.freedesktop.org/show_bug.cgi?id=56538

The issue fixed by that commit was making the geometry dirty on every
attach, which caused full-surface repaints every time. The bug was
probably introduced by the opaque region changes during implementing
wl_surface.commit. The mentioned commit fixes the opaque handling by
comparing the new and old regions.

However, the commit also introduces additional checks that set
geometry.dirty. In the current code base, this should be unnecessary.

If the pending.sx or pending.sy are not zero, or if the surface size
changes, the configure() hook is responsible for applying the new
values, and so also marking the geometry dirty.

The configure() hook is only called, if there has been a new
wl_surface.attach. Nothing else can change these variables, so this
should be enough.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
compositor: introduce weston_surface_geometry_dirty()

Instead of directly setting the dirty flag on weston_surface geometry,
use a function for that.

This allows us to hook into geometry dirtying in a following patch.

Also add comments to weston_surface fields, whose modification causes
transform state to become outdated.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
compositor, shell: surface transform inheritance

Implements surface transform inheritance. A 'parent' pointer is added to
weston_surface::geometry, and is automatically used by
weston_surface_update_transform(). When updating the transform, the
parent transform is updated as needed, too.

shell_map_popup() is converted to use the new
weston_surface_set_transform_parent() function. Now, if we moved the
popup's parent surface while the popup is open, the popup surface will
stick to the parent properly.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
pixman-renderer: don't forget to initialize the debug fields

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=61930
shell: block move, rotate, resize in maximized state

To remain consisten with client side window, which blocks moving and
resizing of window in maximized state, we should do so on the compositor
side as well.

(until there is some unmaximize notification from server, which will
allow window to start drawing shadows and revert itself to toplevel
state)
shell: reset rotation for maximized surface

Surface will preserve its rotation transformation when maximizing, which
will cause inconsistencies (eg. no window shadows drawn)

This patch removes rotation from maximized surface and restore it when
unmaximizing (just like in fullscreen mode)
window: save allocation only for toplevel window

Thanks to that we will not overwrite saved allocation, when going
fullscreen from maximized state
window: restore maximized state from fullscreen mode if necessary

This patch sets back maximized mode, if that was its state before going
fullscreen.
toytoolkit: avoid redrawing a window between maximize and configure

Resolve a bad frame visible when maximizing toytoolkit programs with the the
maximize button in decorations. Windows now use wl_display.sync requests to
wait for a maximize to finish before drawing again, following suggestions from
http://lists.freedesktop.org/archives/wayland-devel/2013-February/007650.html
This fixes an issue where, upon the first call into weston_wm_window_read_properties after the hints->decorations property had changed, the old value for this property was read in weston_wm_window_read_properties
XWayland: When maximized, don't draw window decorations for windows that draw their own

This patch fixes an issue where window decorations were drawn for
fullscreen XWayland applications that draw their own window decorations
(eg. Google Chrome/Chromium)
XWayland: max/unmax: never overwrite saved window size with a maximized or full screen size

In order to handle going to a mazimized state from an already maximized
state, we need to make sure the saved size from when the window was
unmaximized is not overwritten with the size of the window in the
maximized state.