[mutter/wip/dnd-surface2: 11/18] backend: Add "DnD failed" animation plumbing on MetaCursorRenderer
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/dnd-surface2: 11/18] backend: Add "DnD failed" animation plumbing on MetaCursorRenderer
- Date: Tue, 30 Sep 2014 15:36:04 +0000 (UTC)
commit 10c6056ce0f9866450a6da51b6d2dbdc488d7830
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Sep 30 16:55:35 2014 +0200
backend: Add "DnD failed" animation plumbing on MetaCursorRenderer
The MetaCursorRenderer is the object aware of the offsets applying to
the DnD surface, so translate the given coordinates by that.
src/backends/meta-cursor-renderer.c | 17 +++++++++++++++++
src/backends/meta-cursor-renderer.h | 3 +++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c
index 18b5b45..b38083d 100644
--- a/src/backends/meta-cursor-renderer.c
+++ b/src/backends/meta-cursor-renderer.c
@@ -237,6 +237,23 @@ meta_cursor_renderer_set_dnd_surface_position (MetaCursorRenderer *renderer,
emit_update_cursor (renderer, FALSE);
}
+void
+meta_cursor_renderer_dnd_failed (MetaCursorRenderer *renderer,
+ int dest_x,
+ int dest_y)
+{
+ MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
+ MetaBackend *backend = meta_get_backend ();
+ ClutterActor *stage = meta_backend_get_stage (backend);
+
+ g_assert (meta_is_wayland_compositor ());
+
+ if (priv->dnd_layer.texture)
+ meta_stage_dnd_failed (META_STAGE (stage),
+ dest_x + priv->dnd_surface_offset_x,
+ dest_y + priv->dnd_surface_offset_y);
+}
+
MetaCursorReference *
meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer)
{
diff --git a/src/backends/meta-cursor-renderer.h b/src/backends/meta-cursor-renderer.h
index fa45275..c6a5022 100644
--- a/src/backends/meta-cursor-renderer.h
+++ b/src/backends/meta-cursor-renderer.h
@@ -74,4 +74,7 @@ void meta_cursor_renderer_set_dnd_surface (MetaCursorRenderer *renderer,
void meta_cursor_renderer_set_dnd_surface_position (MetaCursorRenderer *renderer,
int x, int y);
+void meta_cursor_renderer_dnd_failed (MetaCursorRenderer *renderer,
+ int dest_x, int dest_y);
+
#endif /* META_CURSOR_RENDERER_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]