parent
5bd7ff884d
commit
b10a43dabc
6 changed files with 23 additions and 6 deletions
|
|
@ -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 {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue