forked from enlightenment/efl
ecore_x: Only send XdndEnter when we have types
If ecore_x_window_prop_property_get fails, we have no types to drop so don't send XdndEnter. Fixes CID 1039693
This commit is contained in:
parent
31fde249d4
commit
d09ceaf4c1
|
@ -685,33 +685,35 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
Ecore_X_Atom *types;
|
Ecore_X_Atom *types;
|
||||||
|
|
||||||
ecore_x_window_prop_property_get(_source->win,
|
if (ecore_x_window_prop_property_get(_source->win,
|
||||||
ECORE_X_ATOM_XDND_TYPE_LIST,
|
ECORE_X_ATOM_XDND_TYPE_LIST,
|
||||||
XA_ATOM,
|
XA_ATOM,
|
||||||
32,
|
32,
|
||||||
&data,
|
&data,
|
||||||
&num);
|
&num))
|
||||||
types = (Ecore_X_Atom *)data;
|
{
|
||||||
|
types = (Ecore_X_Atom *)data;
|
||||||
|
|
||||||
/* Entered new window, send XdndEnter */
|
/* Entered new window, send XdndEnter */
|
||||||
xev.xclient.window = win;
|
xev.xclient.window = win;
|
||||||
xev.xclient.message_type = ECORE_X_ATOM_XDND_ENTER;
|
xev.xclient.message_type = ECORE_X_ATOM_XDND_ENTER;
|
||||||
xev.xclient.data.l[0] = _source->win;
|
xev.xclient.data.l[0] = _source->win;
|
||||||
xev.xclient.data.l[1] = 0;
|
xev.xclient.data.l[1] = 0;
|
||||||
if (num > 3)
|
if (num > 3)
|
||||||
xev.xclient.data.l[1] |= 0x1UL;
|
xev.xclient.data.l[1] |= 0x1UL;
|
||||||
else
|
else
|
||||||
xev.xclient.data.l[1] &= 0xfffffffeUL;
|
xev.xclient.data.l[1] &= 0xfffffffeUL;
|
||||||
|
|
||||||
xev.xclient.data.l[1] |= ((unsigned long)_source->version) << 24;
|
xev.xclient.data.l[1] |= ((unsigned long)_source->version) << 24;
|
||||||
|
|
||||||
for (i = 2; i < 5; i++)
|
for (i = 2; i < 5; i++)
|
||||||
xev.xclient.data.l[i] = 0;
|
xev.xclient.data.l[i] = 0;
|
||||||
for (i = 0; i < MIN(num, 3); ++i)
|
for (i = 0; i < MIN(num, 3); ++i)
|
||||||
xev.xclient.data.l[i + 2] = types[i];
|
xev.xclient.data.l[i + 2] = types[i];
|
||||||
XFree(data);
|
XFree(data);
|
||||||
XSendEvent(_ecore_x_disp, win, False, 0, &xev);
|
XSendEvent(_ecore_x_disp, win, False, 0, &xev);
|
||||||
if (_ecore_xlib_sync) ecore_x_sync();
|
if (_ecore_xlib_sync) ecore_x_sync();
|
||||||
|
}
|
||||||
_source->await_status = 0;
|
_source->await_status = 0;
|
||||||
_source->will_accept = 0;
|
_source->will_accept = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue