|
@@ -1974,41 +1974,41 @@ static void dataDeviceHandleEnter(void* userData,
|
|
_glfw.wl.dragFocus = NULL;
|
|
_glfw.wl.dragFocus = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
- for (unsigned int i = 0; i < _glfw.wl.offerCount; i++)
|
|
|
|
|
|
+ unsigned int i;
|
|
|
|
+
|
|
|
|
+ for (i = 0; i < _glfw.wl.offerCount; i++)
|
|
{
|
|
{
|
|
if (_glfw.wl.offers[i].offer == offer)
|
|
if (_glfw.wl.offers[i].offer == offer)
|
|
- {
|
|
|
|
- _GLFWwindow* window = NULL;
|
|
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
|
|
- if (surface)
|
|
|
|
- {
|
|
|
|
- if (wl_proxy_get_tag((struct wl_proxy*) surface) == &_glfw.wl.tag)
|
|
|
|
- window = wl_surface_get_user_data(surface);
|
|
|
|
- }
|
|
|
|
|
|
+ if (i == _glfw.wl.offerCount)
|
|
|
|
+ return;
|
|
|
|
|
|
- if (window && surface == window->wl.surface && _glfw.wl.offers[i].text_uri_list)
|
|
|
|
|
|
+ if (surface && wl_proxy_get_tag((struct wl_proxy*) surface) == &_glfw.wl.tag)
|
|
|
|
+ {
|
|
|
|
+ _GLFWwindow* window = wl_surface_get_user_data(surface);
|
|
|
|
+ if (window->wl.surface == surface)
|
|
|
|
+ {
|
|
|
|
+ if (_glfw.wl.offers[i].text_uri_list)
|
|
{
|
|
{
|
|
_glfw.wl.dragOffer = offer;
|
|
_glfw.wl.dragOffer = offer;
|
|
_glfw.wl.dragFocus = window;
|
|
_glfw.wl.dragFocus = window;
|
|
_glfw.wl.dragSerial = serial;
|
|
_glfw.wl.dragSerial = serial;
|
|
- }
|
|
|
|
|
|
|
|
- _glfw.wl.offers[i] = _glfw.wl.offers[_glfw.wl.offerCount - 1];
|
|
|
|
- _glfw.wl.offerCount--;
|
|
|
|
- break;
|
|
|
|
|
|
+ wl_data_offer_accept(offer, serial, "text/uri-list");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (wl_proxy_get_tag((struct wl_proxy*) surface) != &_glfw.wl.tag)
|
|
|
|
- return;
|
|
|
|
-
|
|
|
|
- if (_glfw.wl.dragOffer)
|
|
|
|
- wl_data_offer_accept(offer, serial, "text/uri-list");
|
|
|
|
- else
|
|
|
|
|
|
+ if (!_glfw.wl.dragOffer)
|
|
{
|
|
{
|
|
wl_data_offer_accept(offer, serial, NULL);
|
|
wl_data_offer_accept(offer, serial, NULL);
|
|
wl_data_offer_destroy(offer);
|
|
wl_data_offer_destroy(offer);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ _glfw.wl.offers[i] = _glfw.wl.offers[_glfw.wl.offerCount - 1];
|
|
|
|
+ _glfw.wl.offerCount--;
|
|
}
|
|
}
|
|
|
|
|
|
static void dataDeviceHandleLeave(void* userData,
|
|
static void dataDeviceHandleLeave(void* userData,
|