[gtk/gtk-3-24: 1/2] x11: Honor hotspot during drag cancel animation
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 1/2] x11: Honor hotspot during drag cancel animation
- Date: Wed, 11 Dec 2019 13:00:25 +0000 (UTC)
commit a3cff0add1dec4db3ddc0a3dff8f41ff9e205b63
Author: Robert Mader <robert mader posteo de>
Date: Mon Dec 9 01:16:39 2019 +0100
x11: Honor hotspot during drag cancel animation
Otherwise the icon "jumps" to the cursor position with its top left when
the animation starts.
This is especially visible if the dragged item is big, like when dragging
mails in Thunderbird.
gdk/x11/gdkdnd-x11.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index f335d502ce..e07fa10325 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -2613,8 +2613,10 @@ gdk_drag_anim_timeout (gpointer data)
gdk_window_show (context->drag_window);
gdk_window_move (context->drag_window,
- context->last_x + (context->start_x - context->last_x) * t,
- context->last_y + (context->start_y - context->last_y) * t);
+ (context->last_x - context->hot_x) +
+ (context->start_x - context->last_x) * t,
+ (context->last_y - context->hot_y) +
+ (context->start_y - context->last_y) * t);
gdk_window_set_opacity (context->drag_window, 1.0 - f);
return G_SOURCE_CONTINUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]