forked from AuroraMiddleware/gtk
gdkdrag-win32.c: Fix drag surface positioning
Determine the root_x and root_y coordinates of the drag surface by relying on the coordinates of the surface where the drag is being carried out, plus the coordinates that we receive from the drag event, which is in-line with what the X11 backend does. This will prevent the drag surface from being initially drawn at the correct position, but jumping towards the top-left corner of the screen shortly afterwards. The DnD support will still need some more updates to function correctly on Windows, but at least this is a small improvement. Fixes issue #3798.
This commit is contained in:
parent
352898ae9e
commit
e35490ba5b
@ -2345,8 +2345,8 @@ gdk_dnd_handle_motion_event (GdkDrag *drag,
|
||||
state = gdk_event_get_modifier_state (event);
|
||||
gdk_event_get_position (event, &x, &y);
|
||||
|
||||
x_root = x + _gdk_offset_x;
|
||||
y_root = y + _gdk_offset_y;
|
||||
x_root = event->surface->x + x;
|
||||
y_root = event->surface->y + y;
|
||||
|
||||
if (drag_win32->drag_surface)
|
||||
move_drag_surface (drag, x_root, y_root);
|
||||
|
@ -2343,7 +2343,6 @@ gdk_event_translate (MSG *msg,
|
||||
current_root_x = (msg->pt.x + _gdk_offset_x) / impl->surface_scale;
|
||||
current_root_y = (msg->pt.y + _gdk_offset_y) / impl->surface_scale;
|
||||
|
||||
|
||||
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
|
||||
gdk_win32_surface_do_move_resize_drag (window, current_root_x, current_root_y);
|
||||
else if (_gdk_input_ignore_core == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user