PLEASE TEST!
Hi guys,
I've pushed Mike's fix to the code. Could you test again, please?
Thanks.
If I disable the IPCServer Timer before calling the FileOpen dialog (and reenable it afterwards), the problem goes away.
Strange. The IPCServer timer is
presumably there to periodically peek at incoming messages from the IDE.
That Timer interval is in milliseconds...
Disabling it would disable listening to messages from the IDE while opening the file.... which would currently cause error messages in the IDE (such as "lhelp is not responding" or something) which is actually fine because it is busy doing something else [1]
... so I did as you proposed (commit 46286; cosmetic changes in earlier commits)
UPDATE: Wierd. The bulk of the code in .ServerMessage is not being called.
procedure THelpForm.ServerMessage(Sender: TObject);
var
UrlReq: TUrlRequest;
FileReq: TFileRequest;
ConReq: TContextRequest;
MiscReq: TMiscRequest;
MustClose: boolean=false;
Stream: TStream;
Res: LongWord;
Url: String='';
begin
if fInputIPC.PeekMessage(5, True) then begin
Stream := fInputIPC.MsgData; // <--- Breakpoint set here never gets called
Stream.Position := 0;
FillByte(FileReq{%H-},SizeOf(FileReq),0);
Stream.Read(FileReq, SizeOf(FileReq));
So it's .PeekMessages that causing the problems? I think I'm approaching my limit of usefullness here :-(
UPDATE2: No, I'm not at the limit of my usefullness. That first parameter to PeekMessage is a TimeOut. Bet it's in seconds, and a 5 second delay in the UI every 200ms is consistent with the responsiveness of the OpenFile dialog. Why it only happens on themes is wierd... (unless Classic Theme blocks the application process queue, but the modern allows it??)
The PeekMessage Timeout is milliseconds according to the help hint displayed on my Windows Lazarus. So that wouldn't be strange.
Additionally, if you're opening a file within lhelp you're presumably not at the same time telling the IDE to start context sensitive help etc so you wouldn't actually expect a message coming from the IDE.... so PeekMessage would just return false (which is why your breakpoint isn't hit).
(Having run lhelp with debugging output enabled, it seems the peekmessage timeout is actually fine, at least on my system - it catches all messages the IDE sends it.)
[1] Perhaps this entire stuff should be moved to another thread.... something I've only run away from in horror up to now...
Thanks a lot!