| Anonymous | Login | Signup for a new account | 2013-05-25 02:07 CEST | ![]() |
| All Projects | FPC | Lazarus: Packages, Patches | Lazarus CCR | Mantis | fpGUI | fpcprojects: fpprofiler |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
| 0022592 | Lazarus | IDE | public | 2012-08-06 22:41 | 2012-08-20 15:36 | ||||||||
| Reporter | Phil | ||||||||||||
| Assigned To | Martin Friebe | ||||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||||
| Status | resolved | Resolution | fixed | ||||||||||
| Platform | Windows | OS | Windows 7 | OS Version | Windows 7 | ||||||||
| Product Version | 1.0.0RC1 | Product Build | |||||||||||
| Target Version | Fixed in Version | ||||||||||||
| Summary | 0022592: lhelp About box hangs app | ||||||||||||
| Description | Something very odd with the lhelp app's About box - unable to close it until many clicks / long delay. | ||||||||||||
| Tags | No tags attached. | ||||||||||||
| Fixed in Revision | 38285 | ||||||||||||
| LazTarget | 1.0 | ||||||||||||
| Widgetset | Win32/Win64 | ||||||||||||
| Attached Files | |||||||||||||
Notes |
|
|
(0061459) Mattias Gaertner (manager) 2012-08-07 09:35 |
The lhelp about dialog is a Application.MessageBox call, which is under a win32/64 a call of MessageDlg. Does this happen when you start components/chmhelp/lhelp/lhelp.exe directly too? |
|
(0061482) Phil (reporter) 2012-08-07 15:36 |
About box appears to close normally when lhelp is started independent of Lazarus. Note that pressing Esc in About box shuts down lhelp altogether. Surely that's not correct. (Esc does nothing in lhelp launched from Laz help.) |
|
(0061671) Martin Friebe (manager) 2012-08-16 22:57 edited on: 2012-08-16 22:57 |
To reproduce lhelp must be started with --ipcname foo-bar procedure THelpForm.ServerMessage(Sender: TObject); is fired by a timer. This also happens, when the messagebox is shown. However when the messagebox is shown the call to if fInputIPC.PeekMessage(5, True) then begin will hang (or timeout very slow) |
|
(0061750) Mattias Gaertner (manager) 2012-08-20 13:22 |
What does fInputIPC.PeekMessage under MS Windows? |
|
(0061753) Martin Friebe (manager) 2012-08-20 14:02 edited on: 2012-08-20 14:04 |
I tracked it down to packages\fcl-process\src\win\simpleipc.inc line 130 see 2 inline comments: function TWinMsgServerComm.PeekMessage(TimeOut: Integer): Boolean; Var Msg : Tmsg; B : Boolean; R : DWORD; begin Result:=FDataPushed; If Result then Exit; //////************* // Next line returns OK, (immediately) B:=Windows.PeekMessage(Msg, FHWND, 0, 0, PM_NOREMOVE); If not B then // No message yet. Wait for a message to arrive available within specified time. begin if (TimeOut=0) then TimeOut:=Integer(INFINITE); //////************* // Next line hangs, seems related to other msg. // e.g. returns, when clicking taskbar-button R:=MsgWaitForMultipleObjects(1,FHWND,False,TimeOut,QS_SENDMESSAGE); B:=(R<>WAIT_TIMEOUT); end; ------------------------ MsgWaitForMultipleObjects according to msdn can be called with 0 as timeout. Then it will never wait. But I have not tested this. ------------------------ procedure THelpForm.AboutItemClick(Sender: TObject); begin Application.MessageBox('LHelp (CHM file viewer)'0000013 + 'Ver. 2009.06.08'0000013 + 'Copyright (C) Andrew Haines', 'About', 0); end; I do not know what MessageBox does. But windows does start a 2nd thread for that. So maybe its a syncronize issue. I also notige that Application.Crocessmessages (if I am correct) does a PeekMessage(xxx, nil... which means *all* handles, and therefore would include this? But I am not sure.... --------------------------- I can thing of: 1) Not calling this while showing about box 2) Testing B:=Windows.PeekMessage(Msg, FHWND, 0, 0, PM_NOREMOVE); in the app, and if there is no message, then do not call the code (saves 5 msec timeout) (Variables are private, so a lot of work / replace class, copy paste) 3) Not use Application.MessageBox, but show some ModalForm |
|
(0061754) Mattias Gaertner (manager) 2012-08-20 14:16 |
Does it work, when replaced with MessageDlg or QuestionDlg? |
|
(0061757) Martin Friebe (manager) 2012-08-20 15:15 |
Same result for all. The all end up calling "TaskDialogIndirect" Also tried PromptUser |
|
(0061759) Martin Friebe (manager) 2012-08-20 15:36 |
Replaced with custom form, and ShowModal. Please test with 38285 |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-08-06 22:41 | Phil | New Issue | |
| 2012-08-06 22:41 | Phil | Widgetset | => Win32/Win64 |
| 2012-08-07 09:35 | Mattias Gaertner | Note Added: 0061459 | |
| 2012-08-07 15:36 | Phil | Note Added: 0061482 | |
| 2012-08-16 22:57 | Martin Friebe | Note Added: 0061671 | |
| 2012-08-16 22:57 | Martin Friebe | Note Edited: 0061671 | |
| 2012-08-20 13:22 | Mattias Gaertner | Note Added: 0061750 | |
| 2012-08-20 14:02 | Martin Friebe | Note Added: 0061753 | |
| 2012-08-20 14:04 | Martin Friebe | Note Edited: 0061753 | |
| 2012-08-20 14:16 | Mattias Gaertner | Note Added: 0061754 | |
| 2012-08-20 15:15 | Martin Friebe | Note Added: 0061757 | |
| 2012-08-20 15:32 | Martin Friebe | Status | new => assigned |
| 2012-08-20 15:32 | Martin Friebe | Assigned To | => Martin Friebe |
| 2012-08-20 15:36 | Martin Friebe | Fixed in Revision | => 38285 |
| 2012-08-20 15:36 | Martin Friebe | LazTarget | => 1.0 |
| 2012-08-20 15:36 | Martin Friebe | Status | assigned => resolved |
| 2012-08-20 15:36 | Martin Friebe | Resolution | open => fixed |
| 2012-08-20 15:36 | Martin Friebe | Note Added: 0061759 | |
| Main | My View | View Issues | Change Log | Roadmap |



