From 6175ecd4c4ba817c4620f66a75e1e11da7c7a8ca Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Thu, 18 Dec 2025 17:23:24 +0000 Subject: debug: move to hyprutils' logger (#12673) --- src/protocols/core/DataDevice.cpp | 72 +++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'src/protocols/core/DataDevice.cpp') diff --git a/src/protocols/core/DataDevice.cpp b/src/protocols/core/DataDevice.cpp index 4a24e861..41f07273 100644 --- a/src/protocols/core/DataDevice.cpp +++ b/src/protocols/core/DataDevice.cpp @@ -26,16 +26,16 @@ CWLDataOfferResource::CWLDataOfferResource(SP resource_, SPsetAccept([this](CWlDataOffer* r, uint32_t serial, const char* mime) { if (!m_source) { - LOGM(WARN, "Possible bug: Accept on an offer w/o a source"); + LOGM(Log::WARN, "Possible bug: Accept on an offer w/o a source"); return; } if (m_dead) { - LOGM(WARN, "Possible bug: Accept on an offer that's dead"); + LOGM(Log::WARN, "Possible bug: Accept on an offer that's dead"); return; } - LOGM(LOG, "Offer {:x} accepts data from source {:x} with mime {}", (uintptr_t)this, (uintptr_t)m_source.get(), mime ? mime : "null"); + LOGM(Log::DEBUG, "Offer {:x} accepts data from source {:x} with mime {}", (uintptr_t)this, (uintptr_t)m_source.get(), mime ? mime : "null"); m_source->accepted(mime ? mime : ""); m_accepted = mime; @@ -44,19 +44,19 @@ CWLDataOfferResource::CWLDataOfferResource(SP resource_, SPsetReceive([this](CWlDataOffer* r, const char* mime, int fd) { CFileDescriptor sendFd{fd}; if (!m_source) { - LOGM(WARN, "Possible bug: Receive on an offer w/o a source"); + LOGM(Log::WARN, "Possible bug: Receive on an offer w/o a source"); return; } if (m_dead) { - LOGM(WARN, "Possible bug: Receive on an offer that's dead"); + LOGM(Log::WARN, "Possible bug: Receive on an offer that's dead"); return; } - LOGM(LOG, "Offer {:x} asks to send data from source {:x}", (uintptr_t)this, (uintptr_t)m_source.get()); + LOGM(Log::DEBUG, "Offer {:x} asks to send data from source {:x}", (uintptr_t)this, (uintptr_t)m_source.get()); if (!m_accepted) { - LOGM(WARN, "Offer was never accepted, sending accept first"); + LOGM(Log::WARN, "Offer was never accepted, sending accept first"); m_source->accepted(mime ? mime : ""); } @@ -101,13 +101,13 @@ void CWLDataOfferResource::sendData() { else if (SOURCEACTIONS & WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY) m_resource->sendAction(WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY); else { - LOGM(ERR, "Client bug? dnd source has no action move or copy. Sending move, f this."); + LOGM(Log::ERR, "Client bug? dnd source has no action move or copy. Sending move, f this."); m_resource->sendAction(WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE); } } for (auto const& m : m_source->mimes()) { - LOGM(LOG, " | offer {:x} supports mime {}", (uintptr_t)this, m); + LOGM(Log::DEBUG, " | offer {:x} supports mime {}", (uintptr_t)this, m); m_resource->sendOffer(m.c_str()); } } @@ -147,7 +147,7 @@ CWLDataSourceResource::CWLDataSourceResource(SP resource_, SPsetOffer([this](CWlDataSource* r, const char* mime) { m_mimeTypes.emplace_back(mime); }); m_resource->setSetActions([this](CWlDataSource* r, uint32_t a) { - LOGM(LOG, "DataSource {:x} actions {}", (uintptr_t)this, a); + LOGM(Log::DEBUG, "DataSource {:x} actions {}", (uintptr_t)this, a); m_supportedActions = a; }); } @@ -173,7 +173,7 @@ void CWLDataSourceResource::accepted(const std::string& mime) { } if (std::ranges::find(m_mimeTypes, mime) == m_mimeTypes.end()) { - LOGM(ERR, "Compositor/App bug: CWLDataSourceResource::sendAccepted with non-existent mime"); + LOGM(Log::ERR, "Compositor/App bug: CWLDataSourceResource::sendAccepted with non-existent mime"); return; } @@ -186,7 +186,7 @@ std::vector CWLDataSourceResource::mimes() { void CWLDataSourceResource::send(const std::string& mime, CFileDescriptor fd) { if (std::ranges::find(m_mimeTypes, mime) == m_mimeTypes.end()) { - LOGM(ERR, "Compositor/App bug: CWLDataSourceResource::sendAskSend with non-existent mime"); + LOGM(Log::ERR, "Compositor/App bug: CWLDataSourceResource::sendAskSend with non-existent mime"); return; } @@ -248,13 +248,13 @@ CWLDataDeviceResource::CWLDataDeviceResource(SP resource_) : m_re m_resource->setSetSelection([](CWlDataDevice* r, wl_resource* sourceR, uint32_t serial) { auto source = sourceR ? CWLDataSourceResource::fromResource(sourceR) : CSharedPointer{}; if (!source) { - LOGM(LOG, "Reset selection received"); + LOGM(Log::DEBUG, "Reset selection received"); g_pSeatManager->setCurrentSelection(nullptr); return; } if (source && source->m_used) - LOGM(WARN, "setSelection on a used resource. By protocol, this is a violation, but firefox et al insist on doing this."); + LOGM(Log::WARN, "setSelection on a used resource. By protocol, this is a violation, but firefox et al insist on doing this."); source->markUsed(); @@ -264,12 +264,12 @@ CWLDataDeviceResource::CWLDataDeviceResource(SP resource_) : m_re m_resource->setStartDrag([](CWlDataDevice* r, wl_resource* sourceR, wl_resource* origin, wl_resource* icon, uint32_t serial) { auto source = CWLDataSourceResource::fromResource(sourceR); if (!source) { - LOGM(ERR, "No source in drag"); + LOGM(Log::ERR, "No source in drag"); return; } if (source && source->m_used) - LOGM(WARN, "setSelection on a used resource. By protocol, this is a violation, but firefox et al insist on doing this."); + LOGM(Log::WARN, "setSelection on a used resource. By protocol, this is a violation, but firefox et al insist on doing this."); source->markUsed(); @@ -357,13 +357,13 @@ CWLDataDeviceManagerResource::CWLDataDeviceManagerResource(SPm_self = RESOURCE; m_sources.emplace_back(RESOURCE); - LOGM(LOG, "New data source bound at {:x}", (uintptr_t)RESOURCE.get()); + LOGM(Log::DEBUG, "New data source bound at {:x}", (uintptr_t)RESOURCE.get()); }); m_resource->setGetDataDevice([this](CWlDataDeviceManager* r, uint32_t id, wl_resource* seat) { @@ -383,7 +383,7 @@ CWLDataDeviceManagerResource::CWLDataDeviceManagerResource(SPm_device = RESOURCE; } - LOGM(LOG, "New data device bound at {:x}", (uintptr_t)RESOURCE.get()); + LOGM(Log::DEBUG, "New data device bound at {:x}", (uintptr_t)RESOURCE.get()); }); } @@ -407,7 +407,7 @@ void CWLDataDeviceProtocol::bindManager(wl_client* client, void* data, uint32_t return; } - LOGM(LOG, "New datamgr resource bound at {:x}", (uintptr_t)RESOURCE.get()); + LOGM(Log::DEBUG, "New datamgr resource bound at {:x}", (uintptr_t)RESOURCE.get()); } void CWLDataDeviceProtocol::destroyResource(CWLDataDeviceManagerResource* seat) { @@ -463,11 +463,11 @@ void CWLDataDeviceProtocol::sendSelectionToDevice(SP dev, SPtype() == DATA_SOURCE_TYPE_WAYLAND ? "wayland" : "X11", (uintptr_t)offer.get(), (uintptr_t)sel.get()); + LOGM(Log::DEBUG, "New {} offer {:x} for data source {:x}", offer->type() == DATA_SOURCE_TYPE_WAYLAND ? "wayland" : "X11", (uintptr_t)offer.get(), (uintptr_t)sel.get()); dev->sendDataOffer(offer); if (const auto WL = offer->getWayland(); WL) @@ -488,7 +488,7 @@ void CWLDataDeviceProtocol::setSelection(SP source) { } if (!source) { - LOGM(LOG, "resetting selection"); + LOGM(Log::DEBUG, "resetting selection"); if (!g_pSeatManager->m_state.keyboardFocusResource) return; @@ -500,7 +500,7 @@ void CWLDataDeviceProtocol::setSelection(SP source) { return; } - LOGM(LOG, "New selection for data source {:x}", (uintptr_t)source.get()); + LOGM(Log::DEBUG, "New selection for data source {:x}", (uintptr_t)source.get()); if (!g_pSeatManager->m_state.keyboardFocusResource) return; @@ -508,12 +508,12 @@ void CWLDataDeviceProtocol::setSelection(SP source) { auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.keyboardFocusResource->client()); if (!DESTDEVICE) { - LOGM(LOG, "CWLDataDeviceProtocol::setSelection: cannot send selection to a client without a data_device"); + LOGM(Log::DEBUG, "CWLDataDeviceProtocol::setSelection: cannot send selection to a client without a data_device"); return; } if (DESTDEVICE->type() != DATA_SOURCE_TYPE_WAYLAND) { - LOGM(LOG, "CWLDataDeviceProtocol::setSelection: ignoring X11 data device"); + LOGM(Log::DEBUG, "CWLDataDeviceProtocol::setSelection: ignoring X11 data device"); return; } @@ -527,7 +527,7 @@ void CWLDataDeviceProtocol::updateSelection() { auto DESTDEVICE = dataDeviceForClient(g_pSeatManager->m_state.keyboardFocusResource->client()); if (!DESTDEVICE) { - LOGM(LOG, "CWLDataDeviceProtocol::onKeyboardFocus: cannot send selection to a client without a data_device"); + LOGM(Log::DEBUG, "CWLDataDeviceProtocol::onKeyboardFocus: cannot send selection to a client without a data_device"); return; } @@ -557,14 +557,14 @@ void CWLDataDeviceProtocol::onDndPointerFocus() { void CWLDataDeviceProtocol::initiateDrag(WP currentSource, SP dragSurface, SP origin) { if (m_dnd.currentSource) { - LOGM(WARN, "New drag started while old drag still active??"); + LOGM(Log::WARN, "New drag started while old drag still active??"); abortDrag(); } Cursor::overrideController->setOverride("grabbing", Cursor::CURSOR_OVERRIDE_DND); m_dnd.overriddenCursor = true; - LOGM(LOG, "initiateDrag: source {:x}, surface: {:x}, origin: {:x}", (uintptr_t)currentSource.get(), (uintptr_t)dragSurface, (uintptr_t)origin); + LOGM(Log::DEBUG, "initiateDrag: source {:x}, surface: {:x}, origin: {:x}", (uintptr_t)currentSource.get(), (uintptr_t)dragSurface, (uintptr_t)origin); currentSource->m_used = true; @@ -589,20 +589,20 @@ void CWLDataDeviceProtocol::initiateDrag(WP currentSource m_dnd.mouseButton = g_pHookSystem->hookDynamic("mouseButton", [this](void* self, SCallbackInfo& info, std::any e) { auto E = std::any_cast(e); if (E.state == WL_POINTER_BUTTON_STATE_RELEASED) { - LOGM(LOG, "Dropping drag on mouseUp"); + LOGM(Log::DEBUG, "Dropping drag on mouseUp"); dropDrag(); } }); m_dnd.touchUp = g_pHookSystem->hookDynamic("touchUp", [this](void* self, SCallbackInfo& info, std::any e) { - LOGM(LOG, "Dropping drag on touchUp"); + LOGM(Log::DEBUG, "Dropping drag on touchUp"); dropDrag(); }); m_dnd.tabletTip = g_pHookSystem->hookDynamic("tabletTip", [this](void* self, SCallbackInfo& info, std::any e) { auto E = std::any_cast(e); if (!E.in) { - LOGM(LOG, "Dropping drag on tablet tipUp"); + LOGM(Log::DEBUG, "Dropping drag on tablet tipUp"); dropDrag(); } }); @@ -621,7 +621,7 @@ void CWLDataDeviceProtocol::initiateDrag(WP currentSource return; m_dnd.focusedDevice->sendMotion(Time::millis(Time::steadyNow()), V - box->pos()); - LOGM(LOG, "Drag motion {}", V - box->pos()); + LOGM(Log::DEBUG, "Drag motion {}", V - box->pos()); } }); @@ -639,7 +639,7 @@ void CWLDataDeviceProtocol::initiateDrag(WP currentSource return; m_dnd.focusedDevice->sendMotion(E.timeMs, E.pos); - LOGM(LOG, "Drag motion {}", E.pos); + LOGM(Log::DEBUG, "Drag motion {}", E.pos); } }); @@ -689,11 +689,11 @@ void CWLDataDeviceProtocol::updateDrag() { #endif if (!offer) { - LOGM(ERR, "No offer could be created in updateDrag"); + LOGM(Log::ERR, "No offer could be created in updateDrag"); return; } - LOGM(LOG, "New {} dnd offer {:x} for data source {:x}", offer->type() == DATA_SOURCE_TYPE_WAYLAND ? "wayland" : "X11", (uintptr_t)offer.get(), + LOGM(Log::DEBUG, "New {} dnd offer {:x} for data source {:x}", offer->type() == DATA_SOURCE_TYPE_WAYLAND ? "wayland" : "X11", (uintptr_t)offer.get(), (uintptr_t)m_dnd.currentSource.get()); m_dnd.focusedDevice->sendDataOffer(offer); -- cgit v1.2.3