layoutmgr: don't reenable layout on unchanged layout

This commit is contained in:
vaxerski 2023-03-03 14:06:01 +00:00
parent 64f35c0e31
commit 51ce3ddd67

View file

@ -12,6 +12,9 @@ IHyprLayout* CLayoutManager::getCurrentLayout() {
void CLayoutManager::switchToLayout(std::string layout) { void CLayoutManager::switchToLayout(std::string layout) {
for (size_t i = 0; i < m_vLayouts.size(); ++i) { for (size_t i = 0; i < m_vLayouts.size(); ++i) {
if (m_vLayouts[i].first == layout) { if (m_vLayouts[i].first == layout) {
if (i == m_iCurrentLayoutID)
return;
getCurrentLayout()->onDisable(); getCurrentLayout()->onDisable();
m_iCurrentLayoutID = i; m_iCurrentLayoutID = i;
getCurrentLayout()->onEnable(); getCurrentLayout()->onEnable();