diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-06 17:28:28 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-01-06 17:28:28 +0200 |
commit | 88734fba2737470015c76103219cf837dc7b3aa8 (patch) | |
tree | 28fc4eda5bfc750d09d9b2523c16941aa1813571 /src | |
parent | 64f4437b79f2230c558bdd0f50c47705ecd0bf25 (diff) | |
download | fpGUI-88734fba2737470015c76103219cf837dc7b3aa8.tar.xz |
Timers bugfix. Timers did not always work under Windows or Linux.
Windows uses OS messages for the timer, and Linux not. So the
DoMessagePending code had to be tweaked to work for both.
I made a note of this, to see if there is a better way of doing this.
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/fpg_main.pas | 8 | ||||
-rw-r--r-- | src/corelib/x11/fpg_x11.pas | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index 11f0f3dd..88143118 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -1582,11 +1582,11 @@ end; procedure TfpgApplication.ProcessMessages; begin Flush; -// while DoMessagesPending do // this blocked timers and other non-OS code -// begin + while DoMessagesPending do + begin WaitWindowMessage(250); -// Flush; -// end; + Flush; + end; end; procedure TfpgApplication.SetMessageHook(AWidget: TObject; const AMsgCode: integer; AListener: TObject); diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index 8c7350d7..e66f9344 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -1366,6 +1366,7 @@ end; function TfpgX11Application.DoMessagesPending: boolean; begin Result := (XPending(display) > 0); + fpgCheckTimers; end; function GetParentWindow(wh: TfpgWinHandle; var pw, rw: TfpgWinHandle): boolean; |