mutter:wip/dnd-actions

Last commit made on 2015-09-28
Get this branch:
git clone -b wip/dnd-actions https://git.launchpad.net/mutter

Branch merges

Branch information

Name:
wip/dnd-actions
Repository:
lp:mutter

Recent commits

319d0bb... by Carlos Garnacho

wayland: Implement DnD actions as per wl_data_device v3 changes

We now additionally send:
  - wl_data_offer.source_actions
  - wl_data_source.action
  - wl_data_offer.action
  - wl_data_source.drop_performed
  - wl_data_source.drag_finished

The protocol changes allow for compositors to implement different policies
when chosing the action, mutter uses this to reimplement the same behavior
that GTK+ traditionally had:

  - Alt/Control/Shift modifiers change the chosen action to
    ask/copy/move respectively
  - Drags with middle button start out as "ask" by default

As mutter now also grabs the keyboard and unsets the window focus for these
purposes, the window focus is restored after the drag operation has
finished.

ce78db3... by Carlos Garnacho

wayland: Add MetaWaylandKeyboardGrab and keyboard grab API

This will be useful during DnD, where mutter is expected to consume
keyboard events for either allowing changes in the selected DnD action,
or misc a11y features like keyboard-driven DnD.

Currently, the vtable contains 2 functions, key() will be used on every
key event we get from Clutter, modifiers() will notify of changes in the
keyboard modifiers (mouse buttons will never be set in the modifier mask)

15513ad... by Carlos Garnacho

wayland: Add "update" vfunc to MetaWaylandDragDestFuncs

This will be useful when an update is due but no motion event is to be
sent/received (eg. modifier changes during DnD).

832c710... by Carlos Garnacho

wayland: Avoid resending new data offers on intra-client focus changes

Each keyboard focus change ends up calling the MetaWaylandDataDevice
counterpart, we don't need though to notify the current selection
again. In order to fix this, keep track of the current client, and
only emit the relevant signals when the focus switches to another
client.

The situations where wl_data_device.selection were emitted during
focus changes between surfaces of the same client was inocuous most
of the times, although it's prone to inducing confusing behavior
on context menu clipboard actions, as the closing menu triggers a
focus change, which triggers a whole new wl_data_offer being created
and given on wl_data_device.selection, at a time where there's already
ongoing requests on the previous data offer.

https://bugzilla.gnome.org/show_bug.cgi?id=754357

682c137... by Carlos Garnacho

xwayland: Protect against crash on x11->wayland transfer cancellation

If the transfer is cancelled, the X11SelectionData will be cleared from
the MetaSelectionBridge, although x11_data_write_cb() was invariably
expecting it to be non-NULL.

If the write was cancelled, all the actions done in x11_data_write_cb()
are moot, so just return early. If there's other errors happening
(eg. "connection closed" if the target client happens to crash), we
should still attempt at clearing the data anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=754357

6f64d6b... by Carlos Garnacho

wayland: Check the drag focus before processing XDND dest-side messages

If the drag dest surface suddenly disappears, we may find ourselves
processing an XdndPosition message that was sent before the X11 drag
source had an opportunity to find out.

In that case mutter does know, so double check before processing the
messages.

ebeca98... by Carlos Garnacho

wayland: Improve transformation of the UTF8_STRING atom to mimetype

We try to translate the atom with its corresponding mimetype both back
and forth, which actually breaks if the X11 client chose to announce the
mimetype atom. To do the translation properly, keep track on whether the
source announced the UTF8_STRING atom, and reply back with this only if
that happened.

cf88675... by Carlos Garnacho

wayland: Fix weak ref tracking on data sources

We may get a NULL one here, and we're wrongly attempting to remove
the old weak ref from the new data source object.

405f1ce... by Carlos Garnacho

wayland: Avoid use of struct data after destruction

data_device_end_drag_grab() will destroy the MetaWaylandDragGrab struct,
so we definitely must not use it after destruction.

6190ae3... by Colin Walters

window: Remove invalid (transfer) annnotations

This tripped a new g-i warning; see
https://bugzilla.gnome.org/show_bug.cgi?id=752047