keybinds: fix spammy warning

This commit is contained in:
Vaxry 2024-04-04 01:16:47 +01:00
parent 9cf563065a
commit b7d71bc0e1
2 changed files with 13 additions and 15 deletions

View file

@ -831,19 +831,7 @@ void CKeybindManager::clearKeybinds() {
m_lKeybinds.clear(); m_lKeybinds.clear();
} }
void CKeybindManager::toggleActiveFloating(std::string args) { static void toggleActiveFloatingCore(std::string args, std::optional<bool> floatState) {
return toggleActiveFloatingCore(args, std::nullopt);
}
void CKeybindManager::setActiveFloating(std::string args) {
return toggleActiveFloatingCore(args, true);
}
void CKeybindManager::setActiveTiled(std::string args) {
return toggleActiveFloatingCore(args, false);
}
void toggleActiveFloatingCore(std::string args, std::optional<bool> floatState) {
CWindow* PWINDOW = nullptr; CWindow* PWINDOW = nullptr;
if (args != "active" && args.length() > 1) if (args != "active" && args.length() > 1)
@ -884,6 +872,18 @@ void toggleActiveFloatingCore(std::string args, std::optional<bool> floatState)
} }
} }
void CKeybindManager::toggleActiveFloating(std::string args) {
return toggleActiveFloatingCore(args, std::nullopt);
}
void CKeybindManager::setActiveFloating(std::string args) {
return toggleActiveFloatingCore(args, true);
}
void CKeybindManager::setActiveTiled(std::string args) {
return toggleActiveFloatingCore(args, false);
}
void CKeybindManager::centerWindow(std::string args) { void CKeybindManager::centerWindow(std::string args) {
const auto PWINDOW = g_pCompositor->m_pLastWindow; const auto PWINDOW = g_pCompositor->m_pLastWindow;

View file

@ -181,6 +181,4 @@ class CKeybindManager {
friend class CConfigManager; friend class CConfigManager;
}; };
static void toggleActiveFloatingCore(std::string args, std::optional<bool> floatState);
inline std::unique_ptr<CKeybindManager> g_pKeybindManager; inline std::unique_ptr<CKeybindManager> g_pKeybindManager;