[mutter/wip/dnd-surface2: 7/7] surface: honor wl_surface_commit()s on the DnD surface
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/dnd-surface2: 7/7] surface: honor wl_surface_commit()s on the DnD surface
- Date: Fri, 26 Sep 2014 17:55:09 +0000 (UTC)
commit 01af62f3342256b7f413f2c3c092f2a971841684
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Sep 26 19:50:28 2014 +0200
surface: honor wl_surface_commit()s on the DnD surface
And update the surface when this happens.
src/wayland/meta-wayland-data-device.c | 15 +++++++++++++++
src/wayland/meta-wayland-data-device.h | 4 ++++
src/wayland/meta-wayland-surface.c | 9 +++++++++
3 files changed, 28 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 3be8dfa..83673c0 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -580,3 +580,18 @@ meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_device)
wl_data_device_send_selection (data_device_resource, offer);
}
}
+
+gboolean
+meta_wayland_data_device_is_dnd_surface (MetaWaylandDataDevice *data_device,
+ MetaWaylandSurface *surface)
+{
+ return data_device->current_grab &&
+ data_device->current_grab->drag_surface == surface;
+}
+
+void
+meta_wayland_data_device_update_dnd_surface (MetaWaylandDataDevice *data_device)
+{
+ if (data_device->current_grab)
+ drag_grab_update_dnd_surface (data_device->current_grab);
+}
diff --git a/src/wayland/meta-wayland-data-device.h b/src/wayland/meta-wayland-data-device.h
index 854c1fd..b4b3900 100644
--- a/src/wayland/meta-wayland-data-device.h
+++ b/src/wayland/meta-wayland-data-device.h
@@ -44,4 +44,8 @@ void meta_wayland_data_device_init (MetaWaylandDataDevice *data_device);
void meta_wayland_data_device_set_keyboard_focus (MetaWaylandDataDevice *data_device);
+gboolean meta_wayland_data_device_is_dnd_surface (MetaWaylandDataDevice *data_device,
+ MetaWaylandSurface *surface);
+void meta_wayland_data_device_update_dnd_surface (MetaWaylandDataDevice *data_device);
+
#endif /* META_WAYLAND_DATA_DEVICE_H */
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index cf840e5..01d09a7 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -176,6 +176,13 @@ cursor_surface_commit (MetaWaylandSurface *surface,
}
static void
+dnd_surface_commit (MetaWaylandSurface *surface,
+ MetaWaylandPendingState *pending)
+{
+ meta_wayland_data_device_update_dnd_surface (&surface->compositor->seat->data_device);
+}
+
+static void
calculate_surface_window_geometry (MetaWaylandSurface *surface,
MetaRectangle *total_geometry,
float parent_x,
@@ -445,6 +452,8 @@ commit_pending_state (MetaWaylandSurface *surface,
if (surface == compositor->seat->pointer.cursor_surface)
cursor_surface_commit (surface, pending);
+ else if (meta_wayland_data_device_is_dnd_surface (&compositor->seat->data_device, surface))
+ dnd_surface_commit (surface, pending);
else if (surface->window)
toplevel_surface_commit (surface, pending);
else if (surface->subsurface.resource)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]