Kernel: Remove static variables from virtual tty
This commit is contained in:
parent
8e0a56b49a
commit
a7bd4acd46
|
@ -94,6 +94,10 @@ namespace Kernel
|
||||||
uint32_t m_column { 0 };
|
uint32_t m_column { 0 };
|
||||||
Cell* m_buffer { nullptr };
|
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;
|
const Palette& m_palette;
|
||||||
|
|
||||||
TerminalDriver::Color m_foreground;
|
TerminalDriver::Color m_foreground;
|
||||||
|
|
|
@ -571,17 +571,14 @@ namespace Kernel
|
||||||
|
|
||||||
void VirtualTTY::update_cursor()
|
void VirtualTTY::update_cursor()
|
||||||
{
|
{
|
||||||
static bool last_shown = !m_cursor_shown;
|
if (m_cursor_shown != m_last_cursor_shown)
|
||||||
if (m_cursor_shown != last_shown)
|
|
||||||
m_terminal_driver->set_cursor_shown(m_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;
|
if (m_last_cursor_column != m_column || m_last_cursor_row != m_row)
|
||||||
static uint32_t last_row = -1;
|
|
||||||
if (last_column != m_column || last_row != m_row)
|
|
||||||
m_terminal_driver->set_cursor_position(m_column, m_row);
|
m_terminal_driver->set_cursor_position(m_column, m_row);
|
||||||
last_column = m_column;
|
m_last_cursor_column = m_column;
|
||||||
last_row = m_row;
|
m_last_cursor_row = m_row;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue