Skip to content

Commit

Permalink
Avoid rapid window flashing initialized from console applications.
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximus5 committed Jun 26, 2018
1 parent e971b80 commit d5e341e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/ConEmu/RealServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,15 @@ CESERVER_REQ* CRealServer::cmdFlashWindow(LPVOID pInst, CESERVER_REQ* pIn, UINT

DEBUGSTRCMD(L"GUI recieved CECMD_FLASHWINDOW\n");

gpConEmu->DoFlashWindow(&pIn->Flash, false);
static DWORD nLastCallTick = 0;
const DWORD nMinTickDelta = 1000;

if (!nLastCallTick || (GetTickCount() - nLastCallTick) > nMinTickDelta)
gpConEmu->DoFlashWindow(&pIn->Flash, false);
else
mp_RCon->LogString(L"CECMD_FLASHWINDOW skipped, too rapid call");

nLastCallTick = GetTickCount();

pOut = ExecuteNewCmd(pIn->hdr.nCmd, sizeof(CESERVER_REQ_HDR));

Expand Down

0 comments on commit d5e341e

Please sign in to comment.