mirror of https://github.com/hyprwm/Hyprland
Merge 2d7a0ab21f
into f2dc48d92f
This commit is contained in:
commit
84a0b71150
|
@ -1049,13 +1049,19 @@ SWorkspaceIDName getWorkspaceToChangeFromArgs(std::string args, PHLWORKSPACE PCU
|
||||||
}
|
}
|
||||||
|
|
||||||
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, PWORKSPACETOCHANGETO->m_szName};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {ID, PPREVWS.name.empty() ? std::to_string(PPREVWS.id) : PPREVWS.name};
|
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) {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue