mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 03:05:59 +01:00
don't refocus on virt ptrs
This commit is contained in:
parent
ab44aabbd7
commit
ad66c158ba
4 changed files with 9 additions and 3 deletions
|
@ -151,7 +151,7 @@ void Events::listener_newVirtPtr(wl_listener* listener, void* data) {
|
||||||
const auto POINTER = EV->new_pointer;
|
const auto POINTER = EV->new_pointer;
|
||||||
const auto DEVICE = &POINTER->pointer.base;
|
const auto DEVICE = &POINTER->pointer.base;
|
||||||
|
|
||||||
g_pInputManager->newMouse(DEVICE);
|
g_pInputManager->newMouse(DEVICE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::listener_destroyMouse(void* owner, void* data) {
|
void Events::listener_destroyMouse(void* owner, void* data) {
|
||||||
|
|
|
@ -109,6 +109,8 @@ struct SMouse {
|
||||||
|
|
||||||
std::string name = "";
|
std::string name = "";
|
||||||
|
|
||||||
|
bool virt = false;
|
||||||
|
|
||||||
DYNLISTENER(commitConstraint);
|
DYNLISTENER(commitConstraint);
|
||||||
DYNLISTENER(destroyMouse);
|
DYNLISTENER(destroyMouse);
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,9 @@ void CInputManager::mouseMoveUnified(uint32_t time, bool refocus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_pCompositor->m_sSeat.mouse->virt)
|
||||||
|
return; // don't refocus on virt
|
||||||
|
|
||||||
Vector2D mouseCoords = getMouseCoordsInternal();
|
Vector2D mouseCoords = getMouseCoordsInternal();
|
||||||
const auto MOUSECOORDSFLOORED = mouseCoords.floor();
|
const auto MOUSECOORDSFLOORED = mouseCoords.floor();
|
||||||
|
|
||||||
|
@ -498,11 +501,12 @@ void CInputManager::applyConfigToKeyboard(SKeyboard* pKeyboard) {
|
||||||
Debug::log(LOG, "Set the keyboard layout to %s and variant to %s for keyboard \"%s\"", rules.layout, rules.variant, pKeyboard->keyboard->name);
|
Debug::log(LOG, "Set the keyboard layout to %s and variant to %s for keyboard \"%s\"", rules.layout, rules.variant, pKeyboard->keyboard->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInputManager::newMouse(wlr_input_device* mouse) {
|
void CInputManager::newMouse(wlr_input_device* mouse, bool virt) {
|
||||||
m_lMice.emplace_back();
|
m_lMice.emplace_back();
|
||||||
const auto PMOUSE = &m_lMice.back();
|
const auto PMOUSE = &m_lMice.back();
|
||||||
|
|
||||||
PMOUSE->mouse = mouse;
|
PMOUSE->mouse = mouse;
|
||||||
|
PMOUSE->virt = virt;
|
||||||
try {
|
try {
|
||||||
PMOUSE->name = std::string(mouse->name);
|
PMOUSE->name = std::string(mouse->name);
|
||||||
} catch(std::exception& e) {
|
} catch(std::exception& e) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ public:
|
||||||
void onKeyboardMod(void*, SKeyboard*);
|
void onKeyboardMod(void*, SKeyboard*);
|
||||||
|
|
||||||
void newKeyboard(wlr_input_device*);
|
void newKeyboard(wlr_input_device*);
|
||||||
void newMouse(wlr_input_device*);
|
void newMouse(wlr_input_device*, bool virt = false);
|
||||||
void destroyKeyboard(SKeyboard*);
|
void destroyKeyboard(SKeyboard*);
|
||||||
void destroyMouse(wlr_input_device*);
|
void destroyMouse(wlr_input_device*);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue