x11: fix endless loop looking up drag contexts

Backported from GTK 3 commit f77b690e26 by Edward Sheldrake.
This commit is contained in:
Daemonratte 2026-10-15 16:12:02 +02:00
commit 3beab3b115

View file

@ -263,12 +263,12 @@ gdk_drag_context_find (GdkDisplay *display,
Window source_xid,
Window dest_xid)
{
GList *tmp_list = contexts;
GList *tmp_list;
GdkDragContext *context;
GdkDragContextPrivateX11 *private;
Window context_dest_xid;
while (tmp_list)
for (tmp_list = contexts; tmp_list; tmp_list = tmp_list->next)
{
context = (GdkDragContext *)tmp_list->data;
private = PRIVATE_DATA (context);
@ -288,8 +288,6 @@ gdk_drag_context_find (GdkDisplay *display,
(GDK_DRAWABLE_XID (context->source_window) == source_xid))) &&
((dest_xid == None) || (context_dest_xid == dest_xid)))
return context;
tmp_list = tmp_list->next;
}
return NULL;