mirror of https://github.com/encounter/SDL.git
Fixed bug 2676 - xdnd_version check issue in case ClientMessage
Nitz I added xdnd_version check to XdndPosition case also under DEBUG_XEVENTS macro. by this we can get the action requested by user. I analysed further and found out that removing xdnd_version check at XdndDrop case is a bad idea because in XConvertSelection API timestamp should be passed if(xdnd_version >= 1) otherwise CurrentTime should be passed So xdnd_version check is important at XdndDrop case I made xdnd_version as a static so that it can store the version in other cases also.
This commit is contained in:
parent
7ed41da0b0
commit
767bb36364
|
@ -866,12 +866,19 @@ X11_DispatchEvent(_THIS)
|
||||||
/* Have we been requested to quit (or another client message?) */
|
/* Have we been requested to quit (or another client message?) */
|
||||||
case ClientMessage:{
|
case ClientMessage:{
|
||||||
|
|
||||||
int xdnd_version=0;
|
static int xdnd_version=0;
|
||||||
|
|
||||||
if (xevent.xclient.message_type == videodata->XdndEnter) {
|
if (xevent.xclient.message_type == videodata->XdndEnter) {
|
||||||
|
|
||||||
SDL_bool use_list = xevent.xclient.data.l[1] & 1;
|
SDL_bool use_list = xevent.xclient.data.l[1] & 1;
|
||||||
data->xdnd_source = xevent.xclient.data.l[0];
|
data->xdnd_source = xevent.xclient.data.l[0];
|
||||||
xdnd_version = ( xevent.xclient.data.l[1] >> 24);
|
xdnd_version = ( xevent.xclient.data.l[1] >> 24);
|
||||||
|
#ifdef DEBUG_XEVENTS
|
||||||
|
printf("XID of source window : %ld\n", data->xdnd_source);
|
||||||
|
printf("Protocol version to use : %ld\n", xdnd_version);
|
||||||
|
printf("More then 3 data types : %ld\n", use_list);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (use_list) {
|
if (use_list) {
|
||||||
/* fetch conversion targets */
|
/* fetch conversion targets */
|
||||||
SDL_x11Prop p;
|
SDL_x11Prop p;
|
||||||
|
@ -886,6 +893,15 @@ X11_DispatchEvent(_THIS)
|
||||||
}
|
}
|
||||||
else if (xevent.xclient.message_type == videodata->XdndPosition) {
|
else if (xevent.xclient.message_type == videodata->XdndPosition) {
|
||||||
|
|
||||||
|
#ifdef DEBUG_XEVENTS
|
||||||
|
Atom act= videodata->XdndActionCopy;
|
||||||
|
if(xdnd_version >= 2) {
|
||||||
|
act = xevent.xclient.data.l[4];
|
||||||
|
}
|
||||||
|
printf("Action requested by user is : %s\n", X11_XGetAtomName(display , act));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* reply with status */
|
/* reply with status */
|
||||||
memset(&m, 0, sizeof(XClientMessageEvent));
|
memset(&m, 0, sizeof(XClientMessageEvent));
|
||||||
m.type = ClientMessage;
|
m.type = ClientMessage;
|
||||||
|
|
Loading…
Reference in New Issue