mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-29 19:03:48 -07:00
idle-inhibit: enable idle inhibitor if no hl surface is associated (#5882)
This commit is contained in:
@@ -17,8 +17,8 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
|
|||||||
auto WLSurface = CWLSurface::surfaceFromWlr(PINHIBIT->inhibitor->surface);
|
auto WLSurface = CWLSurface::surfaceFromWlr(PINHIBIT->inhibitor->surface);
|
||||||
|
|
||||||
if (!WLSurface) {
|
if (!WLSurface) {
|
||||||
Debug::log(LOG, "Inhibitor has no HL Surface attached to it, likely meaning it's a non-desktop element. Ignoring.");
|
Debug::log(LOG, "Inhibitor has no HL Surface attached to it, likely meaning it's a non-desktop element. Assuming it's visible.");
|
||||||
PINHIBIT->inert = true;
|
PINHIBIT->nonDesktop = true;
|
||||||
recheckIdleInhibitorStatus();
|
recheckIdleInhibitorStatus();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -32,8 +32,10 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
|
|||||||
void CInputManager::recheckIdleInhibitorStatus() {
|
void CInputManager::recheckIdleInhibitorStatus() {
|
||||||
|
|
||||||
for (auto& ii : m_vIdleInhibitors) {
|
for (auto& ii : m_vIdleInhibitors) {
|
||||||
if (ii->inert)
|
if (ii->nonDesktop) {
|
||||||
continue;
|
PROTO::idle->setInhibit(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto WLSurface = CWLSurface::surfaceFromWlr(ii->inhibitor->surface);
|
auto WLSurface = CWLSurface::surfaceFromWlr(ii->inhibitor->surface);
|
||||||
|
|
||||||
|
@@ -242,7 +242,7 @@ class CInputManager {
|
|||||||
// idle inhibitors
|
// idle inhibitors
|
||||||
struct SIdleInhibitor {
|
struct SIdleInhibitor {
|
||||||
std::shared_ptr<CIdleInhibitor> inhibitor;
|
std::shared_ptr<CIdleInhibitor> inhibitor;
|
||||||
bool inert = false;
|
bool nonDesktop = false;
|
||||||
CHyprSignalListener surfaceDestroyListener;
|
CHyprSignalListener surfaceDestroyListener;
|
||||||
};
|
};
|
||||||
std::vector<std::unique_ptr<SIdleInhibitor>> m_vIdleInhibitors;
|
std::vector<std::unique_ptr<SIdleInhibitor>> m_vIdleInhibitors;
|
||||||
|
Reference in New Issue
Block a user