From 8c1085d6bd64ed1e7e35c64bf4bb8518b1db5573 Mon Sep 17 00:00:00 2001 From: Mihir Lad Date: Fri, 24 Jul 2020 00:53:41 -0400 Subject: [PATCH] dwm: Only find secondary_layout if m_layout_click Secondary layout would not be used otherwise. --- src/modules/dwm.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/dwm.cpp b/src/modules/dwm.cpp index cad69c88..ba77b3f6 100644 --- a/src/modules/dwm.cpp +++ b/src/modules/dwm.cpp @@ -101,10 +101,13 @@ namespace modules { // First layout is treated as default by dwm m_default_layout = &m_layouts->at(0); m_current_layout = find_layout(m_bar_mon->layout.address.cur); - m_secondary_layout = find_layout(m_secondary_layout_symbol); - if (m_secondary_layout == nullptr) { - throw module_error("Secondary layout symbol does not exist"); + if (m_layout_click) { + m_secondary_layout = find_layout(m_secondary_layout_symbol); + + if (m_secondary_layout == nullptr) { + throw module_error("Secondary layout symbol does not exist"); + } } // Initialize layout symbol