-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TTY|F: fix clipboard access dialog missing repaints (fix #2634)
- Loading branch information
Showing
1 changed file
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,6 +168,7 @@ [email protected] | |
|
||
#include <mutex> | ||
#include <atomic> | ||
#include <optional> | ||
#include <map> | ||
#include "vtansi.h" | ||
#include "AnsiEsc.hpp" | ||
|
@@ -1312,6 +1313,7 @@ struct VTAnsiContext | |
} | ||
|
||
} else { | ||
_crds.reset(); // prevent clipboard dialog miss repaints | ||
vt_shell->OnApplicationProtocolCommand(os_cmd_arg.c_str()); | ||
} | ||
} | ||
|
@@ -1416,13 +1418,17 @@ struct VTAnsiContext | |
// the last arguments are processed (no es_argv[] overflow). | ||
//----------------------------------------------------------------------------- | ||
|
||
std::optional<ConsoleRepaintsDeferScope> _crds; | ||
|
||
void ParseAndPrintString( | ||
LPCVOID lpBuffer, | ||
DWORD nNumberOfBytesToWrite) | ||
{ | ||
DWORD i; | ||
LPCWSTR s; | ||
|
||
_crds.emplace(vt_shell->ConsoleHandle()); | ||
|
||
for (i = nNumberOfBytesToWrite, s = (LPCWSTR)lpBuffer; i > 0; i--, s++) { | ||
if (state == 1) { | ||
if (*s == ESC) { | ||
|
@@ -1581,6 +1587,7 @@ struct VTAnsiContext | |
} | ||
} | ||
FlushBuffer(); | ||
_crds.reset(); | ||
ASSERT(i == 0); | ||
} | ||
|
||
|
@@ -1723,7 +1730,6 @@ void VTAnsi::Write(const char *str, size_t len) | |
--len; | ||
} | ||
|
||
ConsoleRepaintsDeferScope crds(_ctx->vt_shell->ConsoleHandle()); | ||
_ctx->ParseAndPrintString(_ws.c_str(), _ws.size()); | ||
} | ||
|
||
|