remove redundant logs

This commit is contained in:
vaxerski 2022-06-09 19:19:42 +02:00
parent 6317f64ba0
commit 8929172bc2

View file

@ -23,8 +23,6 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
PNEWTABLET->hyprListener_Axis.initCallback(&pDevice->tablet->events.axis, [](void* owner, void* data) { PNEWTABLET->hyprListener_Axis.initCallback(&pDevice->tablet->events.axis, [](void* owner, void* data) {
Debug::log(LOG, "Tablet axis");
const auto EVENT = (wlr_tablet_tool_axis_event*)data; const auto EVENT = (wlr_tablet_tool_axis_event*)data;
const auto PTAB = (STablet*)owner; const auto PTAB = (STablet*)owner;
@ -50,30 +48,20 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
g_pInputManager->focusTablet(PTAB, EVENT->tool, true); g_pInputManager->focusTablet(PTAB, EVENT->tool, true);
} }
if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_PRESSURE) { if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_PRESSURE)
Debug::log(LOG, "Updated pressure to %f", EVENT->pressure);
wlr_tablet_v2_tablet_tool_notify_pressure(PTOOL->wlrTabletToolV2, EVENT->pressure); wlr_tablet_v2_tablet_tool_notify_pressure(PTOOL->wlrTabletToolV2, EVENT->pressure);
}
if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_DISTANCE) { if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_DISTANCE)
Debug::log(LOG, "Updated distance to %f", EVENT->distance);
wlr_tablet_v2_tablet_tool_notify_distance(PTOOL->wlrTabletToolV2, EVENT->distance); wlr_tablet_v2_tablet_tool_notify_distance(PTOOL->wlrTabletToolV2, EVENT->distance);
}
if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_ROTATION) { if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_ROTATION)
Debug::log(LOG, "Updated rotation to %f", EVENT->rotation);
wlr_tablet_v2_tablet_tool_notify_rotation(PTOOL->wlrTabletToolV2, EVENT->rotation); wlr_tablet_v2_tablet_tool_notify_rotation(PTOOL->wlrTabletToolV2, EVENT->rotation);
}
if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_SLIDER) { if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_SLIDER)
Debug::log(LOG, "Updated slider to %f", EVENT->slider);
wlr_tablet_v2_tablet_tool_notify_slider(PTOOL->wlrTabletToolV2, EVENT->slider); wlr_tablet_v2_tablet_tool_notify_slider(PTOOL->wlrTabletToolV2, EVENT->slider);
}
if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_WHEEL) { if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_WHEEL)
Debug::log(LOG, "Updated wheel delta to %f", EVENT->wheel_delta);
wlr_tablet_v2_tablet_tool_notify_wheel(PTOOL->wlrTabletToolV2, EVENT->wheel_delta, 0); wlr_tablet_v2_tablet_tool_notify_wheel(PTOOL->wlrTabletToolV2, EVENT->wheel_delta, 0);
}
if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_X) if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_X)
PTOOL->tiltX = EVENT->tilt_x; PTOOL->tiltX = EVENT->tilt_x;
@ -81,29 +69,24 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_Y) if (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_TILT_Y)
PTOOL->tiltY = EVENT->tilt_y; PTOOL->tiltY = EVENT->tilt_y;
if (EVENT->updated_axes & (WLR_TABLET_TOOL_AXIS_TILT_X | WLR_TABLET_TOOL_AXIS_TILT_Y)){ if (EVENT->updated_axes & (WLR_TABLET_TOOL_AXIS_TILT_X | WLR_TABLET_TOOL_AXIS_TILT_Y))
Debug::log(LOG, "Updated tilt to %f, %f", EVENT->tilt_x, EVENT->tilt_y);
wlr_tablet_v2_tablet_tool_notify_tilt(PTOOL->wlrTabletToolV2, PTOOL->tiltX, PTOOL->tiltY); wlr_tablet_v2_tablet_tool_notify_tilt(PTOOL->wlrTabletToolV2, PTOOL->tiltX, PTOOL->tiltY);
}
}, PNEWTABLET, "Tablet"); }, PNEWTABLET, "Tablet");
PNEWTABLET->hyprListener_Tip.initCallback(&pDevice->tablet->events.tip, [](void* owner, void* data) { PNEWTABLET->hyprListener_Tip.initCallback(&pDevice->tablet->events.tip, [](void* owner, void* data) {
const auto EVENT = (wlr_tablet_tool_tip_event*)data; const auto EVENT = (wlr_tablet_tool_tip_event*)data;
const auto PTAB = (STablet*)owner; const auto PTAB = (STablet*)owner;
Debug::log(LOG, "Tablet tip");
const auto PTOOL = g_pInputManager->ensureTabletToolPresent(PTAB, EVENT->tool); const auto PTOOL = g_pInputManager->ensureTabletToolPresent(PTAB, EVENT->tool);
// TODO: this might be wrong // TODO: this might be wrong
if (EVENT->state == WLR_TABLET_TOOL_TIP_DOWN) { if (EVENT->state == WLR_TABLET_TOOL_TIP_DOWN) {
Debug::log(LOG, "Tip down");
g_pInputManager->refocus(); g_pInputManager->refocus();
g_pInputManager->focusTablet(PTAB, EVENT->tool); g_pInputManager->focusTablet(PTAB, EVENT->tool);
wlr_send_tablet_v2_tablet_tool_down(PTOOL->wlrTabletToolV2); wlr_send_tablet_v2_tablet_tool_down(PTOOL->wlrTabletToolV2);
} }
else { else {
Debug::log(LOG, "Tip up");
wlr_send_tablet_v2_tablet_tool_up(PTOOL->wlrTabletToolV2); wlr_send_tablet_v2_tablet_tool_up(PTOOL->wlrTabletToolV2);
} }
@ -113,8 +96,6 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
const auto EVENT = (wlr_tablet_tool_button_event*)data; const auto EVENT = (wlr_tablet_tool_button_event*)data;
const auto PTAB = (STablet*)owner; const auto PTAB = (STablet*)owner;
Debug::log(LOG, "Tablet button");
const auto PTOOL = g_pInputManager->ensureTabletToolPresent(PTAB, EVENT->tool); const auto PTOOL = g_pInputManager->ensureTabletToolPresent(PTAB, EVENT->tool);
wlr_tablet_v2_tablet_tool_notify_button(PTOOL->wlrTabletToolV2, (zwp_tablet_pad_v2_button_state)EVENT->button, (zwp_tablet_pad_v2_button_state)EVENT->state); wlr_tablet_v2_tablet_tool_notify_button(PTOOL->wlrTabletToolV2, (zwp_tablet_pad_v2_button_state)EVENT->button, (zwp_tablet_pad_v2_button_state)EVENT->state);
@ -125,16 +106,12 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
const auto EVENT = (wlr_tablet_tool_proximity_event*)data; const auto EVENT = (wlr_tablet_tool_proximity_event*)data;
const auto PTAB = (STablet*)owner; const auto PTAB = (STablet*)owner;
Debug::log(LOG, "Tablet proxim");
const auto PTOOL = g_pInputManager->ensureTabletToolPresent(PTAB, EVENT->tool); const auto PTOOL = g_pInputManager->ensureTabletToolPresent(PTAB, EVENT->tool);
if (EVENT->state == WLR_TABLET_TOOL_PROXIMITY_OUT) { if (EVENT->state == WLR_TABLET_TOOL_PROXIMITY_OUT) {
PTOOL->active = false; PTOOL->active = false;
Debug::log(LOG, "Tool active -> false");
} else { } else {
PTOOL->active = true; PTOOL->active = true;
Debug::log(LOG, "Tool active -> true");
g_pInputManager->refocus(); g_pInputManager->refocus();
g_pInputManager->focusTablet(PTAB, EVENT->tool); g_pInputManager->focusTablet(PTAB, EVENT->tool);
} }
@ -173,8 +150,6 @@ void CInputManager::newTabletPad(wlr_input_device* pDevice) {
PNEWPAD->hyprListener_Button.initCallback(&pDevice->tablet_pad->events.button, [](void* owner, void* data) { PNEWPAD->hyprListener_Button.initCallback(&pDevice->tablet_pad->events.button, [](void* owner, void* data) {
Debug::log(LOG, "TabletPad button");
const auto EVENT = (wlr_tablet_pad_button_event*)data; const auto EVENT = (wlr_tablet_pad_button_event*)data;
const auto PPAD = (STabletPad*)owner; const auto PPAD = (STabletPad*)owner;
@ -188,8 +163,6 @@ void CInputManager::newTabletPad(wlr_input_device* pDevice) {
const auto EVENT = (wlr_tablet_pad_strip_event*)data; const auto EVENT = (wlr_tablet_pad_strip_event*)data;
const auto PPAD = (STabletPad*)owner; const auto PPAD = (STabletPad*)owner;
Debug::log(LOG, "TabletPad strip");
wlr_tablet_v2_tablet_pad_notify_strip(PPAD->wlrTabletPadV2, EVENT->strip, EVENT->position, EVENT->source == WLR_TABLET_PAD_STRIP_SOURCE_FINGER, EVENT->time_msec); wlr_tablet_v2_tablet_pad_notify_strip(PPAD->wlrTabletPadV2, EVENT->strip, EVENT->position, EVENT->source == WLR_TABLET_PAD_STRIP_SOURCE_FINGER, EVENT->time_msec);
}, PNEWPAD, "Tablet Pad"); }, PNEWPAD, "Tablet Pad");
@ -199,8 +172,6 @@ void CInputManager::newTabletPad(wlr_input_device* pDevice) {
const auto EVENT = (wlr_tablet_pad_ring_event*)data; const auto EVENT = (wlr_tablet_pad_ring_event*)data;
const auto PPAD = (STabletPad*)owner; const auto PPAD = (STabletPad*)owner;
Debug::log(LOG, "TabletPad ring");
wlr_tablet_v2_tablet_pad_notify_ring(PPAD->wlrTabletPadV2, EVENT->ring, EVENT->position, EVENT->source == WLR_TABLET_PAD_RING_SOURCE_FINGER, EVENT->time_msec); wlr_tablet_v2_tablet_pad_notify_ring(PPAD->wlrTabletPadV2, EVENT->ring, EVENT->position, EVENT->source == WLR_TABLET_PAD_RING_SOURCE_FINGER, EVENT->time_msec);
}, PNEWPAD, "Tablet Pad"); }, PNEWPAD, "Tablet Pad");
@ -210,8 +181,6 @@ void CInputManager::newTabletPad(wlr_input_device* pDevice) {
const auto TABLET = (wlr_tablet_tool*)data; const auto TABLET = (wlr_tablet_tool*)data;
const auto PPAD = (STabletPad*)owner; const auto PPAD = (STabletPad*)owner;
Debug::log(LOG, "TabletPad attach");
PPAD->pTabletParent = (STablet*)TABLET->data; PPAD->pTabletParent = (STablet*)TABLET->data;
if (!PPAD->pTabletParent) if (!PPAD->pTabletParent)
@ -223,8 +192,6 @@ void CInputManager::newTabletPad(wlr_input_device* pDevice) {
const auto PPAD = (STabletPad*)owner; const auto PPAD = (STabletPad*)owner;
Debug::log(LOG, "TabletPad destroy");
g_pInputManager->m_lTabletPads.remove(*PPAD); g_pInputManager->m_lTabletPads.remove(*PPAD);
Debug::log(LOG, "Removed a tablet pad"); Debug::log(LOG, "Removed a tablet pad");
@ -240,8 +207,6 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti
const auto LOCAL = CURSORPOS - PWINDOW->m_vRealPosition.goalv(); const auto LOCAL = CURSORPOS - PWINDOW->m_vRealPosition.goalv();
Debug::log(LOG, "Tablet Tool focus to %s", PWINDOW->m_szTitle.c_str());
if (PTOOL->wlrTabletToolV2->focused_surface != g_pCompositor->m_pLastFocus) if (PTOOL->wlrTabletToolV2->focused_surface != g_pCompositor->m_pLastFocus)
wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2); wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2);