mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-09-16 00:08:26 +00:00
windowrules: add option to allow size persistence between app launches (#9422)
This commit is contained in:
@@ -2954,3 +2954,18 @@ std::string SConfigOptionDescription::jsonify() const {
|
||||
void CConfigManager::ensurePersistentWorkspacesPresent() {
|
||||
g_pCompositor->ensurePersistentWorkspacesPresent(m_vWorkspaceRules);
|
||||
}
|
||||
|
||||
void CConfigManager::storeFloatingSize(PHLWINDOW window, const Vector2D& size) {
|
||||
Debug::log(LOG, "storing floating size {}x{} for window {}::{}", size.x, size.y, window->m_szClass, window->m_szTitle);
|
||||
SFloatCache id{window};
|
||||
m_mStoredFloatingSizes[id] = size;
|
||||
}
|
||||
|
||||
std::optional<Vector2D> CConfigManager::getStoredFloatingSize(PHLWINDOW window) {
|
||||
SFloatCache id{window};
|
||||
if (m_mStoredFloatingSizes.contains(id)) {
|
||||
Debug::log(LOG, "got stored size {}x{} for window {}::{}", m_mStoredFloatingSizes[id].x, m_mStoredFloatingSizes[id].y, window->m_szClass, window->m_szTitle);
|
||||
return m_mStoredFloatingSizes[id];
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
Reference in New Issue
Block a user