windowrules: add noclosefor

fixes #10027
This commit is contained in:
Vaxry 2025-04-29 18:14:02 +01:00
parent 5bd7ff884d
commit b10a43dabc
No known key found for this signature in database
GPG key ID: 665806380871D640
6 changed files with 23 additions and 6 deletions

View file

@ -1037,6 +1037,9 @@ SDispatchResult CKeybindManager::killActive(std::string args) {
}
SDispatchResult CKeybindManager::closeActive(std::string args) {
if (g_pCompositor->m_lastWindow && g_pCompositor->m_lastWindow->m_closeableSince > Time::steadyNow())
return {.success = false, .error = "can't close window, it's not closeable yet (noclosefor)"};
g_pCompositor->closeWindow(g_pCompositor->m_lastWindow.lock());
return {};
@ -1050,6 +1053,9 @@ SDispatchResult CKeybindManager::closeWindow(std::string args) {
return {.success = false, .error = "closeWindow: no window found"};
}
if (PWINDOW->m_closeableSince > Time::steadyNow())
return {.success = false, .error = "can't close window, it's not closeable yet (noclosefor)"};
g_pCompositor->closeWindow(PWINDOW);
return {};