Kernel: Remove static variables from virtual tty

This commit is contained in:
Bananymous 2025-05-11 03:22:58 +03:00
parent 8e0a56b49a
commit a7bd4acd46
2 changed files with 9 additions and 8 deletions

View File

@ -94,6 +94,10 @@ namespace Kernel
uint32_t m_column { 0 };
Cell* m_buffer { nullptr };
bool m_last_cursor_shown { false };
uint32_t m_last_cursor_row { static_cast<uint32_t>(-1) };
uint32_t m_last_cursor_column { static_cast<uint32_t>(-1) };
const Palette& m_palette;
TerminalDriver::Color m_foreground;

View File

@ -571,17 +571,14 @@ namespace Kernel
void VirtualTTY::update_cursor()
{
static bool last_shown = !m_cursor_shown;
if (m_cursor_shown != last_shown)
if (m_cursor_shown != m_last_cursor_shown)
m_terminal_driver->set_cursor_shown(m_cursor_shown);
last_shown = m_cursor_shown;
m_last_cursor_shown = m_cursor_shown;
static uint32_t last_column = -1;
static uint32_t last_row = -1;
if (last_column != m_column || last_row != m_row)
if (m_last_cursor_column != m_column || m_last_cursor_row != m_row)
m_terminal_driver->set_cursor_position(m_column, m_row);
last_column = m_column;
last_row = m_row;
m_last_cursor_column = m_column;
m_last_cursor_row = m_row;
}
}