[wayland] Don't break if we try to vt-switch to vt we're on
If we were on e.g. vt 1 and pressed Ctrl+Alt+F1 KWin broke as it disabled rendering for vt switch and vt switched to vt 1, which obviously failed. So let's check whether it's going to switch to the vt we are already on and ignore surch requests.
This commit is contained in:
parent
01d805f193
commit
e98d5d6a15
2 changed files with 5 additions and 0 deletions
|
@ -132,6 +132,7 @@ void VirtualTerminal::setup(int vtNr)
|
||||||
closeFd();
|
closeFd();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
m_vtNumber = vtNr;
|
||||||
setActive(true);
|
setActive(true);
|
||||||
emit kwinApp()->virtualTerminalCreated();
|
emit kwinApp()->virtualTerminalCreated();
|
||||||
}
|
}
|
||||||
|
@ -198,6 +199,9 @@ void VirtualTerminal::activate(int vt)
|
||||||
if (m_vt < 0) {
|
if (m_vt < 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (vt == m_vtNumber) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ioctl(m_vt, VT_ACTIVATE, vt);
|
ioctl(m_vt, VT_ACTIVATE, vt);
|
||||||
setActive(false);
|
setActive(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ private:
|
||||||
int m_vt = -1;
|
int m_vt = -1;
|
||||||
QSocketNotifier *m_notifier = nullptr;
|
QSocketNotifier *m_notifier = nullptr;
|
||||||
bool m_active = false;
|
bool m_active = false;
|
||||||
|
int m_vtNumber = 0;
|
||||||
|
|
||||||
KWIN_SINGLETON(VirtualTerminal)
|
KWIN_SINGLETON(VirtualTerminal)
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue