mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-17 03:42:08 +01:00
Minor fixes for virtual input devices
This commit is contained in:
parent
2a20cf5379
commit
aefc34b405
4 changed files with 12 additions and 5 deletions
|
@ -165,7 +165,7 @@ bool CKeybindManager::onKeyEvent(wlr_keyboard_key_event* e, SKeyboard* pKeyboard
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pKeyboard->isVirtual)
|
if (pKeyboard->isVirtual && g_pInputManager->shouldIgnoreVirtualKeyboard(pKeyboard))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!m_pXKBTranslationState) {
|
if (!m_pXKBTranslationState) {
|
||||||
|
|
|
@ -52,9 +52,6 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_pCompositor->m_sSeat.mouse->virt)
|
|
||||||
return; // don't refocus on virt
|
|
||||||
|
|
||||||
if (!g_pCompositor->m_bDPMSStateON && *PMOUSEDPMS) {
|
if (!g_pCompositor->m_bDPMSStateON && *PMOUSEDPMS) {
|
||||||
// enable dpms
|
// enable dpms
|
||||||
g_pKeybindManager->dpms("on");
|
g_pKeybindManager->dpms("on");
|
||||||
|
@ -861,6 +858,10 @@ void CInputManager::onKeyboardMod(void* data, SKeyboard* pKeyboard) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CInputManager::shouldIgnoreVirtualKeyboard(SKeyboard* pKeyboard) {
|
||||||
|
return !pKeyboard || (m_sIMERelay.m_pKeyboardGrab && wl_resource_get_client(m_sIMERelay.m_pKeyboardGrab->pWlrKbGrab->resource) == wl_resource_get_client(wlr_input_device_get_virtual_keyboard(pKeyboard->keyboard)->resource));
|
||||||
|
}
|
||||||
|
|
||||||
void CInputManager::refocus() {
|
void CInputManager::refocus() {
|
||||||
mouseMoveUnified(0, true);
|
mouseMoveUnified(0, true);
|
||||||
}
|
}
|
||||||
|
@ -1002,7 +1003,7 @@ uint32_t CInputManager::accumulateModsFromAllKBs() {
|
||||||
uint32_t finalMask = 0;
|
uint32_t finalMask = 0;
|
||||||
|
|
||||||
for (auto& kb : m_lKeyboards) {
|
for (auto& kb : m_lKeyboards) {
|
||||||
if (kb.isVirtual)
|
if (kb.isVirtual && shouldIgnoreVirtualKeyboard(&kb))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
finalMask |= wlr_keyboard_get_modifiers(wlr_keyboard_from_input_device(kb.keyboard));
|
finalMask |= wlr_keyboard_get_modifiers(wlr_keyboard_from_input_device(kb.keyboard));
|
||||||
|
|
|
@ -120,6 +120,9 @@ public:
|
||||||
|
|
||||||
CWindow* m_pFollowOnDnDBegin = nullptr;
|
CWindow* m_pFollowOnDnDBegin = nullptr;
|
||||||
|
|
||||||
|
// for virtual keyboards: whether we should respect them as normal ones
|
||||||
|
bool shouldIgnoreVirtualKeyboard(SKeyboard*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// for click behavior override
|
// for click behavior override
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
#include "../../defines.hpp"
|
#include "../../defines.hpp"
|
||||||
#include "../../helpers/WLClasses.hpp"
|
#include "../../helpers/WLClasses.hpp"
|
||||||
|
|
||||||
|
class CInputManager;
|
||||||
|
|
||||||
class CInputMethodRelay {
|
class CInputMethodRelay {
|
||||||
public:
|
public:
|
||||||
CInputMethodRelay();
|
CInputMethodRelay();
|
||||||
|
@ -45,4 +47,5 @@ private:
|
||||||
void createNewTextInput(wlr_text_input_v3*);
|
void createNewTextInput(wlr_text_input_v3*);
|
||||||
|
|
||||||
friend class CHyprRenderer;
|
friend class CHyprRenderer;
|
||||||
|
friend class CInputManager;
|
||||||
};
|
};
|
Loading…
Add table
Reference in a new issue