diff --git a/src/Compositor.cpp b/src/Compositor.cpp index 66306888..f67cf809 100644 --- a/src/Compositor.cpp +++ b/src/Compositor.cpp @@ -1741,10 +1741,10 @@ void CCompositor::updateWindowAnimatedDecorationValues(CWindow* pWindow) { static auto* const INACTIVECOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("general:col.inactive_border")->data.get(); static auto* const NOGROUPACTIVECOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("general:col.nogroup_border_active")->data.get(); static auto* const NOGROUPINACTIVECOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("general:col.nogroup_border")->data.get(); - static auto* const GROUPACTIVECOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("general:col.group_border_active")->data.get(); - static auto* const GROUPINACTIVECOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("general:col.group_border")->data.get(); - static auto* const GROUPACTIVELOCKEDCOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("general:col.group_border_locked_active")->data.get(); - static auto* const GROUPINACTIVELOCKEDCOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("general:col.group_border_locked")->data.get(); + static auto* const GROUPINACTIVECOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("group:col.border")->data.get(); + static auto* const GROUPACTIVECOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("group:col.border_active")->data.get(); + static auto* const GROUPINACTIVELOCKEDCOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("group:col.border_locked")->data.get(); + static auto* const GROUPACTIVELOCKEDCOL = (CGradientValueData*)g_pConfigManager->getConfigValuePtr("group:col.border_locked_active")->data.get(); static auto* const PINACTIVEALPHA = &g_pConfigManager->getConfigValuePtr("decoration:inactive_opacity")->floatValue; static auto* const PACTIVEALPHA = &g_pConfigManager->getConfigValuePtr("decoration:active_opacity")->floatValue; static auto* const PFULLSCREENALPHA = &g_pConfigManager->getConfigValuePtr("decoration:fullscreen_opacity")->floatValue; diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index b675f6ea..8015e68e 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -15,14 +15,14 @@ extern "C" char** environ; CConfigManager::CConfigManager() { - configValues["general:col.active_border"].data = std::make_shared(0xffffffff); - configValues["general:col.inactive_border"].data = std::make_shared(0xff444444); - configValues["general:col.nogroup_border"].data = std::make_shared(0xffffaaff); - configValues["general:col.nogroup_border_active"].data = std::make_shared(0xffff00ff); - configValues["general:col.group_border"].data = std::make_shared(0x66777700); - configValues["general:col.group_border_active"].data = std::make_shared(0x66ffff00); - configValues["general:col.group_border_locked"].data = std::make_shared(0x66775500); - configValues["general:col.group_border_locked_active"].data = std::make_shared(0x66ff5500); + configValues["general:col.active_border"].data = std::make_shared(0xffffffff); + configValues["general:col.inactive_border"].data = std::make_shared(0xff444444); + configValues["general:col.nogroup_border"].data = std::make_shared(0xffffaaff); + configValues["general:col.nogroup_border_active"].data = std::make_shared(0xffff00ff); + configValues["group:col.border"].data = std::make_shared(0x66777700); + configValues["group:col.border_active"].data = std::make_shared(0x66ffff00); + configValues["group:col.border_locked"].data = std::make_shared(0x66775500); + configValues["group:col.border_locked_active"].data = std::make_shared(0x66ff5500); setDefaultVars(); setDefaultAnimationVars(); @@ -76,10 +76,6 @@ void CConfigManager::setDefaultVars() { ((CGradientValueData*)configValues["general:col.inactive_border"].data.get())->reset(0xff444444); ((CGradientValueData*)configValues["general:col.nogroup_border"].data.get())->reset(0xff444444); ((CGradientValueData*)configValues["general:col.nogroup_border_active"].data.get())->reset(0xffff00ff); - ((CGradientValueData*)configValues["general:col.group_border"].data.get())->reset(0x66777700); - ((CGradientValueData*)configValues["general:col.group_border_active"].data.get())->reset(0x66ffff00); - ((CGradientValueData*)configValues["general:col.group_border_locked"].data.get())->reset(0x66775500); - ((CGradientValueData*)configValues["general:col.group_border_locked_active"].data.get())->reset(0x66ff5500); configValues["general:cursor_inactive_timeout"].intValue = 0; configValues["general:no_cursor_warps"].intValue = 0; configValues["general:no_focus_fallback"].intValue = 0; @@ -114,17 +110,23 @@ void CConfigManager::setDefaultVars() { configValues["misc:cursor_zoom_factor"].floatValue = 1.f; configValues["misc:cursor_zoom_rigid"].intValue = 0; configValues["misc:allow_session_lock_restore"].intValue = 0; - configValues["misc:groupbar_scrolling"].intValue = 1; - configValues["misc:group_insert_after_current"].intValue = 1; - configValues["misc:group_focus_removed_window"].intValue = 1; - configValues["misc:render_titles_in_groupbar"].intValue = 1; - configValues["misc:groupbar_titles_font_size"].intValue = 8; - configValues["misc:groupbar_gradients"].intValue = 1; configValues["misc:close_special_on_empty"].intValue = 1; - configValues["misc:groupbar_text_color"].intValue = 0xffffffff; configValues["misc:background_color"].intValue = 0xff111111; configValues["misc:new_window_takes_over_fullscreen"].intValue = 0; + ((CGradientValueData*)configValues["group:col.border"].data.get())->reset(0x66777700); + ((CGradientValueData*)configValues["group:col.border_active"].data.get())->reset(0x66ffff00); + ((CGradientValueData*)configValues["group:col.border_locked"].data.get())->reset(0x66775500); + ((CGradientValueData*)configValues["group:col.border_locked_active"].data.get())->reset(0x66ff5500); + configValues["group:insert_after_current"].intValue = 1; + configValues["group:focus_removed_window"].intValue = 1; + + configValues["group:groupbar:gradients"].intValue = 1; + configValues["group:groupbar:render_titles"].intValue = 1; + configValues["group:groupbar:scrolling"].intValue = 1; + configValues["group:groupbar:text_color"].intValue = 0xffffffff; + configValues["group:groupbar:titles_font_size"].intValue = 8; + configValues["debug:int"].intValue = 0; configValues["debug:log_damage"].intValue = 0; configValues["debug:overlay"].intValue = 0; diff --git a/src/managers/KeybindManager.cpp b/src/managers/KeybindManager.cpp index 1a7ebafc..436654fb 100644 --- a/src/managers/KeybindManager.cpp +++ b/src/managers/KeybindManager.cpp @@ -1975,8 +1975,7 @@ void CKeybindManager::moveWindowIntoGroup(CWindow* pWindow, CWindow* pWindowInDi } void CKeybindManager::moveWindowOutOfGroup(CWindow* pWindow, const std::string& dir) { - - static auto* const BFOCUSREMOVEDWINDOW = &g_pConfigManager->getConfigValuePtr("misc:group_focus_removed_window")->intValue; + static auto* const BFOCUSREMOVEDWINDOW = &g_pConfigManager->getConfigValuePtr("group:focus_removed_window")->intValue; const auto PWINDOWPREV = pWindow->getGroupPrevious(); eDirection direction; @@ -2037,6 +2036,20 @@ void CKeybindManager::moveIntoGroup(std::string args) { return; moveWindowIntoGroup(PWINDOW, PWINDOWINDIR); + + if (!PWINDOW->m_sGroupData.pNextWindow) + PWINDOW->m_dWindowDecorations.emplace_back(std::make_unique(PWINDOW)); + + g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW); // This removes groupped property! + + static const auto* USECURRPOS = &g_pConfigManager->getConfigValuePtr("group:insert_after_current")->intValue; + PWINDOWINDIR = *USECURRPOS ? PWINDOWINDIR : PWINDOWINDIR->getGroupTail(); + + PWINDOWINDIR->insertWindowToGroup(PWINDOW); + PWINDOWINDIR->setGroupCurrent(PWINDOW); + PWINDOW->updateWindowDecos(); + g_pLayoutManager->getCurrentLayout()->recalculateWindow(PWINDOW); + g_pCompositor->focusWindow(PWINDOW); } void CKeybindManager::moveOutOfGroup(std::string args) { diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index 1b89f8fc..f79278e3 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -621,7 +621,7 @@ void CInputManager::processMouseDownKill(wlr_pointer_button_event* e) { void CInputManager::onMouseWheel(wlr_pointer_axis_event* e) { static auto* const PSCROLLFACTOR = &g_pConfigManager->getConfigValuePtr("input:touchpad:scroll_factor")->floatValue; - static auto* const PGROUPBARSCROLLING = &g_pConfigManager->getConfigValuePtr("misc:groupbar_scrolling")->intValue; + static auto* const PGROUPBARSCROLLING = &g_pConfigManager->getConfigValuePtr("group:groupbar:scrolling")->intValue; auto factor = (*PSCROLLFACTOR <= 0.f || e->source != WLR_AXIS_SOURCE_FINGER ? 1.f : *PSCROLLFACTOR); diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 70d4ed93..980b2660 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -34,8 +34,8 @@ void CHyprGroupBarDecoration::updateWindow(CWindow* pWindow) { const auto WORKSPACEOFFSET = PWORKSPACE && !pWindow->m_bPinned ? PWORKSPACE->m_vRenderOffset.vec() : Vector2D(); - static auto* const PRENDERTITLES = &g_pConfigManager->getConfigValuePtr("misc:render_titles_in_groupbar")->intValue; - static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("misc:groupbar_titles_font_size")->intValue; + static auto* const PRENDERTITLES = &g_pConfigManager->getConfigValuePtr("group:groupbar:render_titles")->intValue; + static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("group:groupbar:titles_font_size")->intValue; if (pWindow->m_vRealPosition.vec() + WORKSPACEOFFSET != m_vLastWindowPos || pWindow->m_vRealSize.vec() != m_vLastWindowSize) { // we draw 3px above the window's border with 3px @@ -84,9 +84,9 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& // get how many bars we will draw int barsToDraw = m_dwGroupMembers.size(); - static auto* const PRENDERTITLES = &g_pConfigManager->getConfigValuePtr("misc:render_titles_in_groupbar")->intValue; - static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("misc:groupbar_titles_font_size")->intValue; - static auto* const PGRADIENTS = &g_pConfigManager->getConfigValuePtr("misc:groupbar_gradients")->intValue; + static auto* const PRENDERTITLES = &g_pConfigManager->getConfigValuePtr("group:groupbar:render_titles")->intValue; + static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("group:groupbar:titles_font_size")->intValue; + static auto* const PGRADIENTS = &g_pConfigManager->getConfigValuePtr("group:groupbar:gradients")->intValue; const int BORDERSIZE = m_pWindow->getRealBorderSize(); @@ -108,10 +108,10 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& scaleBox(&rect, pMonitor->scale); - static auto* const PGROUPCOLACTIVE = &g_pConfigManager->getConfigValuePtr("general:col.group_border_active")->data; - static auto* const PGROUPCOLINACTIVE = &g_pConfigManager->getConfigValuePtr("general:col.group_border")->data; - static auto* const PGROUPCOLACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("general:col.group_border_locked_active")->data; - static auto* const PGROUPCOLINACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("general:col.group_border_locked")->data; + static auto* const PGROUPCOLINACTIVE = &g_pConfigManager->getConfigValuePtr("group:col.border")->data; + static auto* const PGROUPCOLACTIVE = &g_pConfigManager->getConfigValuePtr("group:col.border_active")->data; + static auto* const PGROUPCOLINACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("group:col.border_locked")->data; + static auto* const PGROUPCOLACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("group:col.border_locked_active")->data; const bool GROUPLOCKED = m_pWindow->getGroupHead()->m_sGroupData.locked; const auto* const PCOLACTIVE = GROUPLOCKED ? PGROUPCOLACTIVELOCKED : PGROUPCOLACTIVE; @@ -156,8 +156,8 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& } SWindowDecorationExtents CHyprGroupBarDecoration::getWindowDecorationReservedArea() { - static auto* const PRENDERTITLES = &g_pConfigManager->getConfigValuePtr("misc:render_titles_in_groupbar")->intValue; - static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("misc:groupbar_titles_font_size")->intValue; + static auto* const PRENDERTITLES = &g_pConfigManager->getConfigValuePtr("group:groupbar:render_titles")->intValue; + static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("group:groupbar:titles_font_size")->intValue; return SWindowDecorationExtents{{0, BAR_INDICATOR_HEIGHT + BAR_PADDING_OUTER_VERT * 2 + (*PRENDERTITLES ? *PTITLEFONTSIZE : 0)}, {}}; } @@ -180,8 +180,8 @@ CTitleTex::CTitleTex(CWindow* pWindow, const Vector2D& bufferSize) { const auto CAIROSURFACE = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, bufferSize.x, bufferSize.y); const auto CAIRO = cairo_create(CAIROSURFACE); - static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("misc:groupbar_titles_font_size")->intValue; - static auto* const PTEXTCOLOR = &g_pConfigManager->getConfigValuePtr("misc:groupbar_text_color")->intValue; + static auto* const PTITLEFONTSIZE = &g_pConfigManager->getConfigValuePtr("group:groupbar:titles_font_size")->intValue; + static auto* const PTEXTCOLOR = &g_pConfigManager->getConfigValuePtr("group:groupbar:text_color")->intValue; const CColor COLOR = CColor(*PTEXTCOLOR); @@ -289,10 +289,10 @@ void CHyprGroupBarDecoration::refreshGradients() { if (m_tGradientActive.m_iTexID > 0) return; - static auto* const PGROUPCOLACTIVE = &g_pConfigManager->getConfigValuePtr("general:col.group_border_active")->data; - static auto* const PGROUPCOLINACTIVE = &g_pConfigManager->getConfigValuePtr("general:col.group_border")->data; - static auto* const PGROUPCOLACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("general:col.group_border_locked_active")->data; - static auto* const PGROUPCOLINACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("general:col.group_border_locked")->data; + static auto* const PGROUPCOLINACTIVE = &g_pConfigManager->getConfigValuePtr("group:col.border")->data; + static auto* const PGROUPCOLACTIVE = &g_pConfigManager->getConfigValuePtr("group:col.border_active")->data; + static auto* const PGROUPCOLINACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("group:col.border_locked")->data; + static auto* const PGROUPCOLACTIVELOCKED = &g_pConfigManager->getConfigValuePtr("group:col.border_locked_active")->data; const bool GROUPLOCKED = m_pWindow->getGroupHead()->m_sGroupData.locked; const auto* const PCOLACTIVE = GROUPLOCKED ? PGROUPCOLACTIVELOCKED : PGROUPCOLACTIVE;