From 3e2fe425e41750bb2b97bf4686b05460d5931cea Mon Sep 17 00:00:00 2001 From: Vaxry Date: Tue, 25 Jun 2024 13:37:54 +0200 Subject: [PATCH] session: add vt switching --- include/aquamarine/backend/Session.hpp | 4 ++-- src/backend/Session.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/aquamarine/backend/Session.hpp b/include/aquamarine/backend/Session.hpp index 9460531..3ced086 100644 --- a/include/aquamarine/backend/Session.hpp +++ b/include/aquamarine/backend/Session.hpp @@ -21,7 +21,7 @@ namespace Aquamarine { static Hyprutils::Memory::CSharedPointer openIfKMS(Hyprutils::Memory::CSharedPointer session_, const std::string& path_); - bool supportsKMS(); + bool supportsKMS(); int fd = -1; int deviceID = -1; @@ -67,8 +67,8 @@ namespace Aquamarine { libseat* libseatHandle = nullptr; std::vector pollFDs(); - void dispatchPendingEventsAsync(); + bool switchVT(uint32_t vt); struct SAddDrmCardEvent { std::string path; diff --git a/src/backend/Session.cpp b/src/backend/Session.cpp index cea677c..7d1c7f7 100644 --- a/src/backend/Session.cpp +++ b/src/backend/Session.cpp @@ -256,3 +256,7 @@ std::vector Aquamarine::CSession::pollFDs() { return {libseat_get_fd(libseatHandle), udev_monitor_get_fd(udevMonitor)}; } + +bool Aquamarine::CSession::switchVT(uint32_t vt) { + return libseat_switch_session(libseatHandle, vt) == 0; +}