[gtk+/gtk-2-24] quartz: properly handle the given hotspot position
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-24] quartz: properly handle the given hotspot position
- Date: Sun, 22 Apr 2012 15:17:19 +0000 (UTC)
commit 698aba575c506c81dc0f05b1224f94b54a83c5c4
Author: Kristian Rietveld <kris lanedo com>
Date: Sun Apr 22 17:15:06 2012 +0200
quartz: properly handle the given hotspot position
gtk/gtkdnd-quartz.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 44ab020..56fdc44 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -1099,6 +1099,12 @@ gtk_drag_begin_idle (gpointer arg)
/* FIXME: If the event isn't a mouse event, use the global cursor position instead */
point = [info->nsevent locationInWindow];
+ /* Account for the given hotspot position. The y position must be
+ * corrected to the NSWindow coordinate system.
+ */
+ point.x -= info->hot_x;
+ point.y += -(gdk_pixbuf_get_height (info->icon_pixbuf) - info->hot_y);
+
drag_image = _gtk_quartz_create_image_from_pixbuf (info->icon_pixbuf);
if (drag_image == NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]