session: add vt switching

This commit is contained in:
Vaxry 2024-06-25 13:37:54 +02:00
parent 917d48153a
commit 3e2fe425e4
2 changed files with 6 additions and 2 deletions

View file

@ -21,7 +21,7 @@ namespace Aquamarine {
static Hyprutils::Memory::CSharedPointer<CSessionDevice> openIfKMS(Hyprutils::Memory::CSharedPointer<CSession> session_, const std::string& path_); static Hyprutils::Memory::CSharedPointer<CSessionDevice> openIfKMS(Hyprutils::Memory::CSharedPointer<CSession> session_, const std::string& path_);
bool supportsKMS(); bool supportsKMS();
int fd = -1; int fd = -1;
int deviceID = -1; int deviceID = -1;
@ -67,8 +67,8 @@ namespace Aquamarine {
libseat* libseatHandle = nullptr; libseat* libseatHandle = nullptr;
std::vector<int> pollFDs(); std::vector<int> pollFDs();
void dispatchPendingEventsAsync(); void dispatchPendingEventsAsync();
bool switchVT(uint32_t vt);
struct SAddDrmCardEvent { struct SAddDrmCardEvent {
std::string path; std::string path;

View file

@ -256,3 +256,7 @@ std::vector<int> Aquamarine::CSession::pollFDs() {
return {libseat_get_fd(libseatHandle), udev_monitor_get_fd(udevMonitor)}; return {libseat_get_fd(libseatHandle), udev_monitor_get_fd(udevMonitor)};
} }
bool Aquamarine::CSession::switchVT(uint32_t vt) {
return libseat_switch_session(libseatHandle, vt) == 0;
}