mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-05-13 07:10:35 +01:00
windowrules: store floating size on close instead of resize (#9569)
This commit is contained in:
parent
b80b64cd6c
commit
c544c5115c
2 changed files with 7 additions and 5 deletions
|
@ -1327,11 +1327,6 @@ void CWindow::clampWindowSize(const std::optional<Vector2D> minSize, const std::
|
|||
|
||||
*m_vRealPosition = m_vRealPosition->goal() + DELTA / 2.0;
|
||||
*m_vRealSize = NEWSIZE;
|
||||
|
||||
if (m_bIsFloating && !m_bIsX11 && std::any_of(m_vMatchedRules.begin(), m_vMatchedRules.end(), [](const auto& r) { return r->ruleType == CWindowRule::RULE_PERSISTENTSIZE; })) {
|
||||
Debug::log(LOG, "clamped window {}::{} to {}x{} (persistentsize)", m_szClass, m_szTitle, m_vRealSize->value().x, m_vRealSize->value().y);
|
||||
g_pConfigManager->storeFloatingSize(m_pSelf.lock(), m_vRealSize->value());
|
||||
}
|
||||
}
|
||||
|
||||
bool CWindow::isFullscreen() {
|
||||
|
|
|
@ -716,6 +716,13 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
|||
g_pEventManager->postEvent(SHyprIPCEvent{"closewindow", std::format("{:x}", PWINDOW)});
|
||||
EMIT_HOOK_EVENT("closeWindow", PWINDOW);
|
||||
|
||||
if (PWINDOW->m_bIsFloating && !PWINDOW->m_bIsX11 &&
|
||||
std::any_of(PWINDOW->m_vMatchedRules.begin(), PWINDOW->m_vMatchedRules.end(), [](const auto& r) { return r->ruleType == CWindowRule::RULE_PERSISTENTSIZE; })) {
|
||||
Debug::log(LOG, "storing floating size {}x{} for window {}::{} on close", PWINDOW->m_vRealSize->value().x, PWINDOW->m_vRealSize->value().y, PWINDOW->m_szClass,
|
||||
PWINDOW->m_szTitle);
|
||||
g_pConfigManager->storeFloatingSize(PWINDOW, PWINDOW->m_vRealSize->value());
|
||||
}
|
||||
|
||||
PROTO::toplevelExport->onWindowUnmap(PWINDOW);
|
||||
|
||||
if (PWINDOW->isFullscreen())
|
||||
|
|
Loading…
Reference in a new issue