mirror of https://github.com/hyprwm/Hyprland
Compare commits
5 Commits
197fabb54f
...
862190c6f5
Author | SHA1 | Date |
---|---|---|
|
862190c6f5 | |
|
9c5dd59d4b | |
|
d16c6aa1db | |
|
724f07cd2f | |
|
b7f42a1e88 |
|
@ -30,6 +30,7 @@ void Events::listener_RendererDestroy(wl_listener* listener, void* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Events::listener_sessionActive(wl_listener* listener, void* data) {
|
void Events::listener_sessionActive(wl_listener* listener, void* data) {
|
||||||
|
if (g_pCompositor->m_sWLRSession->active) {
|
||||||
Debug::log(LOG, "Session got activated!");
|
Debug::log(LOG, "Session got activated!");
|
||||||
|
|
||||||
g_pCompositor->m_bSessionActive = true;
|
g_pCompositor->m_bSessionActive = true;
|
||||||
|
@ -40,4 +41,16 @@ void Events::listener_sessionActive(wl_listener* listener, void* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pConfigManager->m_bWantsMonitorReload = true;
|
g_pConfigManager->m_bWantsMonitorReload = true;
|
||||||
|
} else {
|
||||||
|
Debug::log(LOG, "Session got inactivated!");
|
||||||
|
|
||||||
|
g_pCompositor->m_bSessionActive = false;
|
||||||
|
|
||||||
|
for (auto& m : g_pCompositor->m_vMonitors) {
|
||||||
|
m->noFrameSchedule = true;
|
||||||
|
m->framesToSkip = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug::log(LOG, "Destroyed all render data, frames to skip for each: 2");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -810,18 +810,7 @@ bool CKeybindManager::handleVT(xkb_keysym_t keysym) {
|
||||||
|
|
||||||
Debug::log(LOG, "Switching from VT {} to VT {}", ttynum, TTY);
|
Debug::log(LOG, "Switching from VT {} to VT {}", ttynum, TTY);
|
||||||
|
|
||||||
if (!wlr_session_change_vt(g_pCompositor->m_sWLRSession, TTY))
|
wlr_session_change_vt(g_pCompositor->m_sWLRSession, TTY);
|
||||||
return true; // probably same session
|
|
||||||
|
|
||||||
g_pCompositor->m_bSessionActive = false;
|
|
||||||
|
|
||||||
for (auto& m : g_pCompositor->m_vMonitors) {
|
|
||||||
m->noFrameSchedule = true;
|
|
||||||
m->framesToSkip = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug::log(LOG, "Switched to VT {}, destroyed all render data, frames to skip for each: 2", TTY);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1049,13 +1038,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) {
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue