summaryrefslogtreecommitdiff
path: root/src/corelib/x11
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-09-15 00:07:15 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-09-23 16:24:41 +0200
commit65ecd294231994dbb3633d0a058ce03cf58ad2bd (patch)
treede521316a3f46acb8f1150789ffe1135f8ff3050 /src/corelib/x11
parent47c31a5fbc871309e925f8351238d988e9d14f74 (diff)
downloadfpGUI-65ecd294231994dbb3633d0a058ce03cf58ad2bd.tar.xz
Adds OnDragExit event to TfpgWidget.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r--src/corelib/x11/fpg_x11.pas25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas
index 0b8a5495..dbae54ef 100644
--- a/src/corelib/x11/fpg_x11.pas
+++ b/src/corelib/x11/fpg_x11.pas
@@ -887,10 +887,21 @@ end;
procedure TfpgX11Application.HandleDNDleave(ATopLevelWindow: TfpgX11Window;
const ASource: TWindow);
+var
+ wg: TfpgWidget;
begin
{$IFDEF DNDDEBUG}
writeln('XdndLeave event received!');
{$ENDIF}
+ if FLastDropTarget <> 0 then { 0 would be first time in, so there is no last window }
+ begin
+ wg := FindWindowByHandle(FLastDropTarget) as TfpgWidget;
+ if wg.AcceptDrops then
+ begin
+ if Assigned(wg.OnDragLeave) then
+ wg.OnDragLeave(nil);
+ end;
+ end;
ResetDNDVariables;
end;
@@ -905,6 +916,7 @@ var
lTargetWinHandle: TWindow;
w: TfpgX11Window;
wg: TfpgWidget;
+ wg2: TfpgWidget;
msgp: TfpgMessageParams;
lDragEnterEvent: TfpgDragEnterEvent;
lDropAction: TfpgDropAction;
@@ -952,8 +964,17 @@ begin
wg := TfpgWidget(w);
if FLastDropTarget <> lTargetWinHandle then
begin
- fillchar(msgp, sizeof(msgp), 0);
- fpgPostMessage(nil, FindWindowByHandle(FLastDropTarget), FPGM_DROPEXIT, msgp);
+ if FLastDropTarget <> 0 then { 0 would be first time in, so there is no last window }
+ begin
+ wg2 := FindWindowByHandle(FLastDropTarget) as TfpgWidget;
+ if wg2.AcceptDrops then
+ begin
+ if Assigned(wg2.OnDragLeave) then
+ wg2.OnDragLeave(nil);
+ end;
+ fillchar(msgp, sizeof(msgp), 0);
+ fpgPostMessage(nil, wg2, FPGM_DROPEXIT, msgp);
+ end;
end;
FLastDropTarget := lTargetWinHandle;
if wg.AcceptDrops then