debug: move to hyprutils' logger (#12673)
This commit is contained in:
parent
f88deb928a
commit
6175ecd4c4
147 changed files with 1696 additions and 1709 deletions
|
|
@ -8,7 +8,7 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
|
|||
const auto PINHIBIT = m_idleInhibitors.emplace_back(makeUnique<SIdleInhibitor>()).get();
|
||||
PINHIBIT->inhibitor = std::any_cast<SP<CIdleInhibitor>>(inhibitor);
|
||||
|
||||
Debug::log(LOG, "New idle inhibitor registered for surface {:x}", rc<uintptr_t>(PINHIBIT->inhibitor->m_surface.get()));
|
||||
Log::logger->log(Log::DEBUG, "New idle inhibitor registered for surface {:x}", rc<uintptr_t>(PINHIBIT->inhibitor->m_surface.get()));
|
||||
|
||||
PINHIBIT->inhibitor->m_listeners.destroy = PINHIBIT->inhibitor->m_resource->m_events.destroy.listen([this, PINHIBIT] {
|
||||
std::erase_if(m_idleInhibitors, [PINHIBIT](const auto& other) { return other.get() == PINHIBIT; });
|
||||
|
|
@ -18,7 +18,7 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
|
|||
auto WLSurface = Desktop::View::CWLSurface::fromResource(PINHIBIT->inhibitor->m_surface.lock());
|
||||
|
||||
if (!WLSurface) {
|
||||
Debug::log(LOG, "Inhibitor has no HL Surface attached to it, likely meaning it's a non-desktop element. Assuming it's visible.");
|
||||
Log::logger->log(Log::DEBUG, "Inhibitor has no HL Surface attached to it, likely meaning it's a non-desktop element. Assuming it's visible.");
|
||||
PINHIBIT->nonDesktop = true;
|
||||
recheckIdleInhibitorStatus();
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ CInputManager::CInputManager() {
|
|||
if (wl_resource_get_client(event.pMgr->resource()) != g_pSeatManager->m_state.pointerFocusResource->client())
|
||||
return;
|
||||
|
||||
Debug::log(LOG, "cursorImage request: shape {} -> {}", sc<uint32_t>(event.shape), event.shapeName);
|
||||
Log::logger->log(Log::DEBUG, "cursorImage request: shape {} -> {}", sc<uint32_t>(event.shape), event.shapeName);
|
||||
|
||||
m_cursorSurfaceInfo.wlSurface->unassign();
|
||||
m_cursorSurfaceInfo.vHotspot = {};
|
||||
|
|
@ -275,7 +275,8 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus, bool mouse, st
|
|||
return;
|
||||
|
||||
} else
|
||||
Debug::log(ERR, "BUG THIS: Null SURF/CONSTRAINT in mouse refocus. Ignoring constraints. {:x} {:x}", rc<uintptr_t>(SURF.get()), rc<uintptr_t>(CONSTRAINT.get()));
|
||||
Log::logger->log(Log::ERR, "BUG THIS: Null SURF/CONSTRAINT in mouse refocus. Ignoring constraints. {:x} {:x}", rc<uintptr_t>(SURF.get()),
|
||||
rc<uintptr_t>(CONSTRAINT.get()));
|
||||
}
|
||||
|
||||
if (PMONITOR != Desktop::focusState()->monitor() && (*PMOUSEFOCUSMON || refocus) && m_forcedFocus.expired())
|
||||
|
|
@ -676,7 +677,7 @@ void CInputManager::onMouseButton(IPointer::SButtonEvent e) {
|
|||
}
|
||||
|
||||
void CInputManager::processMouseRequest(const CSeatManager::SSetCursorEvent& event) {
|
||||
Debug::log(LOG, "cursorImage request: surface {:x}", rc<uintptr_t>(event.surf.get()));
|
||||
Log::logger->log(Log::DEBUG, "cursorImage request: surface {:x}", rc<uintptr_t>(event.surf.get()));
|
||||
|
||||
if (event.surf != m_cursorSurfaceInfo.wlSurface->resource()) {
|
||||
m_cursorSurfaceInfo.wlSurface->unassign();
|
||||
|
|
@ -725,13 +726,13 @@ eClickBehaviorMode CInputManager::getClickMode() {
|
|||
void CInputManager::setClickMode(eClickBehaviorMode mode) {
|
||||
switch (mode) {
|
||||
case CLICKMODE_DEFAULT:
|
||||
Debug::log(LOG, "SetClickMode: DEFAULT");
|
||||
Log::logger->log(Log::DEBUG, "SetClickMode: DEFAULT");
|
||||
m_clickBehavior = CLICKMODE_DEFAULT;
|
||||
g_pHyprRenderer->setCursorFromName("left_ptr", true);
|
||||
break;
|
||||
|
||||
case CLICKMODE_KILL:
|
||||
Debug::log(LOG, "SetClickMode: KILL");
|
||||
Log::logger->log(Log::DEBUG, "SetClickMode: KILL");
|
||||
m_clickBehavior = CLICKMODE_KILL;
|
||||
|
||||
// remove constraints
|
||||
|
|
@ -831,7 +832,7 @@ void CInputManager::processMouseDownKill(const IPointer::SButtonEvent& e) {
|
|||
g_pCompositor->vectorToWindowUnified(getMouseCoordsInternal(), Desktop::View::RESERVED_EXTENTS | Desktop::View::INPUT_EXTENTS | Desktop::View::ALLOW_FLOATING);
|
||||
|
||||
if (!PWINDOW) {
|
||||
Debug::log(ERR, "Cannot kill invalid window!");
|
||||
Log::logger->log(Log::ERR, "Cannot kill invalid window!");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -960,7 +961,7 @@ void CInputManager::newKeyboard(SP<IKeyboard> keeb) {
|
|||
|
||||
setupKeyboard(PNEWKEYBOARD);
|
||||
|
||||
Debug::log(LOG, "New keyboard created, pointers Hypr: {:x}", rc<uintptr_t>(PNEWKEYBOARD.get()));
|
||||
Log::logger->log(Log::DEBUG, "New keyboard created, pointers Hypr: {:x}", rc<uintptr_t>(PNEWKEYBOARD.get()));
|
||||
}
|
||||
|
||||
void CInputManager::newKeyboard(SP<Aquamarine::IKeyboard> keyboard) {
|
||||
|
|
@ -968,7 +969,7 @@ void CInputManager::newKeyboard(SP<Aquamarine::IKeyboard> keyboard) {
|
|||
|
||||
setupKeyboard(PNEWKEYBOARD);
|
||||
|
||||
Debug::log(LOG, "New keyboard created, pointers Hypr: {:x} and AQ: {:x}", rc<uintptr_t>(PNEWKEYBOARD.get()), rc<uintptr_t>(keyboard.get()));
|
||||
Log::logger->log(Log::DEBUG, "New keyboard created, pointers Hypr: {:x} and AQ: {:x}", rc<uintptr_t>(PNEWKEYBOARD.get()), rc<uintptr_t>(keyboard.get()));
|
||||
}
|
||||
|
||||
void CInputManager::newVirtualKeyboard(SP<CVirtualKeyboardV1Resource> keyboard) {
|
||||
|
|
@ -976,7 +977,7 @@ void CInputManager::newVirtualKeyboard(SP<CVirtualKeyboardV1Resource> keyboard)
|
|||
|
||||
setupKeyboard(PNEWKEYBOARD);
|
||||
|
||||
Debug::log(LOG, "New virtual keyboard created at {:x}", rc<uintptr_t>(PNEWKEYBOARD.get()));
|
||||
Log::logger->log(Log::DEBUG, "New virtual keyboard created at {:x}", rc<uintptr_t>(PNEWKEYBOARD.get()));
|
||||
}
|
||||
|
||||
void CInputManager::setupKeyboard(SP<IKeyboard> keeb) {
|
||||
|
|
@ -987,7 +988,7 @@ void CInputManager::setupKeyboard(SP<IKeyboard> keeb) {
|
|||
try {
|
||||
keeb->m_hlName = getNameForNewDevice(keeb->m_deviceName);
|
||||
} catch (std::exception& e) {
|
||||
Debug::log(ERR, "Keyboard had no name???"); // logic error
|
||||
Log::logger->log(Log::ERR, "Keyboard had no name???"); // logic error
|
||||
}
|
||||
|
||||
keeb->m_events.destroy.listenStatic([this, keeb = keeb.get()] {
|
||||
|
|
@ -997,7 +998,7 @@ void CInputManager::setupKeyboard(SP<IKeyboard> keeb) {
|
|||
return;
|
||||
|
||||
destroyKeyboard(PKEEB);
|
||||
Debug::log(LOG, "Destroyed keyboard {:x}", rc<uintptr_t>(keeb));
|
||||
Log::logger->log(Log::DEBUG, "Destroyed keyboard {:x}", rc<uintptr_t>(keeb));
|
||||
});
|
||||
|
||||
keeb->m_keyboardEvents.key.listenStatic([this, keeb = keeb.get()](const IKeyboard::SKeyEvent& event) {
|
||||
|
|
@ -1062,7 +1063,7 @@ void CInputManager::applyConfigToKeyboard(SP<IKeyboard> pKeyboard) {
|
|||
|
||||
const auto HASCONFIG = g_pConfigManager->deviceConfigExists(devname);
|
||||
|
||||
Debug::log(LOG, "ApplyConfigToKeyboard for \"{}\", hasconfig: {}", devname, sc<int>(HASCONFIG));
|
||||
Log::logger->log(Log::DEBUG, "ApplyConfigToKeyboard for \"{}\", hasconfig: {}", devname, sc<int>(HASCONFIG));
|
||||
|
||||
const auto REPEATRATE = g_pConfigManager->getDeviceInt(devname, "repeat_rate", "input:repeat_rate");
|
||||
const auto REPEATDELAY = g_pConfigManager->getDeviceInt(devname, "repeat_delay", "input:repeat_delay");
|
||||
|
|
@ -1088,11 +1089,11 @@ void CInputManager::applyConfigToKeyboard(SP<IKeyboard> pKeyboard) {
|
|||
if (PERM == PERMISSION_RULE_ALLOW_MODE_PENDING) {
|
||||
const auto PROMISE = g_pDynamicPermissionManager->promiseFor(-1, pKeyboard->m_hlName, PERMISSION_TYPE_KEYBOARD);
|
||||
if (!PROMISE)
|
||||
Debug::log(ERR, "BUG THIS: No promise for client permission for keyboard");
|
||||
Log::logger->log(Log::ERR, "BUG THIS: No promise for client permission for keyboard");
|
||||
else {
|
||||
PROMISE->then([k = WP<IKeyboard>{pKeyboard}](SP<CPromiseResult<eDynamicPermissionAllowMode>> r) {
|
||||
if (r->hasError()) {
|
||||
Debug::log(ERR, "BUG THIS: No permission returned for keyboard");
|
||||
Log::logger->log(Log::ERR, "BUG THIS: No permission returned for keyboard");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1109,7 +1110,7 @@ void CInputManager::applyConfigToKeyboard(SP<IKeyboard> pKeyboard) {
|
|||
if (NUMLOCKON == pKeyboard->m_numlockOn && REPEATDELAY == pKeyboard->m_repeatDelay && REPEATRATE == pKeyboard->m_repeatRate && RULES == pKeyboard->m_currentRules.rules &&
|
||||
MODEL == pKeyboard->m_currentRules.model && LAYOUT == pKeyboard->m_currentRules.layout && VARIANT == pKeyboard->m_currentRules.variant &&
|
||||
OPTIONS == pKeyboard->m_currentRules.options && FILEPATH == pKeyboard->m_xkbFilePath) {
|
||||
Debug::log(LOG, "Not applying config to keyboard, it did not change.");
|
||||
Log::logger->log(Log::DEBUG, "Not applying config to keyboard, it did not change.");
|
||||
return;
|
||||
}
|
||||
} catch (std::exception& e) {
|
||||
|
|
@ -1128,8 +1129,8 @@ void CInputManager::applyConfigToKeyboard(SP<IKeyboard> pKeyboard) {
|
|||
g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->m_hlName + "," + LAYOUTSTR});
|
||||
EMIT_HOOK_EVENT("activeLayout", (std::vector<std::any>{pKeyboard, LAYOUTSTR}));
|
||||
|
||||
Debug::log(LOG, "Set the keyboard layout to {} and variant to {} for keyboard \"{}\"", pKeyboard->m_currentRules.layout, pKeyboard->m_currentRules.variant,
|
||||
pKeyboard->m_hlName);
|
||||
Log::logger->log(Log::DEBUG, "Set the keyboard layout to {} and variant to {} for keyboard \"{}\"", pKeyboard->m_currentRules.layout, pKeyboard->m_currentRules.variant,
|
||||
pKeyboard->m_hlName);
|
||||
}
|
||||
|
||||
void CInputManager::newVirtualMouse(SP<CVirtualPointerV1Resource> mouse) {
|
||||
|
|
@ -1137,7 +1138,7 @@ void CInputManager::newVirtualMouse(SP<CVirtualPointerV1Resource> mouse) {
|
|||
|
||||
setupMouse(PMOUSE);
|
||||
|
||||
Debug::log(LOG, "New virtual mouse created");
|
||||
Log::logger->log(Log::DEBUG, "New virtual mouse created");
|
||||
}
|
||||
|
||||
void CInputManager::newMouse(SP<IPointer> mouse) {
|
||||
|
|
@ -1145,7 +1146,7 @@ void CInputManager::newMouse(SP<IPointer> mouse) {
|
|||
|
||||
setupMouse(mouse);
|
||||
|
||||
Debug::log(LOG, "New mouse created, pointer Hypr: {:x}", rc<uintptr_t>(mouse.get()));
|
||||
Log::logger->log(Log::DEBUG, "New mouse created, pointer Hypr: {:x}", rc<uintptr_t>(mouse.get()));
|
||||
}
|
||||
|
||||
void CInputManager::newMouse(SP<Aquamarine::IPointer> mouse) {
|
||||
|
|
@ -1153,7 +1154,7 @@ void CInputManager::newMouse(SP<Aquamarine::IPointer> mouse) {
|
|||
|
||||
setupMouse(PMOUSE);
|
||||
|
||||
Debug::log(LOG, "New mouse created, pointer AQ: {:x}", rc<uintptr_t>(mouse.get()));
|
||||
Log::logger->log(Log::DEBUG, "New mouse created, pointer AQ: {:x}", rc<uintptr_t>(mouse.get()));
|
||||
}
|
||||
|
||||
void CInputManager::setupMouse(SP<IPointer> mauz) {
|
||||
|
|
@ -1162,15 +1163,15 @@ void CInputManager::setupMouse(SP<IPointer> mauz) {
|
|||
try {
|
||||
mauz->m_hlName = getNameForNewDevice(mauz->m_deviceName);
|
||||
} catch (std::exception& e) {
|
||||
Debug::log(ERR, "Mouse had no name???"); // logic error
|
||||
Log::logger->log(Log::ERR, "Mouse had no name???"); // logic error
|
||||
}
|
||||
|
||||
if (mauz->aq() && mauz->aq()->getLibinputHandle()) {
|
||||
const auto LIBINPUTDEV = mauz->aq()->getLibinputHandle();
|
||||
|
||||
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), sc<int>(libinput_device_config_accel_get_profile(LIBINPUTDEV)),
|
||||
sc<int>(libinput_device_config_accel_get_default_profile(LIBINPUTDEV)));
|
||||
Log::logger->log(Log::DEBUG, "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), sc<int>(libinput_device_config_accel_get_profile(LIBINPUTDEV)),
|
||||
sc<int>(libinput_device_config_accel_get_default_profile(LIBINPUTDEV)));
|
||||
}
|
||||
|
||||
g_pPointerManager->attachPointer(mauz);
|
||||
|
|
@ -1237,7 +1238,7 @@ void CInputManager::setPointerConfigs() {
|
|||
else if (TAP_MAP == "lmr")
|
||||
libinput_device_config_tap_set_button_map(LIBINPUTDEV, LIBINPUT_CONFIG_TAP_MAP_LMR);
|
||||
else
|
||||
Debug::log(WARN, "Tap button mapping unknown");
|
||||
Log::logger->log(Log::WARN, "Tap button mapping unknown");
|
||||
}
|
||||
|
||||
const auto SCROLLMETHOD = g_pConfigManager->getDeviceString(devname, "scroll_method", "input:scroll_method");
|
||||
|
|
@ -1252,7 +1253,7 @@ void CInputManager::setPointerConfigs() {
|
|||
} else if (SCROLLMETHOD == "on_button_down") {
|
||||
libinput_device_config_scroll_set_method(LIBINPUTDEV, LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN);
|
||||
} else {
|
||||
Debug::log(WARN, "Scroll method unknown");
|
||||
Log::logger->log(Log::WARN, "Scroll method unknown");
|
||||
}
|
||||
|
||||
if (g_pConfigManager->getDeviceInt(devname, "tap-and-drag", "input:touchpad:tap-and-drag") == 0)
|
||||
|
|
@ -1331,15 +1332,15 @@ void CInputManager::setPointerConfigs() {
|
|||
}
|
||||
|
||||
libinput_config_accel_set_points(CONFIG, LIBINPUT_ACCEL_TYPE_SCROLL, scrollStep, scrollPoints.size(), scrollPoints.data());
|
||||
} catch (std::exception& e) { Debug::log(ERR, "Invalid values in scroll_points"); }
|
||||
} catch (std::exception& e) { Log::logger->log(Log::ERR, "Invalid values in scroll_points"); }
|
||||
}
|
||||
|
||||
libinput_config_accel_set_points(CONFIG, LIBINPUT_ACCEL_TYPE_MOTION, accelStep, accelPoints.size(), accelPoints.data());
|
||||
libinput_device_config_accel_apply(LIBINPUTDEV, CONFIG);
|
||||
libinput_config_accel_destroy(CONFIG);
|
||||
} catch (std::exception& e) { Debug::log(ERR, "Invalid values in custom accel profile"); }
|
||||
} catch (std::exception& e) { Log::logger->log(Log::ERR, "Invalid values in custom accel profile"); }
|
||||
} else {
|
||||
Debug::log(WARN, "Unknown acceleration profile, falling back to default");
|
||||
Log::logger->log(Log::WARN, "Unknown acceleration profile, falling back to default");
|
||||
}
|
||||
|
||||
const auto SCROLLBUTTON = g_pConfigManager->getDeviceInt(devname, "scroll_button", "input:scroll_button");
|
||||
|
|
@ -1351,7 +1352,7 @@ void CInputManager::setPointerConfigs() {
|
|||
libinput_device_config_scroll_set_button_lock(LIBINPUTDEV,
|
||||
SCROLLBUTTONLOCK == 0 ? LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_DISABLED : LIBINPUT_CONFIG_SCROLL_BUTTON_LOCK_ENABLED);
|
||||
|
||||
Debug::log(LOG, "Applied config to mouse {}, sens {:.2f}", m->m_hlName, LIBINPUTSENS);
|
||||
Log::logger->log(Log::DEBUG, "Applied config to mouse {}, sens {:.2f}", m->m_hlName, LIBINPUTSENS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1362,7 +1363,7 @@ static void removeFromHIDs(WP<IHID> hid) {
|
|||
}
|
||||
|
||||
void CInputManager::destroyKeyboard(SP<IKeyboard> pKeyboard) {
|
||||
Debug::log(LOG, "Keyboard at {:x} removed", rc<uintptr_t>(pKeyboard.get()));
|
||||
Log::logger->log(Log::DEBUG, "Keyboard at {:x} removed", rc<uintptr_t>(pKeyboard.get()));
|
||||
|
||||
std::erase_if(m_keyboards, [pKeyboard](const auto& other) { return other == pKeyboard; });
|
||||
|
||||
|
|
@ -1386,7 +1387,7 @@ void CInputManager::destroyKeyboard(SP<IKeyboard> pKeyboard) {
|
|||
}
|
||||
|
||||
void CInputManager::destroyPointer(SP<IPointer> mouse) {
|
||||
Debug::log(LOG, "Pointer at {:x} removed", rc<uintptr_t>(mouse.get()));
|
||||
Log::logger->log(Log::DEBUG, "Pointer at {:x} removed", rc<uintptr_t>(mouse.get()));
|
||||
|
||||
std::erase_if(m_pointers, [mouse](const auto& other) { return other == mouse; });
|
||||
|
||||
|
|
@ -1399,7 +1400,7 @@ void CInputManager::destroyPointer(SP<IPointer> mouse) {
|
|||
}
|
||||
|
||||
void CInputManager::destroyTouchDevice(SP<ITouch> touch) {
|
||||
Debug::log(LOG, "Touch device at {:x} removed", rc<uintptr_t>(touch.get()));
|
||||
Log::logger->log(Log::DEBUG, "Touch device at {:x} removed", rc<uintptr_t>(touch.get()));
|
||||
|
||||
std::erase_if(m_touches, [touch](const auto& other) { return other == touch; });
|
||||
|
||||
|
|
@ -1407,7 +1408,7 @@ void CInputManager::destroyTouchDevice(SP<ITouch> touch) {
|
|||
}
|
||||
|
||||
void CInputManager::destroyTablet(SP<CTablet> tablet) {
|
||||
Debug::log(LOG, "Tablet device at {:x} removed", rc<uintptr_t>(tablet.get()));
|
||||
Log::logger->log(Log::DEBUG, "Tablet device at {:x} removed", rc<uintptr_t>(tablet.get()));
|
||||
|
||||
std::erase_if(m_tablets, [tablet](const auto& other) { return other == tablet; });
|
||||
|
||||
|
|
@ -1415,7 +1416,7 @@ void CInputManager::destroyTablet(SP<CTablet> tablet) {
|
|||
}
|
||||
|
||||
void CInputManager::destroyTabletTool(SP<CTabletTool> tool) {
|
||||
Debug::log(LOG, "Tablet tool at {:x} removed", rc<uintptr_t>(tool.get()));
|
||||
Log::logger->log(Log::DEBUG, "Tablet tool at {:x} removed", rc<uintptr_t>(tool.get()));
|
||||
|
||||
std::erase_if(m_tabletTools, [tool](const auto& other) { return other == tool; });
|
||||
|
||||
|
|
@ -1423,7 +1424,7 @@ void CInputManager::destroyTabletTool(SP<CTabletTool> tool) {
|
|||
}
|
||||
|
||||
void CInputManager::destroyTabletPad(SP<CTabletPad> pad) {
|
||||
Debug::log(LOG, "Tablet pad at {:x} removed", rc<uintptr_t>(pad.get()));
|
||||
Log::logger->log(Log::DEBUG, "Tablet pad at {:x} removed", rc<uintptr_t>(pad.get()));
|
||||
|
||||
std::erase_if(m_tabletPads, [pad](const auto& other) { return other == pad; });
|
||||
|
||||
|
|
@ -1541,7 +1542,7 @@ void CInputManager::onKeyboardMod(SP<IKeyboard> pKeyboard) {
|
|||
|
||||
const auto LAYOUT = pKeyboard->getActiveLayout();
|
||||
|
||||
Debug::log(LOG, "LAYOUT CHANGED TO {} GROUP {}", LAYOUT, MODS.group);
|
||||
Log::logger->log(Log::DEBUG, "LAYOUT CHANGED TO {} GROUP {}", LAYOUT, MODS.group);
|
||||
|
||||
g_pEventManager->postEvent(SHyprIPCEvent{"activelayout", pKeyboard->m_hlName + "," + LAYOUT});
|
||||
EMIT_HOOK_EVENT("activeLayout", (std::vector<std::any>{pKeyboard, LAYOUT}));
|
||||
|
|
@ -1571,7 +1572,7 @@ void CInputManager::refocus(std::optional<Vector2D> overridePos) {
|
|||
|
||||
bool CInputManager::refocusLastWindow(PHLMONITOR pMonitor) {
|
||||
if (!m_exclusiveLSes.empty()) {
|
||||
Debug::log(LOG, "CInputManager::refocusLastWindow: ignoring, exclusive LS present.");
|
||||
Log::logger->log(Log::DEBUG, "CInputManager::refocusLastWindow: ignoring, exclusive LS present.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1735,7 +1736,7 @@ void CInputManager::newTouchDevice(SP<Aquamarine::ITouch> pDevice) {
|
|||
try {
|
||||
PNEWDEV->m_hlName = getNameForNewDevice(PNEWDEV->m_deviceName);
|
||||
} catch (std::exception& e) {
|
||||
Debug::log(ERR, "Touch Device had no name???"); // logic error
|
||||
Log::logger->log(Log::ERR, "Touch Device had no name???"); // logic error
|
||||
}
|
||||
|
||||
setTouchDeviceConfigs(PNEWDEV);
|
||||
|
|
@ -1750,7 +1751,7 @@ void CInputManager::newTouchDevice(SP<Aquamarine::ITouch> pDevice) {
|
|||
destroyTouchDevice(PDEV);
|
||||
});
|
||||
|
||||
Debug::log(LOG, "New touch device added at {:x}", rc<uintptr_t>(PNEWDEV.get()));
|
||||
Log::logger->log(Log::DEBUG, "New touch device added at {:x}", rc<uintptr_t>(PNEWDEV.get()));
|
||||
}
|
||||
|
||||
void CInputManager::setTouchDeviceConfigs(SP<ITouch> dev) {
|
||||
|
|
@ -1764,7 +1765,7 @@ void CInputManager::setTouchDeviceConfigs(SP<ITouch> dev) {
|
|||
libinput_device_config_send_events_set_mode(LIBINPUTDEV, mode);
|
||||
|
||||
if (libinput_device_config_calibration_has_matrix(LIBINPUTDEV)) {
|
||||
Debug::log(LOG, "Setting calibration matrix for device {}", PTOUCHDEV->m_hlName);
|
||||
Log::logger->log(Log::DEBUG, "Setting calibration matrix for device {}", PTOUCHDEV->m_hlName);
|
||||
// default value of transform being -1 means it's unset.
|
||||
const int ROTATION = std::clamp(g_pConfigManager->getDeviceInt(PTOUCHDEV->m_hlName, "transform", "input:touchdevice:transform"), -1, 7);
|
||||
if (ROTATION > -1)
|
||||
|
|
@ -1785,10 +1786,10 @@ void CInputManager::setTouchDeviceConfigs(SP<ITouch> dev) {
|
|||
PTOUCHDEV->m_boundOutput = bound ? output : "";
|
||||
const auto PMONITOR = bound ? g_pCompositor->getMonitorFromName(output) : nullptr;
|
||||
if (PMONITOR) {
|
||||
Debug::log(LOG, "Binding touch device {} to output {}", PTOUCHDEV->m_hlName, PMONITOR->m_name);
|
||||
Log::logger->log(Log::DEBUG, "Binding touch device {} to output {}", PTOUCHDEV->m_hlName, PMONITOR->m_name);
|
||||
// wlr_cursor_map_input_to_output(g_pCompositor->m_sWLRCursor, &PTOUCHDEV->wlr()->base, PMONITOR->output);
|
||||
} else if (bound)
|
||||
Debug::log(ERR, "Failed to bind touch device {} to output '{}': monitor not found", PTOUCHDEV->m_hlName, output);
|
||||
Log::logger->log(Log::ERR, "Failed to bind touch device {} to output '{}': monitor not found", PTOUCHDEV->m_hlName, output);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1812,7 +1813,7 @@ void CInputManager::setTabletConfigs() {
|
|||
t->m_relativeInput = RELINPUT;
|
||||
|
||||
const int ROTATION = std::clamp(g_pConfigManager->getDeviceInt(NAME, "transform", "input:tablet:transform"), -1, 7);
|
||||
Debug::log(LOG, "Setting calibration matrix for device {}", NAME);
|
||||
Log::logger->log(Log::DEBUG, "Setting calibration matrix for device {}", NAME);
|
||||
if (ROTATION > -1)
|
||||
libinput_device_config_calibration_set_matrix(LIBINPUTDEV, MATRICES[ROTATION]);
|
||||
|
||||
|
|
@ -1823,7 +1824,7 @@ void CInputManager::setTabletConfigs() {
|
|||
|
||||
const auto OUTPUT = g_pConfigManager->getDeviceString(NAME, "output", "input:tablet:output");
|
||||
if (OUTPUT != STRVAL_EMPTY) {
|
||||
Debug::log(LOG, "Binding tablet {} to output {}", NAME, OUTPUT);
|
||||
Log::logger->log(Log::DEBUG, "Binding tablet {} to output {}", NAME, OUTPUT);
|
||||
t->m_boundOutput = OUTPUT;
|
||||
} else
|
||||
t->m_boundOutput = "";
|
||||
|
|
@ -1854,22 +1855,22 @@ void CInputManager::newSwitch(SP<Aquamarine::ISwitch> pDevice) {
|
|||
const auto PNEWDEV = &m_switches.emplace_back();
|
||||
PNEWDEV->pDevice = pDevice;
|
||||
|
||||
Debug::log(LOG, "New switch with name \"{}\" added", pDevice->getName());
|
||||
Log::logger->log(Log::DEBUG, "New switch with name \"{}\" added", pDevice->getName());
|
||||
|
||||
PNEWDEV->listeners.destroy = pDevice->events.destroy.listen([this, PNEWDEV] { destroySwitch(PNEWDEV); });
|
||||
|
||||
PNEWDEV->listeners.fire = pDevice->events.fire.listen([PNEWDEV](const Aquamarine::ISwitch::SFireEvent& event) {
|
||||
const auto NAME = PNEWDEV->pDevice->getName();
|
||||
|
||||
Debug::log(LOG, "Switch {} fired, triggering binds.", NAME);
|
||||
Log::logger->log(Log::DEBUG, "Switch {} fired, triggering binds.", NAME);
|
||||
|
||||
g_pKeybindManager->onSwitchEvent(NAME);
|
||||
|
||||
if (event.enable) {
|
||||
Debug::log(LOG, "Switch {} turn on, triggering binds.", NAME);
|
||||
Log::logger->log(Log::DEBUG, "Switch {} turn on, triggering binds.", NAME);
|
||||
g_pKeybindManager->onSwitchOnEvent(NAME);
|
||||
} else {
|
||||
Debug::log(LOG, "Switch {} turn off, triggering binds.", NAME);
|
||||
Log::logger->log(Log::DEBUG, "Switch {} turn off, triggering binds.", NAME);
|
||||
g_pKeybindManager->onSwitchOffEvent(NAME);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ void CInputPopup::onDestroy() {
|
|||
}
|
||||
|
||||
void CInputPopup::onMap() {
|
||||
Debug::log(LOG, "Mapped an IME Popup");
|
||||
Log::logger->log(Log::DEBUG, "Mapped an IME Popup");
|
||||
|
||||
updateBox();
|
||||
damageEntire();
|
||||
|
|
@ -44,7 +44,7 @@ void CInputPopup::onMap() {
|
|||
}
|
||||
|
||||
void CInputPopup::onUnmap() {
|
||||
Debug::log(LOG, "Unmapped an IME Popup");
|
||||
Log::logger->log(Log::DEBUG, "Unmapped an IME Popup");
|
||||
|
||||
damageEntire();
|
||||
}
|
||||
|
|
@ -57,7 +57,7 @@ void CInputPopup::damageEntire() {
|
|||
const auto OWNER = queryOwner();
|
||||
|
||||
if (!OWNER) {
|
||||
Debug::log(ERR, "BUG THIS: No owner in imepopup::damageentire");
|
||||
Log::logger->log(Log::ERR, "BUG THIS: No owner in imepopup::damageentire");
|
||||
return;
|
||||
}
|
||||
CBox box = globalBox();
|
||||
|
|
@ -68,7 +68,7 @@ void CInputPopup::damageSurface() {
|
|||
const auto OWNER = queryOwner();
|
||||
|
||||
if (!OWNER) {
|
||||
Debug::log(ERR, "BUG THIS: No owner in imepopup::damagesurface");
|
||||
Log::logger->log(Log::ERR, "BUG THIS: No owner in imepopup::damagesurface");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ CBox CInputPopup::globalBox() {
|
|||
const auto OWNER = queryOwner();
|
||||
|
||||
if (!OWNER) {
|
||||
Debug::log(ERR, "BUG THIS: No owner in imepopup::globalbox");
|
||||
Log::logger->log(Log::ERR, "BUG THIS: No owner in imepopup::globalbox");
|
||||
return {};
|
||||
}
|
||||
CBox parentBox = OWNER->getSurfaceBoxGlobal().value_or(CBox{0, 0, 500, 500});
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ CInputMethodRelay::CInputMethodRelay() {
|
|||
|
||||
void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
|
||||
if (!m_inputMethod.expired()) {
|
||||
Debug::log(ERR, "Cannot register 2 IMEs at once!");
|
||||
Log::logger->log(Log::ERR, "Cannot register 2 IMEs at once!");
|
||||
|
||||
pIME->unavailable();
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
|
|||
const auto PTI = getFocusedTextInput();
|
||||
|
||||
if (!PTI) {
|
||||
Debug::log(LOG, "No focused TextInput on IME Commit");
|
||||
Log::logger->log(Log::DEBUG, "No focused TextInput on IME Commit");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
|
|||
m_listeners.destroyIME = pIME->m_events.destroy.listen([this] {
|
||||
const auto PTI = getFocusedTextInput();
|
||||
|
||||
Debug::log(LOG, "IME Destroy");
|
||||
Log::logger->log(Log::DEBUG, "IME Destroy");
|
||||
|
||||
if (PTI)
|
||||
PTI->leave();
|
||||
|
|
@ -50,7 +50,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
|
|||
|
||||
m_listeners.newPopup = pIME->m_events.newPopup.listen([this](const SP<CInputMethodPopupV2>& popup) {
|
||||
m_inputMethodPopups.emplace_back(makeUnique<CInputPopup>(popup));
|
||||
Debug::log(LOG, "New input popup");
|
||||
Log::logger->log(Log::DEBUG, "New input popup");
|
||||
});
|
||||
|
||||
if (!Desktop::focusState()->surface())
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ void CInputManager::newTablet(SP<Aquamarine::ITablet> pDevice) {
|
|||
try {
|
||||
PNEWTABLET->m_hlName = g_pInputManager->getNameForNewDevice(pDevice->getName());
|
||||
} catch (std::exception& e) {
|
||||
Debug::log(ERR, "Tablet had no name???"); // logic error
|
||||
Log::logger->log(Log::ERR, "Tablet had no name???"); // logic error
|
||||
}
|
||||
|
||||
g_pPointerManager->attachTablet(PNEWTABLET);
|
||||
|
|
@ -257,7 +257,7 @@ SP<CTabletTool> CInputManager::ensureTabletToolPresent(SP<Aquamarine::ITabletToo
|
|||
try {
|
||||
PTOOL->m_hlName = g_pInputManager->getNameForNewDevice(pTool->getName());
|
||||
} catch (std::exception& e) {
|
||||
Debug::log(ERR, "Tablet had no name???"); // logic error
|
||||
Log::logger->log(Log::ERR, "Tablet had no name???"); // logic error
|
||||
}
|
||||
|
||||
PTOOL->m_events.destroy.listenStatic([this, tool = PTOOL.get()] {
|
||||
|
|
@ -275,7 +275,7 @@ void CInputManager::newTabletPad(SP<Aquamarine::ITabletPad> pDevice) {
|
|||
try {
|
||||
PNEWPAD->m_hlName = g_pInputManager->getNameForNewDevice(pDevice->getName());
|
||||
} catch (std::exception& e) {
|
||||
Debug::log(ERR, "Pad had no name???"); // logic error
|
||||
Log::logger->log(Log::ERR, "Pad had no name???"); // logic error
|
||||
}
|
||||
|
||||
PNEWPAD->m_events.destroy.listenStatic([this, pad = PNEWPAD.get()] {
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ void CTextInput::initCallbacks() {
|
|||
}
|
||||
|
||||
void CTextInput::onEnabled(SP<CWLSurfaceResource> surfV1) {
|
||||
Debug::log(LOG, "TI ENABLE");
|
||||
Log::logger->log(Log::DEBUG, "TI ENABLE");
|
||||
|
||||
if (g_pInputManager->m_relay.m_inputMethod.expired()) {
|
||||
// Debug::log(WARN, "Enabling TextInput on no IME!");
|
||||
// Log::logger->log(Log::WARN, "Enabling TextInput on no IME!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ void CTextInput::onEnabled(SP<CWLSurfaceResource> surfV1) {
|
|||
|
||||
void CTextInput::onDisabled() {
|
||||
if (g_pInputManager->m_relay.m_inputMethod.expired()) {
|
||||
// Debug::log(WARN, "Disabling TextInput on no IME!");
|
||||
// Log::logger->log(Log::WARN, "Disabling TextInput on no IME!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -107,12 +107,12 @@ void CTextInput::onReset() {
|
|||
|
||||
void CTextInput::onCommit() {
|
||||
if (g_pInputManager->m_relay.m_inputMethod.expired()) {
|
||||
// Debug::log(WARN, "Committing TextInput on no IME!");
|
||||
// Log::logger->log(Log::WARN, "Committing TextInput on no IME!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(isV3() ? m_v3Input->m_current.enabled.value : m_v1Input->m_active)) {
|
||||
Debug::log(WARN, "Disabled TextInput commit?");
|
||||
Log::logger->log(Log::WARN, "Disabled TextInput commit?");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ void CTextInput::setFocusedSurface(SP<CWLSurfaceResource> pSurface) {
|
|||
m_listeners.surfaceDestroy.reset();
|
||||
|
||||
m_listeners.surfaceUnmap = pSurface->m_events.unmap.listen([this] {
|
||||
Debug::log(LOG, "Unmap TI owner1");
|
||||
Log::logger->log(Log::DEBUG, "Unmap TI owner1");
|
||||
|
||||
if (m_enterLocks)
|
||||
m_enterLocks--;
|
||||
|
|
@ -152,7 +152,7 @@ void CTextInput::setFocusedSurface(SP<CWLSurfaceResource> pSurface) {
|
|||
});
|
||||
|
||||
m_listeners.surfaceDestroy = pSurface->m_events.destroy.listen([this] {
|
||||
Debug::log(LOG, "Destroy TI owner1");
|
||||
Log::logger->log(Log::DEBUG, "Destroy TI owner1");
|
||||
|
||||
if (m_enterLocks)
|
||||
m_enterLocks--;
|
||||
|
|
@ -188,7 +188,7 @@ void CTextInput::enter(SP<CWLSurfaceResource> pSurface) {
|
|||
|
||||
m_enterLocks++;
|
||||
if (m_enterLocks != 1) {
|
||||
Debug::log(ERR, "BUG THIS: TextInput has != 1 locks in enter");
|
||||
Log::logger->log(Log::ERR, "BUG THIS: TextInput has != 1 locks in enter");
|
||||
leave();
|
||||
m_enterLocks = 1;
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ void CTextInput::leave() {
|
|||
|
||||
m_enterLocks--;
|
||||
if (m_enterLocks != 0) {
|
||||
Debug::log(ERR, "BUG THIS: TextInput has != 0 locks in leave");
|
||||
Log::logger->log(Log::ERR, "BUG THIS: TextInput has != 0 locks in leave");
|
||||
m_enterLocks = 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include "../../devices/ITouch.hpp"
|
||||
#include "../SeatManager.hpp"
|
||||
#include "../HookSystemManager.hpp"
|
||||
#include "debug/Log.hpp"
|
||||
#include "debug/log/Logger.hpp"
|
||||
#include "UnifiedWorkspaceSwipeGesture.hpp"
|
||||
|
||||
void CInputManager::onTouchDown(ITouch::SDownEvent e) {
|
||||
|
|
@ -66,7 +66,7 @@ void CInputManager::onTouchDown(ITouch::SDownEvent e) {
|
|||
if (g_pSessionLockManager->isSessionLocked() && m_foundLSToFocus.expired()) {
|
||||
m_touchData.touchFocusLockSurface = g_pSessionLockManager->getSessionLockSurfaceForMonitor(PMONITOR->m_id);
|
||||
if (!m_touchData.touchFocusLockSurface)
|
||||
Debug::log(WARN, "The session is locked but can't find a lock surface");
|
||||
Log::logger->log(Log::WARN, "The session is locked but can't find a lock surface");
|
||||
else
|
||||
m_touchData.touchFocusSurface = m_touchData.touchFocusLockSurface->surface->surface();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ void CUnifiedWorkspaceSwipeGesture::begin() {
|
|||
|
||||
const auto PWORKSPACE = Desktop::focusState()->monitor()->m_activeWorkspace;
|
||||
|
||||
Debug::log(LOG, "CUnifiedWorkspaceSwipeGesture::begin: Starting a swipe from {}", PWORKSPACE->m_name);
|
||||
Log::logger->log(Log::DEBUG, "CUnifiedWorkspaceSwipeGesture::begin: Starting a swipe from {}", PWORKSPACE->m_name);
|
||||
|
||||
m_workspaceBegin = PWORKSPACE;
|
||||
m_delta = 0;
|
||||
|
|
@ -261,7 +261,7 @@ void CUnifiedWorkspaceSwipeGesture::end() {
|
|||
|
||||
g_pInputManager->unconstrainMouse();
|
||||
|
||||
Debug::log(LOG, "Ended swipe to the left");
|
||||
Log::logger->log(Log::DEBUG, "Ended swipe to the left");
|
||||
|
||||
pSwitchedTo = PWORKSPACEL;
|
||||
} else {
|
||||
|
|
@ -288,7 +288,7 @@ void CUnifiedWorkspaceSwipeGesture::end() {
|
|||
|
||||
g_pInputManager->unconstrainMouse();
|
||||
|
||||
Debug::log(LOG, "Ended swipe to the right");
|
||||
Log::logger->log(Log::DEBUG, "Ended swipe to the right");
|
||||
|
||||
pSwitchedTo = PWORKSPACER;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ std::expected<void, std::string> CTrackpadGestures::removeGesture(size_t fingerC
|
|||
|
||||
void CTrackpadGestures::gestureBegin(const IPointer::SSwipeBeginEvent& e) {
|
||||
if (m_activeGesture) {
|
||||
Debug::log(ERR, "CTrackpadGestures::gestureBegin (swipe) but m_activeGesture is already present");
|
||||
Log::logger->log(Log::ERR, "CTrackpadGestures::gestureBegin (swipe) but m_activeGesture is already present");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ void CTrackpadGestures::gestureUpdate(const IPointer::SSwipeUpdateEvent& e) {
|
|||
|
||||
// 5 was chosen because I felt like that's a good number.
|
||||
if (!m_activeGesture && (std::abs(m_currentTotalDelta.x) < 5 && std::abs(m_currentTotalDelta.y) < 5)) {
|
||||
Debug::log(TRACE, "CTrackpadGestures::gestureUpdate (swipe): gesture delta too small to start considering, waiting");
|
||||
Log::logger->log(Log::TRACE, "CTrackpadGestures::gestureUpdate (swipe): gesture delta too small to start considering, waiting");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ void CTrackpadGestures::gestureEnd(const IPointer::SSwipeEndEvent& e) {
|
|||
|
||||
void CTrackpadGestures::gestureBegin(const IPointer::SPinchBeginEvent& e) {
|
||||
if (m_activeGesture) {
|
||||
Debug::log(ERR, "CTrackpadGestures::gestureBegin (pinch) but m_activeGesture is already present");
|
||||
Log::logger->log(Log::ERR, "CTrackpadGestures::gestureBegin (pinch) but m_activeGesture is already present");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ void CTrackpadGestures::gestureUpdate(const IPointer::SPinchUpdateEvent& e) {
|
|||
|
||||
// 0.1 was chosen because I felt like that's a good number.
|
||||
if (!m_activeGesture && std::abs(e.scale - 1.F) < 0.1) {
|
||||
Debug::log(TRACE, "CTrackpadGestures::gestureUpdate (pinch): gesture delta too small to start considering, waiting");
|
||||
Log::logger->log(Log::TRACE, "CTrackpadGestures::gestureUpdate (pinch): gesture delta too small to start considering, waiting");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue