summaryrefslogtreecommitdiff
path: root/src/managers/input/IdleInhibitor.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-04-27 12:43:12 +0100
committerGitHub <noreply@github.com>2024-04-27 12:43:12 +0100
commitbca7804bb6e1bf5ce5a99b9ae4806be25e36993c (patch)
treeebd3a578de1dfe11b54f9440cfc3a408ffa6a620 /src/managers/input/IdleInhibitor.cpp
parent25aec3ac8ce65ed224f025f8f6dfef73780577a4 (diff)
internal: Window storage rework - part 1 (#5762)
* Window storage rework - part 1 * format * remove useless include * fix pch * format * fix crash in dwindle * fix vram leak * prefer .expired() for bool checks
Diffstat (limited to 'src/managers/input/IdleInhibitor.cpp')
-rw-r--r--src/managers/input/IdleInhibitor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/managers/input/IdleInhibitor.cpp b/src/managers/input/IdleInhibitor.cpp
index b5e6feb2..6ec5fc81 100644
--- a/src/managers/input/IdleInhibitor.cpp
+++ b/src/managers/input/IdleInhibitor.cpp
@@ -19,7 +19,7 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
PINHIBIT->pWindow = PWINDOW;
PINHIBIT->windowDestroyListener = PWINDOW->events.destroy.registerListener([PINHIBIT](std::any data) {
Debug::log(WARN, "Inhibitor got its window destroyed before its inhibitor resource.");
- PINHIBIT->pWindow = nullptr;
+ PINHIBIT->pWindow.reset();
});
} else
Debug::log(WARN, "Inhibitor is for no window?");
@@ -29,10 +29,10 @@ void CInputManager::newIdleInhibitor(std::any inhibitor) {
void CInputManager::recheckIdleInhibitorStatus() {
for (auto& ii : m_vIdleInhibitors) {
- if (!ii->pWindow) {
+ if (ii->pWindow.expired()) {
g_pCompositor->setIdleActivityInhibit(false);
return;
- } else if (g_pHyprRenderer->shouldRenderWindow(ii->pWindow)) {
+ } else if (g_pHyprRenderer->shouldRenderWindow(ii->pWindow.lock())) {
g_pCompositor->setIdleActivityInhibit(false);
return;
}
@@ -48,7 +48,7 @@ void CInputManager::recheckIdleInhibitorStatus() {
return;
}
- if (w->m_eIdleInhibitMode == IDLEINHIBIT_FOCUS && g_pCompositor->isWindowActive(w.get())) {
+ if (w->m_eIdleInhibitMode == IDLEINHIBIT_FOCUS && g_pCompositor->isWindowActive(w)) {
g_pCompositor->setIdleActivityInhibit(false);
return;
}