pointer: Fix the behavior of the pointer under DND
When grabbing with DND, we need to leave the pointer alone and under the client's control. The code here was a bit messy before about when it unset the window cursor -- it did it whenever there was no current surface after repicking, which is a bit wrong, since it will fire during a drag grab. Move the check for this to update_cursor_surface, which is our standard "sync" API for this, and then call update_cursor_surface after we set the focus.
This commit is contained in:
parent
9203db0655
commit
607730e96c
@ -305,9 +305,6 @@ repick_for_event (MetaWaylandPointer *pointer,
|
|||||||
else
|
else
|
||||||
pointer->current = NULL;
|
pointer->current = NULL;
|
||||||
|
|
||||||
if (pointer->cursor_tracker && pointer->current == NULL)
|
|
||||||
meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
|
|
||||||
|
|
||||||
sync_focus_surface (pointer);
|
sync_focus_surface (pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,6 +539,8 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
meta_wayland_pointer_update_cursor_surface (pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -750,11 +749,13 @@ meta_wayland_pointer_get_relative_coordinates (MetaWaylandPointer *pointer,
|
|||||||
void
|
void
|
||||||
meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
|
meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
|
||||||
{
|
{
|
||||||
MetaCursorReference *cursor;
|
|
||||||
|
|
||||||
if (pointer->cursor_tracker == NULL)
|
if (pointer->cursor_tracker == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (pointer->current)
|
||||||
|
{
|
||||||
|
MetaCursorReference *cursor;
|
||||||
|
|
||||||
if (pointer->cursor_surface && pointer->cursor_surface->buffer)
|
if (pointer->cursor_surface && pointer->cursor_surface->buffer)
|
||||||
{
|
{
|
||||||
struct wl_resource *buffer = pointer->cursor_surface->buffer->resource;
|
struct wl_resource *buffer = pointer->cursor_surface->buffer->resource;
|
||||||
@ -770,6 +771,11 @@ meta_wayland_pointer_update_cursor_surface (MetaWaylandPointer *pointer)
|
|||||||
if (cursor)
|
if (cursor)
|
||||||
meta_cursor_reference_unref (cursor);
|
meta_cursor_reference_unref (cursor);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pointer_set_cursor (struct wl_client *client,
|
pointer_set_cursor (struct wl_client *client,
|
||||||
|
Loading…
Reference in New Issue
Block a user