mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 15:45:58 +01:00
remove unfocusall
This commit is contained in:
parent
b5a446ddfd
commit
d68e09a707
3 changed files with 0 additions and 22 deletions
|
@ -2,8 +2,6 @@
|
||||||
#include "../../Compositor.hpp"
|
#include "../../Compositor.hpp"
|
||||||
|
|
||||||
void CInputManager::onMouseMoved(wlr_pointer_motion_event* e) {
|
void CInputManager::onMouseMoved(wlr_pointer_motion_event* e) {
|
||||||
unfocusAllTablets();
|
|
||||||
|
|
||||||
float sensitivity = g_pConfigManager->getFloat("general:sensitivity");
|
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);
|
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) {
|
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);
|
wlr_cursor_warp_absolute(g_pCompositor->m_sWLRCursor, &e->pointer->base, e->x, e->y);
|
||||||
|
|
||||||
mouseMoveUnified(e->time_msec);
|
mouseMoveUnified(e->time_msec);
|
||||||
|
|
|
@ -59,8 +59,6 @@ public:
|
||||||
void mouseMoveUnified(uint32_t, bool refocus = false);
|
void mouseMoveUnified(uint32_t, bool refocus = false);
|
||||||
|
|
||||||
STabletTool* ensureTabletToolPresent(wlr_tablet_tool*);
|
STabletTool* ensureTabletToolPresent(wlr_tablet_tool*);
|
||||||
|
|
||||||
void unfocusAllTablets();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline std::unique_ptr<CInputManager> g_pInputManager;
|
inline std::unique_ptr<CInputManager> g_pInputManager;
|
|
@ -16,8 +16,6 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
|
||||||
PNEWTABLET->hyprListener_Destroy.initCallback(&pDevice->events.destroy, [](void* owner, void* data) {
|
PNEWTABLET->hyprListener_Destroy.initCallback(&pDevice->events.destroy, [](void* owner, void* data) {
|
||||||
const auto PTAB = (STablet*)owner;
|
const auto PTAB = (STablet*)owner;
|
||||||
|
|
||||||
g_pInputManager->unfocusAllTablets();
|
|
||||||
|
|
||||||
g_pInputManager->m_lTablets.remove(*PTAB);
|
g_pInputManager->m_lTablets.remove(*PTAB);
|
||||||
|
|
||||||
Debug::log(LOG, "Removed a tablet");
|
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) {
|
PNEWTABLET->hyprListener_Button.initCallback(&pDevice->tablet->events.button, [](void* owner, void* data) {
|
||||||
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 PTOOL = g_pInputManager->ensureTabletToolPresent(EVENT->tool);
|
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) {
|
PTOOL->hyprListener_TabletToolDestroy.initCallback(&pTool->events.destroy, [](void* owner, void* data) {
|
||||||
const auto PTOOL = (STabletTool*)owner;
|
const auto PTOOL = (STabletTool*)owner;
|
||||||
|
|
||||||
g_pInputManager->unfocusAllTablets();
|
|
||||||
|
|
||||||
PTOOL->wlrTabletTool->data = nullptr;
|
PTOOL->wlrTabletTool->data = nullptr;
|
||||||
g_pInputManager->m_lTabletTools.remove(*PTOOL);
|
g_pInputManager->m_lTabletTools.remove(*PTOOL);
|
||||||
}, PTOOL, "Tablet Tool V1");
|
}, PTOOL, "Tablet Tool V1");
|
||||||
|
@ -202,8 +197,6 @@ void CInputManager::newTabletPad(wlr_input_device* pDevice) {
|
||||||
|
|
||||||
const auto PPAD = (STabletPad*)owner;
|
const auto PPAD = (STabletPad*)owner;
|
||||||
|
|
||||||
g_pInputManager->unfocusAllTablets();
|
|
||||||
|
|
||||||
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");
|
||||||
|
@ -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);
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue