diff --git a/src/libinputactions/actions/Action.cpp b/src/libinputactions/actions/Action.cpp index 9cccb66..b3307e8 100644 --- a/src/libinputactions/actions/Action.cpp +++ b/src/libinputactions/actions/Action.cpp @@ -38,7 +38,6 @@ void Action::aboutToExecute() void Action::execute(const ActionExecutionArguments &args) { - qCDebug(INPUTACTIONS) << QString("Executing action \"%1\"").arg(m_id); doExecute(args); } diff --git a/src/libinputactions/actions/TriggerAction.cpp b/src/libinputactions/actions/TriggerAction.cpp index 6003f71..66d471b 100644 --- a/src/libinputactions/actions/TriggerAction.cpp +++ b/src/libinputactions/actions/TriggerAction.cpp @@ -21,8 +21,6 @@ #include #include -Q_LOGGING_CATEGORY(INPUTACTIONS_ACTION, "inputactions.action", QtWarningMsg) - namespace InputActions { @@ -105,13 +103,10 @@ void TriggerAction::update(const Delta &delta) if (delta.unaccelerated() != 0 && std::signbit(m_accumulatedDelta) != std::signbit(delta.unaccelerated())) { // Direction changed m_accumulatedDelta = m_accelerated ? delta.accelerated() : delta.unaccelerated(); - qCDebug(INPUTACTIONS_ACTION).noquote() << QString("Gesture direction changed (id: %1)").arg(m_action->id()); } else { m_accumulatedDelta += m_accelerated ? delta.accelerated() : delta.unaccelerated(); m_absoluteAccumulatedDelta += std::abs(delta.unaccelerated()); } - qCDebug(INPUTACTIONS_ACTION()).noquote() - << QString("Action updated (id: %1, accumulatedDelta: %2)").arg(m_action->id(), QString::number(m_accumulatedDelta)); if (m_on != On::Update && m_on != On::Tick) { return; diff --git a/src/libinputactions/actions/TriggerAction.h b/src/libinputactions/actions/TriggerAction.h index ab7ffb4..8c5a698 100644 --- a/src/libinputactions/actions/TriggerAction.h +++ b/src/libinputactions/actions/TriggerAction.h @@ -18,15 +18,12 @@ #pragma once -#include #include #include #include #include #include -Q_DECLARE_LOGGING_CATEGORY(INPUTACTIONS_ACTION) - namespace InputActions { diff --git a/src/libinputactions/handlers/MotionTriggerHandler.cpp b/src/libinputactions/handlers/MotionTriggerHandler.cpp index db3574c..a579404 100644 --- a/src/libinputactions/handlers/MotionTriggerHandler.cpp +++ b/src/libinputactions/handlers/MotionTriggerHandler.cpp @@ -30,8 +30,6 @@ #include #include -Q_LOGGING_CATEGORY(INPUTACTIONS_HANDLER_MOTION, "inputactions.handler.motion", QtWarningMsg) - namespace InputActions { @@ -72,8 +70,6 @@ bool MotionTriggerHandler::handleMotion(const InputDevice *device, const PointDe return false; } - qCDebug(INPUTACTIONS_HANDLER_MOTION).nospace() << "Event (type: Motion, delta: " << delta.unaccelerated() << ")"; - const auto hasStroke = hasActiveTriggers(TriggerType::Stroke); const auto hasSwipe = hasActiveTriggers(TriggerType::Swipe); @@ -228,24 +224,17 @@ bool MotionTriggerHandler::determineSpeed(TriggerType type, qreal delta, Trigger } } if (!speedThreshold.has_value()) { - qCWarning(INPUTACTIONS_HANDLER_MOTION, "No matching speed threshold found for trigger, assuming fast speed."); m_speed = speed = TriggerSpeed::Fast; return false; } if (m_sampledInputEvents++ != m_inputEventsToSample) { m_accumulatedAbsoluteSampledDelta += std::abs(delta); - qCDebug(INPUTACTIONS_HANDLER_MOTION).noquote() << QString("Determining speed (event: %1/%2, delta: %3/%4)") - .arg(QString::number(m_sampledInputEvents), - QString::number(m_inputEventsToSample), - QString::number(m_accumulatedAbsoluteSampledDelta), - QString::number(speedThreshold->threshold)); return false; } m_isDeterminingSpeed = false; m_speed = speed = (m_accumulatedAbsoluteSampledDelta / m_inputEventsToSample) >= speedThreshold->threshold ? TriggerSpeed::Fast : TriggerSpeed::Slow; - qCDebug(INPUTACTIONS_HANDLER_MOTION).noquote() << "Speed determined (speed: " << speed << ")"; return true; } @@ -258,7 +247,6 @@ void MotionTriggerHandler::triggerActivated(const Trigger *trigger) { if (const auto *motionTriggerCore = dynamic_cast(&trigger->core())) { if (!m_isDeterminingSpeed && motionTriggerCore->hasSpeed()) { - qCDebug(INPUTACTIONS_HANDLER_MOTION).noquote() << QString("Trigger has speed (id: %1)").arg(trigger->id()); m_isDeterminingSpeed = true; } } @@ -273,9 +261,6 @@ TriggerManagementOperationResult MotionTriggerHandler::endTriggersCustom(Trigger } const Stroke stroke(m_deltas); - qCDebug(INPUTACTIONS_HANDLER_MOTION).noquote() - << QString("Stroke constructed (points: %1, deltas: %2)").arg(QString::number(stroke.points().size()), QString::number(m_deltas.size())); - Trigger *best = nullptr; double bestScore = 0; for (const auto &trigger : activeTriggers(TriggerType::Stroke)) { @@ -294,7 +279,6 @@ TriggerManagementOperationResult MotionTriggerHandler::endTriggersCustom(Trigger } } } - qCDebug(INPUTACTIONS_HANDLER_MOTION).noquote() << QString("Stroke compared (bestScore: %2)").arg(QString::number(bestScore)); if (best) { cancelTriggers(best); diff --git a/src/libinputactions/handlers/MotionTriggerHandler.h b/src/libinputactions/handlers/MotionTriggerHandler.h index eb0f0f6..080b7e5 100644 --- a/src/libinputactions/handlers/MotionTriggerHandler.h +++ b/src/libinputactions/handlers/MotionTriggerHandler.h @@ -21,8 +21,6 @@ #include "InputTriggerHandler.h" #include -Q_DECLARE_LOGGING_CATEGORY(INPUTACTIONS_HANDLER_MOTION) - namespace InputActions { diff --git a/src/libinputactions/handlers/MouseTriggerHandler.cpp b/src/libinputactions/handlers/MouseTriggerHandler.cpp index 2787e64..5f22927 100644 --- a/src/libinputactions/handlers/MouseTriggerHandler.cpp +++ b/src/libinputactions/handlers/MouseTriggerHandler.cpp @@ -24,8 +24,6 @@ #include #include -Q_LOGGING_CATEGORY(INPUTACTIONS_HANDLER_MOUSE, "inputactions.handler.mouse", QtWarningMsg) - namespace InputActions { @@ -59,10 +57,8 @@ bool MouseTriggerHandler::keyboardKey(const KeyboardKeyEvent &event) bool MouseTriggerHandler::pointerAxis(const MotionEvent &event) { const auto &delta = event.delta().unaccelerated(); - qCDebug(INPUTACTIONS_HANDLER_MOUSE).nospace() << "Event (type: Wheel, delta: " << delta << ")"; if (!hasActiveTriggers(TriggerType::Wheel) && !activateTriggers(TriggerType::Wheel).success) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Event processed (type: Wheel, status: NoGestures)"); return false; } @@ -86,11 +82,9 @@ bool MouseTriggerHandler::pointerAxis(const MotionEvent &event) } } if (!continuous || (m_buttons.empty() && !g_inputBackend->keyboardModifiers())) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Wheel trigger will end immediately"); endTriggers(TriggerType::Wheel); } - qCDebug(INPUTACTIONS_HANDLER_MOUSE).noquote().nospace() << "Event processed (type: Wheel, hasGestures: " << result.success << ")"; return result.block; } @@ -98,7 +92,6 @@ bool MouseTriggerHandler::pointerButton(const PointerButtonEvent &event) { const auto button = event.button(); const auto &state = event.state(); - qCDebug(INPUTACTIONS_HANDLER_MOUSE).nospace() << "Event (type: PointerMotion, button: " << button.scanCode() << ", state: " << state << ")"; endTriggers(TriggerType::Wheel); if (state) { @@ -115,7 +108,6 @@ bool MouseTriggerHandler::pointerButton(const PointerButtonEvent &event) m_instantPress = false; for (const auto &trigger : triggers(TriggerType::Press, *m_activationEvent)) { if (dynamic_cast(trigger)->instant()) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Press gesture is instant"); m_instantPress = true; break; } @@ -130,13 +122,10 @@ bool MouseTriggerHandler::pointerButton(const PointerButtonEvent &event) connect(&m_pressTimeoutTimer, &QTimer::timeout, this, [this, sender = event.sender(), motionTimeout, unblockButtonsOnTimeout] { const auto swipeTimeout = [this, sender, unblockButtonsOnTimeout] { if (m_hadTriggerSincePress) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Mouse gesture updated before motion timeout"); return; } - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Attempting to activate mouse press gestures"); if (!activateTriggers(TriggerType::Press, *m_activationEvent).success) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "No wheel or press mouse gestures"); if (unblockButtonsOnTimeout) { pressBlockedMouseButtons(sender); } @@ -149,14 +138,11 @@ bool MouseTriggerHandler::pointerButton(const PointerButtonEvent &event) } connect(&m_motionTimeoutTimer, &QTimer::timeout, [swipeTimeout] { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "No mouse motion"); swipeTimeout(); }); m_motionTimeoutTimer.start(motionTimeout); - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Waiting for mouse motion"); }); m_pressTimeoutTimer.start(event.sender()->properties().mousePressTimeout()); - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Waiting for all mouse buttons"); if (shouldBlockMouseButton(button)) { m_blockedMouseButtons.push_back(button); @@ -180,7 +166,6 @@ bool MouseTriggerHandler::pointerButton(const PointerButtonEvent &event) const auto block = m_blockedMouseButtons.contains(button); if (m_blockedMouseButtons.removeAll(button) && !m_hadTriggerSincePress) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE).nospace() << "Mouse button pressed and released (button: " << button.scanCode() << ")"; event.sender()->mouseButton(button, true); event.sender()->mouseButton(button, false); } @@ -196,17 +181,13 @@ bool MouseTriggerHandler::pointerButton(const PointerButtonEvent &event) bool MouseTriggerHandler::pointerMotion(const MotionEvent &event) { const auto &delta = event.delta(); - qCDebug(INPUTACTIONS_HANDLER_MOUSE).nospace() << "Event (type: PointerMotion, delta: " << delta.unaccelerated() << ")"; if (m_pressTimeoutTimer.isActive()) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Event processed (type: PointerMotion, status: PressingButtons)"); return false; } m_mouseMotionSinceButtonPress += delta.unacceleratedHypot(); if (m_mouseMotionSinceButtonPress < 5) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE).nospace() << "Event processed (type: PointerMotion, status: InsufficientMotion, delta: " << delta.unaccelerated() - << ")"; return false; } @@ -216,9 +197,7 @@ bool MouseTriggerHandler::pointerMotion(const MotionEvent &event) cancelTriggers(TriggerType::All); m_motionTimeoutTimer.stop(); - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Attempting to activate mouse motion gestures"); if (!activateTriggers(TriggerType::SinglePointMotion).success) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "No motion gestures"); pressBlockedMouseButtons(event.sender()); } } @@ -226,7 +205,6 @@ bool MouseTriggerHandler::pointerMotion(const MotionEvent &event) const auto hadActiveGestures = hasActiveTriggers(TriggerType::SinglePointMotion); const auto block = handleMotion(event.sender(), delta); if (hadActiveGestures && !hasActiveTriggers(TriggerType::SinglePointMotion)) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE, "Mouse motion gesture ended/cancelled during motion"); // Swipe gesture cancelled due to wrong speed or direction pressBlockedMouseButtons(event.sender()); } @@ -260,8 +238,6 @@ bool MouseTriggerHandler::shouldBlockMouseButton(MouseButton button) if (trigger->blockEvents() && ((castedTrigger->mouseButtonsExactOrder() && std::ranges::equal(m_buttons, buttons | std::views::take(m_buttons.size()))) || (!castedTrigger->mouseButtonsExactOrder() && std::ranges::contains(buttons, button)))) { - qCDebug(INPUTACTIONS_HANDLER_MOUSE).noquote().nospace() - << "Mouse button blocked (button: " << button.scanCode() << ", trigger: " << trigger->id() << ")"; return true; } } @@ -272,7 +248,6 @@ void MouseTriggerHandler::pressBlockedMouseButtons(InputDevice *target) { for (const auto &button : m_blockedMouseButtons) { target->mouseButton(button, true); - qCDebug(INPUTACTIONS_HANDLER_MOUSE).nospace() << "Mouse button unblocked (button: " << button.scanCode() << ")"; } m_blockedMouseButtons.clear(); } diff --git a/src/libinputactions/handlers/MouseTriggerHandler.h b/src/libinputactions/handlers/MouseTriggerHandler.h index 56c40b4..7fbc0c2 100644 --- a/src/libinputactions/handlers/MouseTriggerHandler.h +++ b/src/libinputactions/handlers/MouseTriggerHandler.h @@ -20,8 +20,6 @@ #include -Q_DECLARE_LOGGING_CATEGORY(INPUTACTIONS_HANDLER_MOUSE) - namespace InputActions { diff --git a/src/libinputactions/handlers/MultiTouchMotionTriggerHandler.cpp b/src/libinputactions/handlers/MultiTouchMotionTriggerHandler.cpp index 949b5c4..e56c2c9 100644 --- a/src/libinputactions/handlers/MultiTouchMotionTriggerHandler.cpp +++ b/src/libinputactions/handlers/MultiTouchMotionTriggerHandler.cpp @@ -22,8 +22,6 @@ #include #include -Q_LOGGING_CATEGORY(INPUTACTIONS_HANDLER_MULTITOUCH, "inputactions.handler.multitouch", QtWarningMsg) - namespace InputActions { @@ -33,23 +31,18 @@ bool MultiTouchMotionTriggerHandler::handlePinch(qreal scale, qreal angleDelta) return false; } - qCDebug(INPUTACTIONS_HANDLER_MULTITOUCH).nospace() << "Pinch event (scale: " << scale << ", angleDelta: " << angleDelta << ", delta: " << ")"; - const auto scaleDelta = -(m_previousPinchScale - scale); m_previousPinchScale = scale; m_accumulatedRotateDelta += std::abs(angleDelta); if (m_pinchType == PinchType::Unknown) { if (m_accumulatedRotateDelta >= 10) { - qCDebug(INPUTACTIONS_HANDLER_MULTITOUCH, "Determined pinch type (rotate)"); m_pinchType = PinchType::Rotate; cancelTriggers(TriggerType::Pinch); } else if (std::abs(1.0 - scale) >= 0.2) { - qCDebug(INPUTACTIONS_HANDLER_MULTITOUCH, "Determined pinch type (pinch)"); m_pinchType = PinchType::Pinch; cancelTriggers(TriggerType::Rotate); } else { - qCDebug(INPUTACTIONS_HANDLER_MULTITOUCH, "Event processed (type: Pinch, status: DeterminingType)"); return true; } } @@ -75,7 +68,6 @@ bool MultiTouchMotionTriggerHandler::handlePinch(qreal scale, qreal angleDelta) TriggerSpeed speed{}; if (!determineSpeed(type, delta, speed, direction)) { - qCDebug(INPUTACTIONS_HANDLER_MULTITOUCH, "Event processed (type: Pinch, status: DeterminingSpeed)"); return true; } @@ -85,7 +77,6 @@ bool MultiTouchMotionTriggerHandler::handlePinch(qreal scale, qreal angleDelta) event.setSpeed(speed); const auto result = updateTriggers(type, event); - qCDebug(INPUTACTIONS_HANDLER_MULTITOUCH).nospace() << "Event processed (type: Pinch, hasGestures: " << result.success << ")"; return result.block; } diff --git a/src/libinputactions/handlers/MultiTouchMotionTriggerHandler.h b/src/libinputactions/handlers/MultiTouchMotionTriggerHandler.h index f33b912..83917d6 100644 --- a/src/libinputactions/handlers/MultiTouchMotionTriggerHandler.h +++ b/src/libinputactions/handlers/MultiTouchMotionTriggerHandler.h @@ -20,8 +20,6 @@ #include "MotionTriggerHandler.h" -Q_DECLARE_LOGGING_CATEGORY(INPUTACTIONS_HANDLER_MULTITOUCH) - namespace InputActions { diff --git a/src/libinputactions/handlers/TriggerHandler.cpp b/src/libinputactions/handlers/TriggerHandler.cpp index 6d4ca9c..1b18632 100644 --- a/src/libinputactions/handlers/TriggerHandler.cpp +++ b/src/libinputactions/handlers/TriggerHandler.cpp @@ -18,8 +18,6 @@ #include "TriggerHandler.h" -Q_LOGGING_CATEGORY(INPUTACTIONS_HANDLER_TRIGGER, "inputactions.handler.trigger", QtWarningMsg) - namespace InputActions { @@ -47,7 +45,6 @@ void TriggerHandler::setTimedTriggerUpdateDelta(uint32_t value) TriggerManagementOperationResult TriggerHandler::activateTriggers(TriggerTypes types, const TriggerActivationEvent &event) { - qCDebug(INPUTACTIONS_HANDLER_TRIGGER).noquote().nospace() << "Triggers activating (types: " << types << ")"; cancelTriggers(TriggerType::All); reset(); @@ -57,7 +54,6 @@ TriggerManagementOperationResult TriggerHandler::activateTriggers(TriggerTypes t for (auto &trigger : triggers(types, event)) { triggerActivated(trigger); m_activeTriggers.push_back(trigger); - qCDebug(INPUTACTIONS_HANDLER_TRIGGER).noquote() << QString("Trigger activated (id: %1)").arg(trigger->id()); result.success = true; result.block = result.block || trigger->blockEvents(); @@ -75,7 +71,6 @@ TriggerManagementOperationResult TriggerHandler::activateTriggers(TriggerTypes t } } - qCDebug(INPUTACTIONS_HANDLER_TRIGGER).noquote().nospace() << "Triggers activated (count: " << m_activeTriggers.size() << ")"; return result; } @@ -92,8 +87,6 @@ TriggerManagementOperationResult TriggerHandler::updateTriggers(const std::mapupdate(*event); if (m_activeTriggers.size() > 1) { - qCDebug(INPUTACTIONS_TRIGGER, "Cancelling conflicting triggers"); if (trigger->overridesOtherTriggersOnUpdate()) { cancelTriggers(trigger); break; @@ -198,7 +190,6 @@ TriggerManagementOperationResult TriggerHandler::doCancelTriggers(TriggerTypes t return result; } - qCDebug(INPUTACTIONS_HANDLER_TRIGGER).nospace() << "Cancelling triggers (types: " << types << ")"; for (auto it = m_activeTriggers.begin(); it != m_activeTriggers.end();) { auto trigger = *it; if (!(types & trigger->type())) { @@ -217,7 +208,6 @@ TriggerManagementOperationResult TriggerHandler::doCancelTriggers(TriggerTypes t void TriggerHandler::cancelTriggers(Trigger *except) { - qCDebug(INPUTACTIONS_HANDLER_TRIGGER).noquote().nospace() << "Cancelling triggers (except: " << except->id() << ")"; for (auto it = m_activeTriggers.begin(); it != m_activeTriggers.end();) { auto gesture = *it; if (gesture != except) { diff --git a/src/libinputactions/handlers/TriggerHandler.h b/src/libinputactions/handlers/TriggerHandler.h index 3c117af..e0910bc 100644 --- a/src/libinputactions/handlers/TriggerHandler.h +++ b/src/libinputactions/handlers/TriggerHandler.h @@ -21,8 +21,6 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(INPUTACTIONS_HANDLER_TRIGGER) - namespace InputActions { diff --git a/src/libinputactions/triggers/Trigger.cpp b/src/libinputactions/triggers/Trigger.cpp index eb5488c..957f4d4 100644 --- a/src/libinputactions/triggers/Trigger.cpp +++ b/src/libinputactions/triggers/Trigger.cpp @@ -22,8 +22,6 @@ #include #include -Q_LOGGING_CATEGORY(INPUTACTIONS_TRIGGER, "inputactions.trigger", QtWarningMsg) - namespace InputActions { @@ -70,23 +68,14 @@ void Trigger::update(const TriggerUpdateEvent &event) m_absoluteAccumulatedDelta += std::abs(delta); m_withinThreshold = !m_threshold || m_threshold->contains(m_absoluteAccumulatedDelta); if (!m_withinThreshold) { - qCDebug(INPUTACTIONS_TRIGGER).noquote() << QString("Threshold not reached (id: %1, current: %2, min: %3, max: %4") - .arg(m_id, - QString::number(m_absoluteAccumulatedDelta), - QString::number(m_threshold->min().value_or(-1)), - QString::number(m_threshold->max().value_or(-1))); return; } - qCDebug(INPUTACTIONS_TRIGGER).noquote() << QString("Trigger updated (id: %1, delta: %2)").arg(m_id, QString::number(delta)); - if (!m_started) { - qCDebug(INPUTACTIONS_TRIGGER).noquote() << QString("Trigger started (id: %1)").arg(m_id); m_started = true; m_tickTimer.start(TICK_INTERVAL); if (m_clearModifiers && *m_clearModifiers) { - qCDebug(INPUTACTIONS_TRIGGER).noquote() << QString("Clearing keyboard modifiers (trigger: %1)").arg(m_id); g_inputBackend->clearKeyboardModifiers(); } @@ -116,7 +105,6 @@ void Trigger::end(bool allowResuming) return; } - qCDebug(INPUTACTIONS_TRIGGER).noquote() << QString("Trigger ended (id: %1)").arg(m_id); setLastTrigger(); for (const auto &action : m_actions) { action->triggerEnded(); @@ -131,7 +119,6 @@ void Trigger::cancel() return; } - qCDebug(INPUTACTIONS_TRIGGER).noquote() << QString("Trigger cancelled (id: %1)").arg(m_id); for (const auto &action : m_actions) { action->triggerCancelled(); } diff --git a/src/libinputactions/triggers/Trigger.h b/src/libinputactions/triggers/Trigger.h index de37974..6713095 100644 --- a/src/libinputactions/triggers/Trigger.h +++ b/src/libinputactions/triggers/Trigger.h @@ -29,8 +29,6 @@ #include #include -Q_DECLARE_LOGGING_CATEGORY(INPUTACTIONS_TRIGGER) - namespace InputActions {