Compare commits

...

5 Commits

Author SHA1 Message Date
はれなよ adaa538c12
Merge 2d7a0ab21f into 9c5dd59d4b 2024-06-28 23:25:41 +00:00
Vaxry 9c5dd59d4b input: fix capabilities enum types passed
hyprland down to the seat protocol impl expects IHID capabilities, not WL_ ones

ref #6702 #6196
2024-06-29 00:23:02 +02:00
Vaxry d16c6aa1db pointer-constraint: set lifetime correctly
ref #6679
2024-06-29 00:18:24 +02:00
Harenayo 2d7a0ab21f Fix #6279: prevent sending keymap or repeat info events by keyboards without keyboard capability 2024-06-28 18:15:20 +09:00
Alexander b7f42a1e88
keybinds: fix move to prev ws, moved to same mon (#6688)
Co-authored-by: Крылов Александр <aleksandr.krylov@hyperus.team>
2024-06-28 00:20:50 +02:00
5 changed files with 29 additions and 21 deletions

View File

@ -1048,14 +1048,20 @@ SWorkspaceIDName getWorkspaceToChangeFromArgs(std::string args, PHLWORKSPACE PCU
return {WORKSPACE_NOT_CHANGED, ""}; return {WORKSPACE_NOT_CHANGED, ""};
} }
const auto ID = PCURRENTWORKSPACE->m_iID; const auto ID = PCURRENTWORKSPACE->m_iID;
if (const auto PWORKSPACETOCHANGETO = g_pCompositor->getWorkspaceByID(PPREVWS.id); PWORKSPACETOCHANGETO) { const auto PWORKSPACETOCHANGETO = g_pCompositor->getWorkspaceByID(PPREVWS.id);
if (PER_MON && PCURRENTWORKSPACE->m_iMonitorID != PWORKSPACETOCHANGETO->m_iMonitorID) if (!PWORKSPACETOCHANGETO)
return {WORKSPACE_NOT_CHANGED, ""}; return {ID, PPREVWS.name.empty() ? std::to_string(PPREVWS.id) : PPREVWS.name};
return {ID, PWORKSPACETOCHANGETO->m_szName};
}
return {ID, PPREVWS.name.empty() ? std::to_string(PPREVWS.id) : PPREVWS.name}; if (!PER_MON || PCURRENTWORKSPACE->m_iMonitorID == PWORKSPACETOCHANGETO->m_iMonitorID)
return {ID, PWORKSPACETOCHANGETO->m_szName};
// PER_MON and cur ws is not on same monitor with prev per monitor
const auto POTHERWSTOCHANGETO = g_pCompositor->getWorkspaceByID(PCURRENTWORKSPACE->getPrevWorkspaceIDName(false).id);
if (POTHERWSTOCHANGETO && POTHERWSTOCHANGETO->m_iMonitorID == PCURRENTWORKSPACE->m_iMonitorID)
return {ID, POTHERWSTOCHANGETO->m_szName};
return {WORKSPACE_NOT_CHANGED, ""};
} }
void CKeybindManager::changeworkspace(std::string args) { void CKeybindManager::changeworkspace(std::string args) {

View File

@ -1473,14 +1473,7 @@ void CInputManager::updateCapabilities() {
if (h.expired()) if (h.expired())
continue; continue;
auto cap = h->getCapabilities(); caps |= h->getCapabilities();
if (cap & HID_INPUT_CAPABILITY_KEYBOARD)
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
if (cap & HID_INPUT_CAPABILITY_POINTER)
caps |= WL_SEAT_CAPABILITY_POINTER;
if (cap & HID_INPUT_CAPABILITY_TOUCH)
caps |= WL_SEAT_CAPABILITY_TOUCH;
} }
g_pSeatManager->updateCapabilities(caps); g_pSeatManager->updateCapabilities(caps);

View File

@ -7,8 +7,8 @@
#define LOGM PROTO::constraints->protoLog #define LOGM PROTO::constraints->protoLog
CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region_, zwpPointerConstraintsV1Lifetime lifetime) : CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region_, zwpPointerConstraintsV1Lifetime lifetime_) :
resourceL(resource_), locked(true) { resourceL(resource_), locked(true), lifetime(lifetime_) {
if (!resource_->resource()) if (!resource_->resource())
return; return;
@ -46,8 +46,8 @@ CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWL
sharedConstructions(); sharedConstructions();
} }
CPointerConstraint::CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region_, zwpPointerConstraintsV1Lifetime lifetime) : CPointerConstraint::CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region_, zwpPointerConstraintsV1Lifetime lifetime_) :
resourceC(resource_), locked(false) { resourceC(resource_), locked(false), lifetime(lifetime_) {
if (!resource_->resource()) if (!resource_->resource())
return; return;

View File

@ -16,8 +16,8 @@ class CWLSurfaceResource;
class CPointerConstraint { class CPointerConstraint {
public: public:
CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime); CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime_);
CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime); CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime_);
~CPointerConstraint(); ~CPointerConstraint();
bool good(); bool good();

View File

@ -2,6 +2,7 @@
#include "Compositor.hpp" #include "Compositor.hpp"
#include "DataDevice.hpp" #include "DataDevice.hpp"
#include "../../devices/IKeyboard.hpp" #include "../../devices/IKeyboard.hpp"
#include "../../devices/IHID.hpp"
#include "../../managers/SeatManager.hpp" #include "../../managers/SeatManager.hpp"
#include "../../config/ConfigValue.hpp" #include "../../config/ConfigValue.hpp"
#include <algorithm> #include <algorithm>
@ -451,12 +452,20 @@ void CWLSeatProtocol::updateCapabilities(uint32_t caps) {
} }
void CWLSeatProtocol::updateKeymap() { void CWLSeatProtocol::updateKeymap() {
if (!(currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_KEYBOARD)) {
return;
}
for (auto& k : m_vKeyboards) { for (auto& k : m_vKeyboards) {
k->sendKeymap(g_pSeatManager->keyboard.lock()); k->sendKeymap(g_pSeatManager->keyboard.lock());
} }
} }
void CWLSeatProtocol::updateRepeatInfo(uint32_t rate, uint32_t delayMs) { void CWLSeatProtocol::updateRepeatInfo(uint32_t rate, uint32_t delayMs) {
if (!(currentCaps & eHIDCapabilityType::HID_INPUT_CAPABILITY_KEYBOARD)) {
return;
}
for (auto& k : m_vKeyboards) { for (auto& k : m_vKeyboards) {
k->repeatInfo(rate, delayMs); k->repeatInfo(rate, delayMs);
} }