summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2023-09-06 12:51:36 +0200
committerGitHub <noreply@github.com>2023-09-06 12:51:36 +0200
commit61a71c65ace5124cb26a074715280537e6e34d00 (patch)
treeb54cf4d7a0f8477b2958619384982d31663f128f /src/managers
parentc3a83daa1e61285a418c39a1d9f29427c2c9a2c3 (diff)
internal: Formatter rework (#3186)
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/EventManager.cpp10
-rw-r--r--src/managers/HookSystemManager.cpp4
-rw-r--r--src/managers/KeybindManager.cpp46
-rw-r--r--src/managers/LayoutManager.cpp4
-rw-r--r--src/managers/SessionLockManager.cpp6
-rw-r--r--src/managers/XWaylandManager.cpp6
-rw-r--r--src/managers/input/IdleInhibitor.cpp2
-rw-r--r--src/managers/input/InputManager.cpp38
-rw-r--r--src/managers/input/Swipe.cpp2
-rw-r--r--src/managers/input/Tablets.cpp2
10 files changed, 60 insertions, 60 deletions
diff --git a/src/managers/EventManager.cpp b/src/managers/EventManager.cpp
index 054c8d38..2e723c44 100644
--- a/src/managers/EventManager.cpp
+++ b/src/managers/EventManager.cpp
@@ -42,7 +42,7 @@ int fdHandleWrite(int fd, uint32_t mask, void* data) {
int availableBytes;
if (ioctl(fd, FIONREAD, &availableBytes) == -1) {
- Debug::log(ERR, "fd %d sent invalid data (1)", fd);
+ Debug::log(ERR, "fd {} sent invalid data (1)", fd);
removeFD(fd);
return 0;
}
@@ -50,7 +50,7 @@ int fdHandleWrite(int fd, uint32_t mask, void* data) {
char buf[availableBytes];
const auto RECEIVED = recv(fd, buf, availableBytes, 0);
if (RECEIVED == -1) {
- Debug::log(ERR, "fd %d sent invalid data (2)", fd);
+ Debug::log(ERR, "fd {} sent invalid data (2)", fd);
removeFD(fd);
return 0;
}
@@ -79,7 +79,7 @@ void CEventManager::startThread() {
sockaddr_in clientAddress;
socklen_t clientSize = sizeof(clientAddress);
- Debug::log(LOG, "Hypr socket 2 started at %s", socketPath.c_str());
+ Debug::log(LOG, "Hypr socket 2 started at {}", socketPath.c_str());
while (1) {
const auto ACCEPTEDCONNECTION = accept4(SOCKET, (sockaddr*)&clientAddress, &clientSize, SOCK_CLOEXEC);
@@ -90,7 +90,7 @@ void CEventManager::startThread() {
int flagsNew = fcntl(ACCEPTEDCONNECTION, F_GETFL, 0);
fcntl(ACCEPTEDCONNECTION, F_SETFL, flagsNew | O_NONBLOCK);
- Debug::log(LOG, "Socket 2 accepted a new client at FD %d", ACCEPTEDCONNECTION);
+ Debug::log(LOG, "Socket 2 accepted a new client at FD {}", ACCEPTEDCONNECTION);
// add to event loop so we can close it when we need to
m_dAcceptedSocketFDs.push_back(
@@ -124,7 +124,7 @@ void CEventManager::flushEvents() {
void CEventManager::postEvent(const SHyprIPCEvent event) {
if (g_pCompositor->m_bIsShuttingDown) {
- Debug::log(WARN, "Suppressed (ignoreevents true / shutting down) event of type %s, content: %s", event.event.c_str(), event.data.c_str());
+ Debug::log(WARN, "Suppressed (ignoreevents true / shutting down) event of type {}, content: {}", event.event.c_str(), event.data.c_str());
return;
}
diff --git a/src/managers/HookSystemManager.cpp b/src/managers/HookSystemManager.cpp
index c5e4cdd8..4b6d9461 100644
--- a/src/managers/HookSystemManager.cpp
+++ b/src/managers/HookSystemManager.cpp
@@ -57,7 +57,7 @@ void CHookSystemManager::emit(const std::vector<SCallbackFNPtr>* callbacks, std:
} catch (std::exception& e) {
// TODO: this works only once...?
faultyHandles.push_back(cb.handle);
- Debug::log(ERR, " [hookSystem] Hook from plugin %lx caused a SIGSEGV, queueing for unloading.", cb.handle);
+ Debug::log(ERR, " [hookSystem] Hook from plugin {:x} caused a SIGSEGV, queueing for unloading.", (uintptr_t)cb.handle);
}
}
@@ -73,7 +73,7 @@ std::vector<SCallbackFNPtr>* CHookSystemManager::getVecForEvent(const std::strin
if (IT != m_lpRegisteredHooks.end())
return &IT->second;
- Debug::log(LOG, " [hookSystem] New hook event registered: %s", event.c_str());
+ Debug::log(LOG, " [hookSystem] New hook event registered: {}", event.c_str());
return &m_lpRegisteredHooks.emplace_back(std::make_pair<>(event, std::vector<SCallbackFNPtr>{})).second;
} \ No newline at end of file
diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp
index 0fb9d838..d9371718 100644
--- a/src/managers/KeybindManager.cpp
+++ b/src/managers/KeybindManager.cpp
@@ -153,7 +153,7 @@ void CKeybindManager::updateXKBTranslationState() {
", layout: " + LAYOUT + " )",
CColor(1.0, 50.0 / 255.0, 50.0 / 255.0, 1.0));
- Debug::log(ERR, "[XKBTranslationState] Keyboard layout %s with variant %s (rules: %s, model: %s, options: %s) couldn't have been loaded.", rules.layout, rules.variant,
+ Debug::log(ERR, "[XKBTranslationState] Keyboard layout {} with variant {} (rules: {}, model: {}, options: {}) couldn't have been loaded.", rules.layout, rules.variant,
rules.rules, rules.model, rules.options);
memset(&rules, 0, sizeof(rules));
@@ -428,10 +428,10 @@ bool CKeybindManager::handleKeybinds(const uint32_t& modmask, const std::string&
// Should never happen, as we check in the ConfigManager, but oh well
if (DISPATCHER == m_mDispatchers.end()) {
- Debug::log(ERR, "Invalid handler in a keybind! (handler %s does not exist)", k.handler.c_str());
+ Debug::log(ERR, "Invalid handler in a keybind! (handler {} does not exist)", k.handler.c_str());
} else {
// call the dispatcher
- Debug::log(LOG, "Keybind triggered, calling dispatcher (%d, %s, %d)", modmask, key.c_str(), keysym);
+ Debug::log(LOG, "Keybind triggered, calling dispatcher ({}, {}, {})", modmask, key.c_str(), keysym);
m_iPassPressed = (int)pressed;
@@ -533,7 +533,7 @@ bool CKeybindManager::handleVT(xkb_keysym_t keysym) {
if (ttynum == TTY)
return true;
- Debug::log(LOG, "Switching from VT %i to VT %i", ttynum, TTY);
+ Debug::log(LOG, "Switching from VT {} to VT {}", ttynum, TTY);
if (!wlr_session_change_vt(g_pCompositor->m_sWLRSession, TTY))
return true; // probably same session
@@ -545,7 +545,7 @@ bool CKeybindManager::handleVT(xkb_keysym_t keysym) {
m->framesToSkip = 1;
}
- Debug::log(LOG, "Switched to VT %i, destroyed all render data, frames to skip for each: 2", TTY);
+ Debug::log(LOG, "Switched to VT {}, destroyed all render data, frames to skip for each: 2", TTY);
return true;
}
@@ -598,12 +598,12 @@ void CKeybindManager::spawn(std::string args) {
g_pConfigManager->addExecRule({r, (unsigned long)PROC});
}
- Debug::log(LOG, "Applied %i rule arguments for exec.", RULESLIST.size());
+ Debug::log(LOG, "Applied {} rule arguments for exec.", RULESLIST.size());
}
}
uint64_t CKeybindManager::spawnRaw(std::string args) {
- Debug::log(LOG, "Executing %s", args.c_str());
+ Debug::log(LOG, "Executing {}", args.c_str());
int socket[2];
if (pipe(socket) != 0) {
@@ -651,7 +651,7 @@ uint64_t CKeybindManager::spawnRaw(std::string args) {
return 0;
}
- Debug::log(LOG, "Process Created with pid %d", grandchild);
+ Debug::log(LOG, "Process Created with pid {}", grandchild);
return grandchild;
}
@@ -976,7 +976,7 @@ void CKeybindManager::moveFocusTo(std::string args) {
char arg = args[0];
if (!isDirection(args)) {
- Debug::log(ERR, "Cannot move focus in direction %c, unsupported direction. Supported: l,r,u/t,d/b", arg);
+ Debug::log(ERR, "Cannot move focus in direction {}, unsupported direction. Supported: l,r,u/t,d/b", arg);
return;
}
@@ -1028,7 +1028,7 @@ void CKeybindManager::moveFocusTo(std::string args) {
return;
}
- Debug::log(LOG, "No window found in direction %c, looking for a monitor", arg);
+ Debug::log(LOG, "No window found in direction {}, looking for a monitor", arg);
if (tryMoveFocusToMonitor(g_pCompositor->getMonitorInDirection(arg)))
return;
@@ -1037,7 +1037,7 @@ void CKeybindManager::moveFocusTo(std::string args) {
if (*PNOFALLBACK)
return;
- Debug::log(LOG, "No monitor found in direction %c, falling back to next window on current workspace", arg);
+ Debug::log(LOG, "No monitor found in direction {}, falling back to next window on current workspace", arg);
const auto PWINDOWNEXT = g_pCompositor->getNextWindowOnWorkspace(PLASTWINDOW, true);
if (PWINDOWNEXT)
@@ -1119,11 +1119,11 @@ void CKeybindManager::swapActive(std::string args) {
char arg = args[0];
if (!isDirection(args)) {
- Debug::log(ERR, "Cannot move window in direction %c, unsupported direction. Supported: l,r,u/t,d/b", arg);
+ Debug::log(ERR, "Cannot move window in direction {}, unsupported direction. Supported: l,r,u/t,d/b", arg);
return;
}
- Debug::log(LOG, "Swapping active window in direction %c", arg);
+ Debug::log(LOG, "Swapping active window in direction {}", arg);
const auto PLASTWINDOW = g_pCompositor->m_pLastWindow;
if (!PLASTWINDOW || PLASTWINDOW->m_bIsFullscreen)
return;
@@ -1149,7 +1149,7 @@ void CKeybindManager::moveActiveTo(std::string args) {
}
if (!isDirection(args)) {
- Debug::log(ERR, "Cannot move window in direction %c, unsupported direction. Supported: l,r,u/t,d/b", arg);
+ Debug::log(ERR, "Cannot move window in direction {}, unsupported direction. Supported: l,r,u/t,d/b", arg);
return;
}
@@ -1415,7 +1415,7 @@ void CKeybindManager::workspaceOpt(std::string args) {
}
}
} else {
- Debug::log(ERR, "Invalid arg in workspaceOpt, opt \"%s\" doesn't exist.", args.c_str());
+ Debug::log(ERR, "Invalid arg in workspaceOpt, opt \"{}\" doesn't exist.", args.c_str());
return;
}
@@ -1434,7 +1434,7 @@ void CKeybindManager::renameWorkspace(std::string args) {
g_pCompositor->renameWorkspace(std::stoi(args), "");
}
} catch (std::exception& e) {
- Debug::log(ERR, "Invalid arg in renameWorkspace, expected numeric id only or a numeric id and string name. \"%s\": \"%s\"", args.c_str(), e.what());
+ Debug::log(ERR, "Invalid arg in renameWorkspace, expected numeric id only or a numeric id and string name. \"{}\": \"{}\"", args.c_str(), e.what());
}
}
@@ -1514,10 +1514,10 @@ void CKeybindManager::toggleSpecialWorkspace(std::string args) {
if (requestedWorkspaceIsAlreadyOpen && specialOpenOnMonitor == workspaceID) {
// already open on this monitor
- Debug::log(LOG, "Toggling special workspace %d to closed", workspaceID);
+ Debug::log(LOG, "Toggling special workspace {} to closed", workspaceID);
PMONITOR->setSpecialWorkspace(nullptr);
} else {
- Debug::log(LOG, "Toggling special workspace %d to open", workspaceID);
+ Debug::log(LOG, "Toggling special workspace {} to open", workspaceID);
auto PSPECIALWORKSPACE = g_pCompositor->getWorkspaceByID(workspaceID);
if (!PSPECIALWORKSPACE)
@@ -1661,7 +1661,7 @@ void CKeybindManager::focusWindow(std::string regexp) {
if (!PWINDOW)
return;
- Debug::log(LOG, "Focusing to window name: %s", PWINDOW->m_szTitle.c_str());
+ Debug::log(LOG, "Focusing to window name: {}", PWINDOW->m_szTitle.c_str());
if (g_pCompositor->m_pLastMonitor->activeWorkspace != PWINDOW->m_iWorkspaceID) {
Debug::log(LOG, "Fake executing workspace to move focus");
@@ -1692,14 +1692,14 @@ void CKeybindManager::setSubmap(std::string submap) {
for (auto& k : g_pKeybindManager->m_lKeybinds) {
if (k.submap == submap) {
m_szCurrentSelectedSubmap = submap;
- Debug::log(LOG, "Changed keybind submap to %s", submap.c_str());
+ Debug::log(LOG, "Changed keybind submap to {}", submap.c_str());
g_pEventManager->postEvent(SHyprIPCEvent{"submap", submap});
EMIT_HOOK_EVENT("submap", m_szCurrentSelectedSubmap);
return;
}
}
- Debug::log(ERR, "Cannot set submap %s, submap doesn't exist (wasn't registered!)", submap.c_str());
+ Debug::log(ERR, "Cannot set submap {}, submap doesn't exist (wasn't registered!)", submap.c_str());
}
void CKeybindManager::pass(std::string regexp) {
@@ -1816,7 +1816,7 @@ void CKeybindManager::dpms(std::string arg) {
m->dpmsStatus = enable;
if (!wlr_output_commit(m->output)) {
- Debug::log(ERR, "Couldn't commit output %s", m->szName.c_str());
+ Debug::log(ERR, "Couldn't commit output {}", m->szName.c_str());
}
if (enable)
@@ -2014,7 +2014,7 @@ void CKeybindManager::moveIntoGroup(std::string args) {
static auto* const GROUPLOCKCHECK = &g_pConfigManager->getConfigValuePtr("misc:moveintogroup_lock_check")->intValue;
if (!isDirection(args)) {
- Debug::log(ERR, "Cannot move into group in direction %c, unsupported direction. Supported: l,r,u/t,d/b", arg);
+ Debug::log(ERR, "Cannot move into group in direction {}, unsupported direction. Supported: l,r,u/t,d/b", arg);
return;
}
diff --git a/src/managers/LayoutManager.cpp b/src/managers/LayoutManager.cpp
index c35465dc..e3a358a2 100644
--- a/src/managers/LayoutManager.cpp
+++ b/src/managers/LayoutManager.cpp
@@ -31,7 +31,7 @@ bool CLayoutManager::addLayout(const std::string& name, IHyprLayout* layout) {
m_vLayouts.emplace_back(std::make_pair<>(name, layout));
- Debug::log(LOG, "Added new layout %s at %lx", name.c_str(), layout);
+ Debug::log(LOG, "Added new layout {} at {:x}", name.c_str(), (uintptr_t)layout);
return true;
}
@@ -45,7 +45,7 @@ bool CLayoutManager::removeLayout(IHyprLayout* layout) {
if (m_iCurrentLayoutID == IT - m_vLayouts.begin())
switchToLayout("dwindle");
- Debug::log(LOG, "Removed a layout %s at %lx", IT->first.c_str(), layout);
+ Debug::log(LOG, "Removed a layout {} at {:x}", IT->first.c_str(), (uintptr_t)layout);
std::erase(m_vLayouts, *IT);
diff --git a/src/managers/SessionLockManager.cpp b/src/managers/SessionLockManager.cpp
index 9a27e36b..9774490b 100644
--- a/src/managers/SessionLockManager.cpp
+++ b/src/managers/SessionLockManager.cpp
@@ -4,7 +4,7 @@
static void handleSurfaceMap(void* owner, void* data) {
const auto PSURFACE = (SSessionLockSurface*)owner;
- Debug::log(LOG, "SessionLockSurface %lx mapped", PSURFACE);
+ Debug::log(LOG, "SessionLockSurface {:x} mapped", (uintptr_t)PSURFACE);
PSURFACE->mapped = true;
@@ -30,7 +30,7 @@ static void handleSurfaceCommit(void* owner, void* data) {
static void handleSurfaceDestroy(void* owner, void* data) {
const auto PSURFACE = (SSessionLockSurface*)owner;
- Debug::log(LOG, "SessionLockSurface %lx destroyed", PSURFACE);
+ Debug::log(LOG, "SessionLockSurface {:x} destroyed", (uintptr_t)PSURFACE);
PSURFACE->hyprListener_commit.removeCallback();
PSURFACE->hyprListener_destroy.removeCallback();
@@ -52,7 +52,7 @@ void CSessionLockManager::onNewSessionLock(wlr_session_lock_v1* pWlrLock) {
return;
}
- Debug::log(LOG, "Session got locked by %lx", pWlrLock);
+ Debug::log(LOG, "Session got locked by {:x}", (uintptr_t)pWlrLock);
m_sSessionLock.pWlrLock = pWlrLock;
diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp
index 1ac4416d..ee144f31 100644
--- a/src/managers/XWaylandManager.cpp
+++ b/src/managers/XWaylandManager.cpp
@@ -21,7 +21,7 @@ CHyprXWaylandManager::CHyprXWaylandManager() {
setenv("DISPLAY", m_sWLRXWayland->display_name, 1);
- Debug::log(LOG, "CHyprXWaylandManager started on display %s", m_sWLRXWayland->display_name);
+ Debug::log(LOG, "CHyprXWaylandManager started on display {}", m_sWLRXWayland->display_name);
#else
unsetenv("DISPLAY"); // unset DISPLAY so that X11 apps do not try to start on a different/invalid DISPLAY
#endif
@@ -129,7 +129,7 @@ std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) {
}
} else
return "";
- } catch (std::logic_error& e) { Debug::log(ERR, "Error in getAppIDClass: %s", e.what()); }
+ } catch (std::logic_error& e) { Debug::log(ERR, "Error in getAppIDClass: {}", e.what()); }
return "";
}
@@ -223,7 +223,7 @@ bool CHyprXWaylandManager::shouldBeFloated(CWindow* pWindow) {
if (winrole.contains("pop-up") || winrole.contains("task_dialog")) {
return true;
}
- } catch (std::exception& e) { Debug::log(ERR, "Error in shouldBeFloated, winrole threw %s", e.what()); }
+ } catch (std::exception& e) { Debug::log(ERR, "Error in shouldBeFloated, winrole threw {}", e.what()); }
}
if (pWindow->m_uSurface.xwayland->modal) {
diff --git a/src/managers/input/IdleInhibitor.cpp b/src/managers/input/IdleInhibitor.cpp
index d30cf9de..809606b1 100644
--- a/src/managers/input/IdleInhibitor.cpp
+++ b/src/managers/input/IdleInhibitor.cpp
@@ -33,7 +33,7 @@ void CInputManager::newIdleInhibitor(wlr_idle_inhibitor_v1* pInhibitor) {
PINHIBIT->pWindow = g_pCompositor->getWindowFromSurface(pInhibitor->surface);
if (PINHIBIT->pWindow)
- Debug::log(LOG, "IdleInhibitor got window %lx (%s)", PINHIBIT->pWindow, PINHIBIT->pWindow->m_szTitle.c_str());
+ Debug::log(LOG, "IdleInhibitor got window {:x} ({})", (uintptr_t)PINHIBIT->pWindow, PINHIBIT->pWindow->m_szTitle.c_str());
recheckIdleInhibitorStatus();
}
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index c16c549b..c0e16487 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -689,7 +689,7 @@ void CInputManager::newKeyboard(wlr_input_device* keyboard) {
wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, wlr_keyboard_from_input_device(keyboard));
- Debug::log(LOG, "New keyboard created, pointers Hypr: %lx and WLR: %lx", PNEWKEYBOARD, keyboard);
+ Debug::log(LOG, "New keyboard created, pointers Hypr: {:x} and WLR: {:x}", (uintptr_t)PNEWKEYBOARD, (uintptr_t)keyboard);
}
void CInputManager::newVirtualKeyboard(wlr_input_device* keyboard) {
@@ -728,7 +728,7 @@ void CInputManager::newVirtualKeyboard(wlr_input_device* keyboard) {
wlr_seat_set_keyboard(g_pCompositor->m_sSeat.seat, wlr_keyboard_from_input_device(keyboard));
- Debug::log(LOG, "New virtual keyboard created, pointers Hypr: %lx and WLR: %lx", PNEWKEYBOARD, keyboard);
+ Debug::log(LOG, "New virtual keyboard created, pointers Hypr: {:x} and WLR: {:x}", (uintptr_t)PNEWKEYBOARD, (uintptr_t)keyboard);
}
void CInputManager::setKeyboardLayout() {
@@ -743,7 +743,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
const auto HASCONFIG = g_pConfigManager->deviceConfigExists(devname);
- Debug::log(LOG, "ApplyConfigToKeyboard for \"%s\", hasconfig: %i", pKeyboard->name.c_str(), (int)HASCONFIG);
+ Debug::log(LOG, "ApplyConfigToKeyboard for \"{}\", hasconfig: {}", pKeyboard->name.c_str(), (int)HASCONFIG);
ASSERT(pKeyboard);
@@ -800,7 +800,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
return;
}
- Debug::log(LOG, "Attempting to create a keymap for layout %s with variant %s (rules: %s, model: %s, options: %s)", rules.layout, rules.variant, rules.rules, rules.model,
+ Debug::log(LOG, "Attempting to create a keymap for layout {} with variant {} (rules: {}, model: {}, options: {})", rules.layout, rules.variant, rules.rules, rules.model,
rules.options);
xkb_keymap* KEYMAP = NULL;
@@ -823,7 +823,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
g_pConfigManager->addParseError("Invalid keyboard layout passed. ( rules: " + RULES + ", model: " + MODEL + ", variant: " + VARIANT + ", options: " + OPTIONS +
", layout: " + LAYOUT + " )");
- Debug::log(ERR, "Keyboard layout %s with variant %s (rules: %s, model: %s, options: %s) couldn't have been loaded.", rules.layout, rules.variant, rules.rules, rules.model,
+ Debug::log(ERR, "Keyboard layout {} with variant {} (rules: {}, model: {}, options: {}) couldn't have been loaded.", rules.layout, rules.variant, rules.rules, rules.model,
rules.options);
memset(&rules, 0, sizeof(rules));
@@ -859,7 +859,7 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->name + "," + LAYOUTSTR});
EMIT_HOOK_EVENT("activeLayout", (std::vector<void*>{pKeyboard, (void*)&LAYOUTSTR}));
- Debug::log(LOG, "Set the keyboard layout to %s and variant to %s for keyboard \"%s\"", rules.layout, rules.variant, pKeyboard->keyboard->name);
+ Debug::log(LOG, "Set the keyboard layout to {} and variant to {} for keyboard \"{}\"", rules.layout, rules.variant, pKeyboard->keyboard->name);
}
void CInputManager::newMouse(wlr_input_device* mouse, bool virt) {
@@ -877,9 +877,9 @@ void CInputManager::newMouse(wlr_input_device* mouse, bool virt) {
if (wlr_input_device_is_libinput(mouse)) {
const auto LIBINPUTDEV = (libinput_device*)wlr_libinput_get_device_handle(mouse);
- Debug::log(LOG, "New mouse has libinput sens %.2f (%.2f) with accel profile %i (%i)", libinput_device_config_accel_get_speed(LIBINPUTDEV),
- libinput_device_config_accel_get_default_speed(LIBINPUTDEV), libinput_device_config_accel_get_profile(LIBINPUTDEV),
- libinput_device_config_accel_get_default_profile(LIBINPUTDEV));
+ Debug::log(LOG, "New mouse has libinput sens {:.2f} ({:.2f}) with accel profile {} ({})", libinput_device_config_accel_get_speed(LIBINPUTDEV),
+ libinput_device_config_accel_get_default_speed(LIBINPUTDEV), (int)libinput_device_config_accel_get_profile(LIBINPUTDEV),
+ (int)libinput_device_config_accel_get_default_profile(LIBINPUTDEV));
}
wlr_cursor_attach_input_device(g_pCompositor->m_sWLRCursor, mouse);
@@ -894,7 +894,7 @@ void CInputManager::newMouse(wlr_input_device* mouse, bool virt) {
m_tmrLastCursorMovement.reset();
- Debug::log(LOG, "New mouse created, pointer WLR: %lx", mouse);
+ Debug::log(LOG, "New mouse created, pointer WLR: {:x}", (uintptr_t)mouse);
}
void CInputManager::setPointerConfigs() {
@@ -1030,7 +1030,7 @@ void CInputManager::setPointerConfigs() {
libinput_device_config_scroll_set_button(LIBINPUTDEV, SCROLLBUTTON == 0 ? libinput_device_config_scroll_get_default_button(LIBINPUTDEV) : SCROLLBUTTON);
- Debug::log(LOG, "Applied config to mouse %s, sens %.2f", m.name.c_str(), LIBINPUTSENS);
+ Debug::log(LOG, "Applied config to mouse {}, sens {:.2f}", m.name.c_str(), LIBINPUTSENS);
}
}
}
@@ -1223,7 +1223,7 @@ void CInputManager::constrainMouse(SMouse* pMouse, wlr_pointer_constraint_v1* co
pMouse->hyprListener_commitConstraint.initCallback(&pMouse->currentConstraint->surface->events.commit, &Events::listener_commitConstraint, pMouse, "Mouse constraint commit");
- Debug::log(LOG, "Constrained mouse to %lx", pMouse->currentConstraint);
+ Debug::log(LOG, "Constrained mouse to {:x}", (uintptr_t)pMouse->currentConstraint);
}
void CInputManager::warpMouseToConstraintMiddle(SConstraint* pConstraint) {
@@ -1373,7 +1373,7 @@ void CInputManager::newTouchDevice(wlr_input_device* pDevice) {
setTouchDeviceConfigs(PNEWDEV);
wlr_cursor_attach_input_device(g_pCompositor->m_sWLRCursor, pDevice);
- Debug::log(LOG, "New touch device added at %lx", PNEWDEV);
+ Debug::log(LOG, "New touch device added at {:x}", (uintptr_t)PNEWDEV);
PNEWDEV->hyprListener_destroy.initCallback(
&pDevice->events.destroy, [&](void* owner, void* data) { destroyTouchDevice((STouchDevice*)data); }, PNEWDEV, "TouchDevice");
@@ -1420,7 +1420,7 @@ void CInputManager::setTabletConfigs() {
const auto LIBINPUTDEV = (libinput_device*)wlr_libinput_get_device_handle(t.wlrDevice);
const int ROTATION = std::clamp(HASCONFIG ? g_pConfigManager->getDeviceInt(t.name, "transform") : g_pConfigManager->getInt("input:tablet:transform"), 0, 7);
- Debug::log(LOG, "Setting calibration matrix for device %s", t.name.c_str());
+ Debug::log(LOG, "Setting calibration matrix for device {}", t.name.c_str());
libinput_device_config_calibration_set_matrix(LIBINPUTDEV, MATRICES[ROTATION]);
const auto OUTPUT = HASCONFIG ? g_pConfigManager->getDeviceString(t.name, "output") : g_pConfigManager->getString("input:tablet:output");
@@ -1434,7 +1434,7 @@ void CInputManager::setTabletConfigs() {
}
void CInputManager::destroyTouchDevice(STouchDevice* pDevice) {
- Debug::log(LOG, "Touch device at %lx removed", pDevice);
+ Debug::log(LOG, "Touch device at {:x} removed", (uintptr_t)pDevice);
m_lTouchDevices.remove(*pDevice);
}
@@ -1443,7 +1443,7 @@ void CInputManager::newSwitch(wlr_input_device* pDevice) {
const auto PNEWDEV = &m_lSwitches.emplace_back();
PNEWDEV->pWlrDevice = pDevice;
- Debug::log(LOG, "New switch with name \"%s\" added", pDevice->name);
+ Debug::log(LOG, "New switch with name \"{}\" added", pDevice->name);
PNEWDEV->hyprListener_destroy.initCallback(
&pDevice->events.destroy, [&](void* owner, void* data) { destroySwitch((SSwitchDevice*)owner); }, PNEWDEV, "SwitchDevice");
@@ -1460,17 +1460,17 @@ void CInputManager::newSwitch(wlr_input_device* pDevice) {
if (PDEVICE->status != -1 && PDEVICE->status == E->switch_state)
return;
- Debug::log(LOG, "Switch %s fired, triggering binds.", NAME.c_str());
+ Debug::log(LOG, "Switch {} fired, triggering binds.", NAME.c_str());
g_pKeybindManager->onSwitchEvent(NAME);
switch (E->switch_state) {
case WLR_SWITCH_STATE_ON:
- Debug::log(LOG, "Switch %s turn on, triggering binds.", NAME.c_str());
+ Debug::log(LOG, "Switch {} turn on, triggering binds.", NAME.c_str());
g_pKeybindManager->onSwitchOnEvent(NAME);
break;
case WLR_SWITCH_STATE_OFF:
- Debug::log(LOG, "Switch %s turn off, triggering binds.", NAME.c_str());
+ Debug::log(LOG, "Switch {} turn off, triggering binds.", NAME.c_str());
g_pKeybindManager->onSwitchOffEvent(NAME);
break;
}
diff --git a/src/managers/input/Swipe.cpp b/src/managers/input/Swipe.cpp
index b7a4a74b..8d04c4a8 100644
--- a/src/managers/input/Swipe.cpp
+++ b/src/managers/input/Swipe.cpp
@@ -25,7 +25,7 @@ void CInputManager::onSwipeBegin(wlr_pointer_swipe_begin_event* e) {
void CInputManager::beginWorkspaceSwipe() {
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(g_pCompositor->m_pLastMonitor->activeWorkspace);
- Debug::log(LOG, "Starting a swipe from %s", PWORKSPACE->m_szName.c_str());
+ Debug::log(LOG, "Starting a swipe from {}", PWORKSPACE->m_szName.c_str());
m_sActiveSwipe.pWorkspaceBegin = PWORKSPACE;
m_sActiveSwipe.delta = 0;
diff --git a/src/managers/input/Tablets.cpp b/src/managers/input/Tablets.cpp
index 41ce2ca1..77dd737c 100644
--- a/src/managers/input/Tablets.cpp
+++ b/src/managers/input/Tablets.cpp
@@ -147,7 +147,7 @@ STabletTool* CInputManager::ensureTabletToolPresent(wlr_tablet_tool* pTool) {
if (pTool->data == nullptr) {
const auto PTOOL = &m_lTabletTools.emplace_back();
- Debug::log(LOG, "Creating tablet tool v2 for %lx", pTool);
+ Debug::log(LOG, "Creating tablet tool v2 for {:x}", (uintptr_t)pTool);
PTOOL->wlrTabletTool = pTool;
pTool->data = PTOOL;