compositor-x11: Grab pointer on button press, ungrab on release

This lets us confine the X pointer to the Weston X window, which corresponds
better with the rendered Wayland cursor actually moves.

https://bugs.freedesktop.org/show_bug.cgi?id=53558
window: Make press-drag-release menu selection mode work

The intended behavior is that a quick click (press and then release
within 500ms) just pops up the menu and doesn't select anything.  Then
we can mouse around and and click to select an item.  Alternatively, a
click and hold (ie press and release after 500ms) lets you press right
button, mouse down on the menu item you want and release to select it.
This is how menus work in most toolkits.

The handling in weston is fine, it's there to handle the case where
the button release happens outside any client window, since the client
doesn't get those events.  If such a release happens late or we get a
second release outside the popup window we shut down the popup.

The problem is in toytoolkit, where we need to select the item if we
get a release within 500ms or if we get a second release.  A second
release is the case where the first release came after 500ms and
didn't pop down the menu, and the second release event is from a click
on a menu item.

https://bugs.freedesktop.org/show_bug.cgi?id=52456
compositor: Fix partial repaints

Partial repaints have been broken since the introduction of the atomic
surface updates. The problem was that surface_commit would set the
geometry dirty flag unconditionally, causing transform updates on every
frame which would in turn cause weston_surface_damage_below() to damage
the whole surface area.

This patch changes this so that flag is only set if the pending buffer
has a different size, the location of the surface changed or the opaque
region changed.

Note that changing the opaque region will cause a full repaint of the
affected surface, because of the transform update.

https://bugs.freedesktop.org/show_bug.cgi?id=56538
shell: End popups if we trigger a shell grab

Clicking outside popups closes them except in case of a shell grab
(move, resize or rotate), in which case we move the parent window away
from under the popup.  Instead, just end the popup in those cases.

https://bugs.freedesktop.org/show_bug.cgi?id=55674
toytoolkit: Don't destroy window cairo surface on shm attach.

https://bugs.freedesktop.org/show_bug.cgi?id=52454
image: Set resize handler and center view on resize/fullscreen
image: Add keyhandler to handle keyboard zoom
image: Combine clamp_view() and center_view ()

We need to clamp or center on a per axis basis.  If the window is wider
but the image is taller, we need to center horizontally but
clamp vertically.  We can only do that if by combining the two
functions.
image: Set dragging pointer on button press, not first motion

We want feedback that we're starting to drag when we press the button
not when we later start dragging the image.
window: Only advertise fullscreen menu item if client supports it

If the client doesn't set a fullscreen handler, we can't go fullscreen
and shouldn't advertise that in the window menu.  The menu implementation is
a little simplistic, so we just move the "Fullscreen" entry to the end of
the list and don't count it if we don't want it in the menu.

https://bugs.freedesktop.org/show_bug.cgi?id=47751
https://bugs.freedesktop.org/show_bug.cgi?id=48106
window: Fix use-after-free in menu button handler

Commit d2fbb3870cfaea623a87ba28c9587676bbdc93f7 introduced a use-after-free
error in the case where we destroy the menu.