mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 15:45:59 +01:00
better capability handling
This commit is contained in:
parent
f71f04db9e
commit
ac0e675f3b
3 changed files with 14 additions and 18 deletions
|
@ -91,7 +91,7 @@ void Events::listener_newInput(wl_listener* listener, void* data) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pInputManager->updateCapabilities(DEVICE);
|
g_pInputManager->updateCapabilities();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::listener_newConstraint(wl_listener* listener, void* data) {
|
void Events::listener_newConstraint(wl_listener* listener, void* data) {
|
||||||
|
|
|
@ -1014,24 +1014,20 @@ void Events::listener_commitConstraint(void* owner, void* data) {
|
||||||
//g_pInputManager->recheckConstraint((SMouse*)owner);
|
//g_pInputManager->recheckConstraint((SMouse*)owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::updateCapabilities(wlr_input_device* pDev) {
|
void CInputManager::updateCapabilities() {
|
||||||
// TODO: this is dumb
|
uint32_t caps = 0;
|
||||||
|
|
||||||
switch (pDev->type) {
|
if (!m_lKeyboards.empty())
|
||||||
case WLR_INPUT_DEVICE_KEYBOARD:
|
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
|
||||||
m_uiCapabilities |= WL_SEAT_CAPABILITY_KEYBOARD;
|
if (!m_lMice.empty())
|
||||||
break;
|
caps |= WL_SEAT_CAPABILITY_POINTER;
|
||||||
case WLR_INPUT_DEVICE_POINTER:
|
if (!m_lTouchDevices.empty())
|
||||||
m_uiCapabilities |= WL_SEAT_CAPABILITY_POINTER;
|
caps |= WL_SEAT_CAPABILITY_TOUCH;
|
||||||
break;
|
if (!m_lTabletTools.empty())
|
||||||
case WLR_INPUT_DEVICE_TOUCH:
|
caps |= WL_SEAT_CAPABILITY_POINTER;
|
||||||
m_uiCapabilities |= WL_SEAT_CAPABILITY_TOUCH;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
wlr_seat_set_capabilities(g_pCompositor->m_sSeat.seat, m_uiCapabilities);
|
wlr_seat_set_capabilities(g_pCompositor->m_sSeat.seat, caps);
|
||||||
|
m_uiCapabilities = caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t CInputManager::accumulateModsFromAllKBs() {
|
uint32_t CInputManager::accumulateModsFromAllKBs() {
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
void setTouchDeviceConfigs();
|
void setTouchDeviceConfigs();
|
||||||
|
|
||||||
void updateDragIcon();
|
void updateDragIcon();
|
||||||
void updateCapabilities(wlr_input_device*);
|
void updateCapabilities();
|
||||||
|
|
||||||
void setClickMode(eClickBehaviorMode);
|
void setClickMode(eClickBehaviorMode);
|
||||||
eClickBehaviorMode getClickMode();
|
eClickBehaviorMode getClickMode();
|
||||||
|
|
Loading…
Reference in a new issue