diff --git a/virtual_terminal.cpp b/virtual_terminal.cpp index 4067defbbc..ece59a50fa 100644 --- a/virtual_terminal.cpp +++ b/virtual_terminal.cpp @@ -132,6 +132,7 @@ void VirtualTerminal::setup(int vtNr) closeFd(); return; } + m_vtNumber = vtNr; setActive(true); emit kwinApp()->virtualTerminalCreated(); } @@ -198,6 +199,9 @@ void VirtualTerminal::activate(int vt) if (m_vt < 0) { return; } + if (vt == m_vtNumber) { + return; + } ioctl(m_vt, VT_ACTIVATE, vt); setActive(false); } diff --git a/virtual_terminal.h b/virtual_terminal.h index 8b40beeb8f..efeeb91f9f 100644 --- a/virtual_terminal.h +++ b/virtual_terminal.h @@ -51,6 +51,7 @@ private: int m_vt = -1; QSocketNotifier *m_notifier = nullptr; bool m_active = false; + int m_vtNumber = 0; KWIN_SINGLETON(VirtualTerminal) };