mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 11:05:58 +01:00
idle-inhibit: enable idle inhibitor if no hl surface is associated (#5882)
This commit is contained in:
parent
aaf35b9f1f
commit
03ebad3cbf
2 changed files with 7 additions and 5 deletions
|
@ -17,8 +17,8 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
|
|||
auto WLSurface = CWLSurface::surfaceFromWlr(PINHIBIT->inhibitor->surface);
|
||||
|
||||
if (!WLSurface) {
|
||||
Debug::log(LOG, "Inhibitor has no HL Surface attached to it, likely meaning it's a non-desktop element. Ignoring.");
|
||||
PINHIBIT->inert = true;
|
||||
Debug::log(LOG, "Inhibitor has no HL Surface attached to it, likely meaning it's a non-desktop element. Assuming it's visible.");
|
||||
PINHIBIT->nonDesktop = true;
|
||||
recheckIdleInhibitorStatus();
|
||||
return;
|
||||
}
|
||||
|
@ -32,8 +32,10 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
|
|||
void CInputManager::recheckIdleInhibitorStatus() {
|
||||
|
||||
for (auto& ii : m_vIdleInhibitors) {
|
||||
if (ii->inert)
|
||||
continue;
|
||||
if (ii->nonDesktop) {
|
||||
PROTO::idle->setInhibit(true);
|
||||
return;
|
||||
}
|
||||
|
||||
auto WLSurface = CWLSurface::surfaceFromWlr(ii->inhibitor->surface);
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ class CInputManager {
|
|||
// idle inhibitors
|
||||
struct SIdleInhibitor {
|
||||
std::shared_ptr<CIdleInhibitor> inhibitor;
|
||||
bool inert = false;
|
||||
bool nonDesktop = false;
|
||||
CHyprSignalListener surfaceDestroyListener;
|
||||
};
|
||||
std::vector<std::unique_ptr<SIdleInhibitor>> m_vIdleInhibitors;
|
||||
|
|
Loading…
Reference in a new issue