window: make AsyncDialogBoxes not closeable

we don't want the user to accidentally close a popup for permissions or ANR. They can dismiss them by clicking an appropriate option.
This commit is contained in:
Vaxry 2025-04-29 18:20:06 +01:00
parent b10a43dabc
commit 465e3d979d
No known key found for this signature in database
GPG key ID: 665806380871D640
3 changed files with 16 additions and 0 deletions

View file

@ -2,6 +2,7 @@
#include "../Compositor.hpp"
#include "../helpers/WLClasses.hpp"
#include "../helpers/AsyncDialogBox.hpp"
#include "../managers/input/InputManager.hpp"
#include "../managers/TokenManager.hpp"
#include "../managers/SeatManager.hpp"
@ -327,6 +328,11 @@ void Events::listener_mapWindow(void* owner, void* data) {
PWINDOW->applyDynamicRule(r);
}
// make it uncloseable if it's a Hyprland dialog
// TODO: make some closeable?
if (CAsyncDialogBox::isAsyncDialogBox(PWINDOW->getPID()))
PWINDOW->m_closeableSince = Time::steadyNow() + std::chrono::years(10 /* Should be enough, no? */);
// disallow tiled pinned
if (PWINDOW->m_pinned && !PWINDOW->m_isFloating)
PWINDOW->m_pinned = false;