summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-10-27 13:24:07 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-10-27 13:24:07 +0200
commit7e2566f425bf65e2ff3118fdee90319b549e3504 (patch)
tree4601e85e16fca338453f42e69a8ba71369629cb0 /src/corelib/x11
parent160cb66b4bf47fc26743316b07cfbad96c3ee38d (diff)
downloadfpGUI-7e2566f425bf65e2ff3118fdee90319b549e3504.tar.xz
X11 DND: We never checked if drop was really accepted in HandleDNDDrop
If the Drop occured, but AcceptDrops = False, we must not do any Selections conversions. This is now so. We must still send the XdndFinished message though, so data object can be freed, and to simply comply with XDND protocol. We now correctly set the Accept or Decine status in the XDNDFinished message.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/fpg_x11.pas10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 9d689f4a..b97243f0 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -1177,9 +1177,10 @@ begin
writeln('TfpgX11Application.HandleDNDdrop');
{$ENDIF}
{ TODO: Must XConvertSelection always be called? }
- XConvertSelection(FDisplay, XdndSelection, FDNDDataType, XdndSelection, ATopLevelWindow.FWinHandle, ATimestamp);
+ if FDNDDataType <> None then
+ XConvertSelection(FDisplay, XdndSelection, FDNDDataType, XdndSelection, ATopLevelWindow.FWinHandle, ATimestamp);
- { send message to confirm drop will be accepted in specified rectangle }
+ { send message to signal drop is finished }
FillChar(Msg, SizeOf(Msg), 0);
Msg.xany._type := ClientMessage;
Msg.xany.display := FDisplay;
@@ -1188,7 +1189,10 @@ begin
Msg.xclient.format := 32;
Msg.xclient.data.l[0] := ATopLevelWindow.FWinHandle; // winhandle of target window
- Msg.xclient.data.l[1] := 1; // drop accepted - target can remove the data
+ if FDNDDataType = None then
+ Msg.xclient.data.l[1] := 0 // drop NOT accepted
+ else
+ Msg.xclient.data.l[1] := 1; // drop accepted - target can remove the data
Msg.xclient.data.l[2] := FActionType; // this should be the action we accepted
XSendEvent(FDisplay, FSrcWinHandle, False, NoEventMask, @Msg);