From 7fc79d13eb2a109173709c55f275789fb82f0738 Mon Sep 17 00:00:00 2001 From: ikalco <73481042+ikalco@users.noreply.github.com> Date: Mon, 22 Jul 2024 02:17:53 -0500 Subject: [PATCH 1/2] get rid of 1s in logs lol --- src/Compositor.cpp | 10 +++++----- src/desktop/LayerSurface.cpp | 6 +++--- src/helpers/Monitor.cpp | 2 +- src/managers/input/IdleInhibitor.cpp | 2 +- src/managers/input/InputManager.cpp | 8 ++++---- src/protocols/AlphaModifier.cpp | 4 ++-- src/protocols/FractionalScale.cpp | 4 ++-- src/protocols/ToplevelExport.cpp | 2 +- src/xwayland/XWM.cpp | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 02ca53635f9..98efffa9e78 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1129,7 +1129,7 @@ void CCompositor::focusSurface(SP pSurface, PHLWINDOW pWindo return; if (g_pSeatManager->seatGrab && !g_pSeatManager->seatGrab->accepts(pSurface)) { - Debug::log(LOG, "surface {:x} won't receive kb focus becuase grab rejected it", (uintptr_t)pSurface); + Debug::log(LOG, "surface {:x} won't receive kb focus becuase grab rejected it", (uintptr_t)pSurface.get()); return; } @@ -1152,9 +1152,9 @@ void CCompositor::focusSurface(SP pSurface, PHLWINDOW pWindo g_pSeatManager->setKeyboardFocus(pSurface); if (pWindowOwner) - Debug::log(LOG, "Set keyboard focus to surface {:x}, with {}", (uintptr_t)pSurface, pWindowOwner); + Debug::log(LOG, "Set keyboard focus to surface {:x}, with {}", (uintptr_t)pSurface.get(), pWindowOwner); else - Debug::log(LOG, "Set keyboard focus to surface {:x}", (uintptr_t)pSurface); + Debug::log(LOG, "Set keyboard focus to surface {:x}", (uintptr_t)pSurface.get()); g_pXWaylandManager->activateSurface(pSurface, true); m_pLastFocus = pSurface; @@ -2865,7 +2865,7 @@ void CCompositor::setPreferredScaleForSurface(SP pSurface, d const auto PSURFACE = CWLSurface::fromResource(pSurface); if (!PSURFACE) { - Debug::log(WARN, "Orphaned CWLSurfaceResource {:x} in setPreferredScaleForSurface", (uintptr_t)pSurface); + Debug::log(WARN, "Orphaned CWLSurfaceResource {:x} in setPreferredScaleForSurface", (uintptr_t)pSurface.get()); return; } @@ -2878,7 +2878,7 @@ void CCompositor::setPreferredTransformForSurface(SP pSurfac const auto PSURFACE = CWLSurface::fromResource(pSurface); if (!PSURFACE) { - Debug::log(WARN, "Orphaned CWLSurfaceResource {:x} in setPreferredTransformForSurface", (uintptr_t)pSurface); + Debug::log(WARN, "Orphaned CWLSurfaceResource {:x} in setPreferredTransformForSurface", (uintptr_t)pSurface.get()); return; } diff --git a/src/desktop/LayerSurface.cpp b/src/desktop/LayerSurface.cpp index 9a891531338..83b0992f2fd 100644 --- a/src/desktop/LayerSurface.cpp +++ b/src/desktop/LayerSurface.cpp @@ -74,7 +74,7 @@ CLayerSurface::~CLayerSurface() { } void CLayerSurface::onDestroy() { - Debug::log(LOG, "LayerSurface {:x} destroyed", (uintptr_t)layerSurface); + Debug::log(LOG, "LayerSurface {:x} destroyed", (uintptr_t)layerSurface.get()); const auto PMONITOR = g_pCompositor->getMonitorFromID(monitorID); @@ -114,7 +114,7 @@ void CLayerSurface::onDestroy() { } void CLayerSurface::onMap() { - Debug::log(LOG, "LayerSurface {:x} mapped", (uintptr_t)layerSurface); + Debug::log(LOG, "LayerSurface {:x} mapped", (uintptr_t)layerSurface.get()); mapped = true; interactivity = layerSurface->current.interactivity; @@ -177,7 +177,7 @@ void CLayerSurface::onMap() { } void CLayerSurface::onUnmap() { - Debug::log(LOG, "LayerSurface {:x} unmapped", (uintptr_t)layerSurface); + Debug::log(LOG, "LayerSurface {:x} unmapped", (uintptr_t)layerSurface.get()); g_pEventManager->postEvent(SHyprIPCEvent{"closelayer", layerSurface->layerNamespace}); EMIT_HOOK_EVENT("closeLayer", self.lock()); diff --git a/src/helpers/Monitor.cpp b/src/helpers/Monitor.cpp index a23b98610b2..635427d14a2 100644 --- a/src/helpers/Monitor.cpp +++ b/src/helpers/Monitor.cpp @@ -148,7 +148,7 @@ void CMonitor::onConnect(bool noRule) { damage.setSize(vecTransformedSize); - Debug::log(LOG, "Added new monitor with name {} at {:j0} with size {:j0}, pointer {:x}", output->name, vecPosition, vecPixelSize, (uintptr_t)output); + Debug::log(LOG, "Added new monitor with name {} at {:j0} with size {:j0}, pointer {:x}", output->name, vecPosition, vecPixelSize, (uintptr_t)output.get()); setupDefaultWS(monitorRule); diff --git a/src/managers/input/IdleInhibitor.cpp b/src/managers/input/IdleInhibitor.cpp index a38acdbfa37..da2429bc1c4 100644 --- a/src/managers/input/IdleInhibitor.cpp +++ b/src/managers/input/IdleInhibitor.cpp @@ -7,7 +7,7 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) { const auto PINHIBIT = m_vIdleInhibitors.emplace_back(std::make_unique()).get(); PINHIBIT->inhibitor = std::any_cast>(inhibitor); - Debug::log(LOG, "New idle inhibitor registered for surface {:x}", (uintptr_t)PINHIBIT->inhibitor->surface); + Debug::log(LOG, "New idle inhibitor registered for surface {:x}", (uintptr_t)PINHIBIT->inhibitor->surface.get()); PINHIBIT->inhibitor->listeners.destroy = PINHIBIT->inhibitor->resource->events.destroy.registerListener([this, PINHIBIT](std::any data) { std::erase_if(m_vIdleInhibitors, [PINHIBIT](const auto& other) { return other.get() == PINHIBIT; }); diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 492d280584a..080bc77e079 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -228,7 +228,7 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) { return; } else - Debug::log(ERR, "BUG THIS: Null SURF/CONSTRAINT in mouse refocus. Ignoring constraints. {:x} {:x}", (uintptr_t)SURF, (uintptr_t)CONSTRAINT.get()); + Debug::log(ERR, "BUG THIS: Null SURF/CONSTRAINT in mouse refocus. Ignoring constraints. {:x} {:x}", (uintptr_t)SURF.get(), (uintptr_t)CONSTRAINT.get()); } // if we are holding a pointer button, @@ -570,7 +570,7 @@ void CInputManager::processMouseRequest(std::any E) { auto e = std::any_cast(E); - Debug::log(LOG, "cursorImage request: surface {:x}", (uintptr_t)e.surf); + Debug::log(LOG, "cursorImage request: surface {:x}", (uintptr_t)e.surf.get()); if (e.surf != m_sCursorSurfaceInfo.wlSurface->resource()) { m_sCursorSurfaceInfo.wlSurface->unassign(); @@ -850,7 +850,7 @@ void CInputManager::newKeyboard(SP keyboard) { setupKeyboard(PNEWKEYBOARD); - Debug::log(LOG, "New keyboard created, pointers Hypr: {:x} and WLR: {:x}", (uintptr_t)PNEWKEYBOARD.get(), (uintptr_t)keyboard); + Debug::log(LOG, "New keyboard created, pointers Hypr: {:x} and WLR: {:x}", (uintptr_t)PNEWKEYBOARD.get(), (uintptr_t)keyboard.get()); } void CInputManager::newVirtualKeyboard(SP keyboard) { @@ -992,7 +992,7 @@ void CInputManager::newMouse(SP mouse) { setupMouse(PMOUSE); - Debug::log(LOG, "New mouse created, pointer WLR: {:x}", (uintptr_t)mouse); + Debug::log(LOG, "New mouse created, pointer WLR: {:x}", (uintptr_t)mouse.get()); } void CInputManager::setupMouse(SP mauz) { diff --git a/src/protocols/AlphaModifier.cpp b/src/protocols/AlphaModifier.cpp index 04dcd0a8672..38b8c800346 100644 --- a/src/protocols/AlphaModifier.cpp +++ b/src/protocols/AlphaModifier.cpp @@ -87,7 +87,7 @@ void CAlphaModifierProtocol::destroyModifier(CAlphaModifier* modifier) { void CAlphaModifierProtocol::onGetSurface(CWpAlphaModifierV1* pMgr, uint32_t id, SP surface) { if (std::find_if(m_mAlphaModifiers.begin(), m_mAlphaModifiers.end(), [surface](const auto& e) { return e.first == surface; }) != m_mAlphaModifiers.end()) { - LOGM(ERR, "AlphaModifier already present for surface {:x}", (uintptr_t)surface); + LOGM(ERR, "AlphaModifier already present for surface {:x}", (uintptr_t)surface.get()); pMgr->error(WP_ALPHA_MODIFIER_V1_ERROR_ALREADY_CONSTRUCTED, "AlphaModifier already present"); return; } @@ -100,4 +100,4 @@ void CAlphaModifierProtocol::onGetSurface(CWpAlphaModifierV1* pMgr, uint32_t id, m_mAlphaModifiers.erase(surface); return; } -} \ No newline at end of file +} diff --git a/src/protocols/FractionalScale.cpp b/src/protocols/FractionalScale.cpp index 6d225e99147..5bf56c5ae5a 100644 --- a/src/protocols/FractionalScale.cpp +++ b/src/protocols/FractionalScale.cpp @@ -28,7 +28,7 @@ void CFractionalScaleProtocol::onManagerResourceDestroy(wl_resource* res) { void CFractionalScaleProtocol::onGetFractionalScale(CWpFractionalScaleManagerV1* pMgr, uint32_t id, SP surface) { for (auto& [k, v] : m_mAddons) { if (k == surface) { - LOGM(ERR, "Surface {:x} already has a fractionalScale addon", (uintptr_t)surface); + LOGM(ERR, "Surface {:x} already has a fractionalScale addon", (uintptr_t)surface.get()); pMgr->error(WP_FRACTIONAL_SCALE_MANAGER_V1_ERROR_FRACTIONAL_SCALE_EXISTS, "Fractional scale already exists"); return; } @@ -80,4 +80,4 @@ bool CFractionalScaleAddon::good() { SP CFractionalScaleAddon::surf() { return surface.lock(); -} \ No newline at end of file +} diff --git a/src/protocols/ToplevelExport.cpp b/src/protocols/ToplevelExport.cpp index 0e78e5f74e4..e982ad6fc89 100644 --- a/src/protocols/ToplevelExport.cpp +++ b/src/protocols/ToplevelExport.cpp @@ -221,7 +221,7 @@ void CToplevelExportProtocolManager::copyFrame(wl_client* client, wl_resource* r const auto PWINDOW = PFRAME->pWindow.lock(); if (!validMapped(PWINDOW)) { - Debug::log(ERR, "Client requested sharing of window handle {:x} which is gone!", (uintptr_t)PWINDOW.get()); + Debug::log(ERR, "Client requested sharing of window handle {:x} which is gone!", PWINDOW); hyprland_toplevel_export_frame_v1_send_failed(PFRAME->resource); removeFrame(PFRAME); return; diff --git a/src/xwayland/XWM.cpp b/src/xwayland/XWM.cpp index 81c59cc2eff..483b3a1bf88 100644 --- a/src/xwayland/XWM.cpp +++ b/src/xwayland/XWM.cpp @@ -917,7 +917,7 @@ void CXWM::onNewSurface(SP surf) { if (surf->client() != g_pXWayland->pServer->xwaylandClient) return; - Debug::log(LOG, "[xwm] New XWayland surface at {:x}", (uintptr_t)surf); + Debug::log(LOG, "[xwm] New XWayland surface at {:x}", (uintptr_t)surf.get()); const auto WLID = surf->id(); From f89d84e0fc7816466cae4b6127816e28498a5eb2 Mon Sep 17 00:00:00 2001 From: ikalco <73481042+ikalco@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:51:56 -0500 Subject: [PATCH 2/2] replace WLR with AQ in logs --- src/managers/input/InputManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 080bc77e079..e2c6236760f 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -850,7 +850,7 @@ void CInputManager::newKeyboard(SP keyboard) { setupKeyboard(PNEWKEYBOARD); - Debug::log(LOG, "New keyboard created, pointers Hypr: {:x} and WLR: {:x}", (uintptr_t)PNEWKEYBOARD.get(), (uintptr_t)keyboard.get()); + Debug::log(LOG, "New keyboard created, pointers Hypr: {:x} and AQ: {:x}", (uintptr_t)PNEWKEYBOARD.get(), (uintptr_t)keyboard.get()); } void CInputManager::newVirtualKeyboard(SP keyboard) { @@ -992,7 +992,7 @@ void CInputManager::newMouse(SP mouse) { setupMouse(PMOUSE); - Debug::log(LOG, "New mouse created, pointer WLR: {:x}", (uintptr_t)mouse.get()); + Debug::log(LOG, "New mouse created, pointer AQ: {:x}", (uintptr_t)mouse.get()); } void CInputManager::setupMouse(SP mauz) {