remove unfocusall

This commit is contained in:
vaxerski 2022-06-09 22:07:33 +02:00
parent b5a446ddfd
commit d68e09a707
3 changed files with 0 additions and 22 deletions

View file

@ -2,8 +2,6 @@
#include "../../Compositor.hpp"
void CInputManager::onMouseMoved(wlr_pointer_motion_event* e) {
unfocusAllTablets();
float sensitivity = g_pConfigManager->getFloat("general:sensitivity");
const auto DELTA = g_pConfigManager->getInt("input:force_no_accel") == 1 ? Vector2D(e->unaccel_dx, e->unaccel_dy) : Vector2D(e->delta_x, e->delta_y);
@ -19,8 +17,6 @@ void CInputManager::onMouseMoved(wlr_pointer_motion_event* e) {
}
void CInputManager::onMouseWarp(wlr_pointer_motion_absolute_event* e) {
unfocusAllTablets();
wlr_cursor_warp_absolute(g_pCompositor->m_sWLRCursor, &e->pointer->base, e->x, e->y);
mouseMoveUnified(e->time_msec);

View file

@ -59,8 +59,6 @@ public:
void mouseMoveUnified(uint32_t, bool refocus = false);
STabletTool* ensureTabletToolPresent(wlr_tablet_tool*);
void unfocusAllTablets();
};
inline std::unique_ptr<CInputManager> g_pInputManager;

View file

@ -16,8 +16,6 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
PNEWTABLET->hyprListener_Destroy.initCallback(&pDevice->events.destroy, [](void* owner, void* data) {
const auto PTAB = (STablet*)owner;
g_pInputManager->unfocusAllTablets();
g_pInputManager->m_lTablets.remove(*PTAB);
Debug::log(LOG, "Removed a tablet");
@ -96,7 +94,6 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
PNEWTABLET->hyprListener_Button.initCallback(&pDevice->tablet->events.button, [](void* owner, void* data) {
const auto EVENT = (wlr_tablet_tool_button_event*)data;
const auto PTAB = (STablet*)owner;
const auto PTOOL = g_pInputManager->ensureTabletToolPresent(EVENT->tool);
@ -141,8 +138,6 @@ STabletTool* CInputManager::ensureTabletToolPresent(wlr_tablet_tool* pTool) {
PTOOL->hyprListener_TabletToolDestroy.initCallback(&pTool->events.destroy, [](void* owner, void* data) {
const auto PTOOL = (STabletTool*)owner;
g_pInputManager->unfocusAllTablets();
PTOOL->wlrTabletTool->data = nullptr;
g_pInputManager->m_lTabletTools.remove(*PTOOL);
}, PTOOL, "Tablet Tool V1");
@ -202,8 +197,6 @@ void CInputManager::newTabletPad(wlr_input_device* pDevice) {
const auto PPAD = (STabletPad*)owner;
g_pInputManager->unfocusAllTablets();
g_pInputManager->m_lTabletPads.remove(*PPAD);
Debug::log(LOG, "Removed a tablet pad");
@ -234,12 +227,3 @@ void CInputManager::focusTablet(STablet* pTab, wlr_tablet_tool* pTool, bool moti
wlr_tablet_v2_tablet_tool_notify_proximity_out(PTOOL->wlrTabletToolV2);
}
}
void CInputManager::unfocusAllTablets() {
for (auto& tt : m_lTabletTools) {
if (!tt.wlrTabletToolV2 || !tt.pSurface || !tt.active)
continue;
wlr_tablet_v2_tablet_tool_notify_proximity_out(tt.wlrTabletToolV2);
}
}