Skip to content

Commit 12620da

Browse files
committed
updated for version 7.4.164
Problem: Problem with event handling on Windows 8. Solution: Ignore duplicate WINDOW_BUFFER_SIZE_EVENTs. (Nobuhiro Takasaki)
1 parent d743d8d commit 12620da

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/os_win32.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ read_console_input(
253253
static DWORD s_dwIndex = 0;
254254
static DWORD s_dwMax = 0;
255255
DWORD dwEvents;
256+
int head;
257+
int tail;
258+
int i;
256259

257260
if (!win8_or_later)
258261
{
@@ -274,7 +277,29 @@ read_console_input(
274277
*lpEvents = 0;
275278
return TRUE;
276279
}
280+
281+
if (s_dwMax > 1)
282+
{
283+
head = 0;
284+
tail = s_dwMax - 1;
285+
while (head != tail)
286+
{
287+
if (s_irCache[head].EventType == WINDOW_BUFFER_SIZE_EVENT
288+
&& s_irCache[head + 1].EventType
289+
== WINDOW_BUFFER_SIZE_EVENT)
290+
{
291+
/* Remove duplicate event to avoid flicker. */
292+
for (i = head; i < tail; ++i)
293+
s_irCache[i] = s_irCache[i + 1];
294+
--tail;
295+
continue;
296+
}
297+
head++;
298+
}
299+
s_dwMax = tail + 1;
300+
}
277301
}
302+
278303
*lpBuffer = s_irCache[s_dwIndex];
279304
if (nLength != -1 && ++s_dwIndex >= s_dwMax)
280305
s_dwMax = 0;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
164,
741743
/**/
742744
163,
743745
/**/

0 commit comments

Comments
 (0)