diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-27 12:57:29 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-27 12:57:29 +0200 |
commit | 6f3e4440aeb30ff648b09d01edf5099f4bb5d052 (patch) | |
tree | 7f7784fa187f487ae6007892055e8fd59502bd07 /src/corelib/x11 | |
parent | 13b80a4a295a7f69d61e2fb8d02d5f457dcebef7 (diff) | |
download | fpGUI-6f3e4440aeb30ff648b09d01edf5099f4bb5d052.tar.xz |
X11 DND: Incorrectly assumed there will always be a 'text/plain' mime-type
If the developer did not set the AMimeChoice in OnDragEnter, then
the incorrect default could have been used. By default it
used to deflaut to 'text/plain' and never actually checked the
mime-type list to see if that exists. :-(
Now the default AMimeChoice is set the the first mime-type in
the mime-type list. This keeps with the methodology that the
mime-type list must be from most specific to least specific mime types.
Diffstat (limited to 'src/corelib/x11')
-rw-r--r-- | src/corelib/x11/fpg_x11.pas | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index 37c2b507..9338fddf 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -1101,6 +1101,7 @@ begin wg2.OnDragLeave(nil); end; fillchar(msgp, sizeof(msgp), 0); + { Notify the widget so it can reset its looks if needed } fpgPostMessage(nil, wg2, FPGM_DROPEXIT, msgp); end; end; @@ -1113,6 +1114,9 @@ begin lMimeList := TStringList.Create; for i := 0 to FDNDTypeList.Count-1 do lMimeList.Add(TDNDSrcType(FDNDTypeList[i]).Name); + { Use the first mime-type as the default option presented. The mime-list + should always be from most specific to least specific. } + lMimeChoice := lMimeList[0]; { TODO: We need to populate the Source parameter. } wg.OnDragEnter(self, nil, lMimeList, lMimeChoice, lDropAction, lAccept); lMimeList.Free; @@ -1133,6 +1137,7 @@ begin end; end; + FDNDDataType := None; for i := 0 to FDNDTypeList.Count-1 do begin { This list must be from most specific to least specific } |