[gtk+] dnd-quartz: get hot spot from device offset for surface and use this
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] dnd-quartz: get hot spot from device offset for surface and use this
- Date: Tue, 19 Oct 2010 12:22:49 +0000 (UTC)
commit 046ca498de539463309a2e89f386b67d7e9713cf
Author: Kristian Rietveld <kris gtk org>
Date: Tue Oct 19 13:26:39 2010 +0200
dnd-quartz: get hot spot from device offset for surface and use this
gtk/gtkdnd-quartz.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index bc27d14..687f1aa 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -1691,17 +1691,19 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
{
GdkPixbuf *pixbuf;
GdkRectangle extents;
+ double x_offset, y_offset;
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
g_return_if_fail (context->is_source);
g_return_if_fail (surface != NULL);
_gtk_cairo_surface_extents (surface, &extents);
+ cairo_surface_get_device_offset (surface, &x_offset, &y_offset);
pixbuf = gdk_pixbuf_get_from_surface (surface,
extents.x, extents.y,
extents.width, extents.height);
- gtk_drag_set_icon_pixbuf (context, pixbuf, 0, 0);
+ gtk_drag_set_icon_pixbuf (context, pixbuf, -x_offset, -y_offset);
g_object_unref (pixbuf);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]