diff options
author | nyamatongwe <unknown> | 2003-11-08 00:28:06 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2003-11-08 00:28:06 +0000 |
commit | 971b4bbfb18fdff3d28245895857fe8d83a42484 (patch) | |
tree | fd98d131ed0a093d99200ecc533c96b12132016d /win32 | |
parent | e751a5dc21c0e46a3a4ff0e91a741429180b6b1f (diff) | |
download | scintilla-mirror-971b4bbfb18fdff3d28245895857fe8d83a42484.tar.gz |
Using posted message to continue wrapping while allowing other messages
to be processed.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/ScintillaWin.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 7f52560d5..81b8e0592 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -76,6 +76,8 @@ #define MK_ALT 32 #endif +#define SC_WIN_IDLE 5001 + // Functions imported from PlatWin extern bool IsNT(); extern void Platform_Initialise(void *hInstance); @@ -584,13 +586,36 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam if (wParam == standardTimerID && timer.ticking) { Tick(); } else if (wParam == idleTimerID && idler.state) { - if (!Idle()) - SetIdle(false); + SendMessage(MainHWND(), SC_WIN_IDLE, 0, 1); } else { return 1; } break; + case SC_WIN_IDLE: + // wParam=dwTickCountInitial, or 0 to initialize. lParam=bSkipUserInputTest + if (idler.state) { + if (lParam || (WAIT_TIMEOUT==MsgWaitForMultipleObjects(0,0,0,0, QS_INPUT|QS_HOTKEY))) { + if (Idle()) { + // User input was given priority above, but all events do get a turn. Other + // messages, notifications, etc. will get interleaved with the idle messages. + + // However, some things like WM_PAINT are a lower priority, and will not fire + // when there's a message posted. So, several times a second, we stop and let + // the low priority events have a turn (after which the timer will fire again). + + DWORD dwCurrent = GetTickCount(); + DWORD dwStart = wParam ? wParam : dwCurrent; + + if (dwCurrent >= dwStart && dwCurrent > 200 && dwCurrent - 200 < dwStart) + PostMessage(MainHWND(), SC_WIN_IDLE, dwStart, 0); + } else { + SetIdle(false); + } + } + } + break; + case WM_GETMINMAXINFO: return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam); |