config: fix propRefresher to not run on first launch

This commit is contained in:
Vaxry 2026-05-06 20:55:29 +01:00
parent 336dc6c04e
commit 74ea5dff2c
No known key found for this signature in database
5 changed files with 20 additions and 64 deletions

View file

@ -1013,9 +1013,6 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
g_pCompositor->m_wantsXwayland = PENABLEXWAYLAND;
#endif
if (!m_isFirstLaunch && !g_pCompositor->m_unsafeState)
refreshGroupBarGradients();
// Updates dynamic window and workspace rules
for (auto const& w : g_pCompositor->getWorkspaces()) {
if (w->inert())
@ -1058,14 +1055,8 @@ void CConfigManager::postConfigReload(const Hyprlang::CParseResult& result) {
// update plugins
handlePluginLoads();
// update persistent workspaces
if (!m_isFirstLaunch)
g_pCompositor->ensurePersistentWorkspacesPresent();
// update layouts
Layout::Supplementary::algoMatcher()->updateWorkspaceLayouts();
Config::Supplementary::refresher()->scheduleRefresh(Supplementary::REFRESH_ALL);
Config::Supplementary::refresher()->scheduleRefresh(Supplementary::REFRESH_ALL);
Event::bus()->m_events.config.reloaded.emit();
if (g_pEventManager)

View file

@ -488,16 +488,6 @@ void CConfigManager::postConfigReload() {
w->uncacheWindowDecos();
}
// Update the keyboard layout to the cfg'd one if this is not the first launch
if (!m_isFirstLaunch) {
g_pInputManager->setKeyboardLayout();
g_pInputManager->setPointerConfigs();
g_pInputManager->setTouchDeviceConfigs();
g_pInputManager->setTabletConfigs();
g_pHyprRenderer->m_reloadScreenShader = true;
}
const bool emergencyModeTripped = !m_errors.empty() && g_pKeybindManager->m_keybinds.empty();
if (emergencyModeTripped)
@ -557,18 +547,6 @@ void CConfigManager::postConfigReload() {
g_pCompositor->m_wantsXwayland = *PXWAYLAND;
#endif
if (!m_isFirstLaunch && !g_pCompositor->m_unsafeState)
refreshGroupBarGradients();
for (auto const& w : g_pCompositor->getWorkspaces()) {
if (w->inert())
continue;
w->updateWindows();
w->updateWindowData();
}
g_pCompositor->updateAllWindowsAnimatedDecorationValues();
if (*PMANUALCRASH && !m_manualCrashInitiated) {
m_manualCrashInitiated = true;
Notification::overlay()->addNotification("Manual crash has been set up. Set debug.manual_crash back to 0 in order to crash the compositor.", CHyprColor(0), 5000,
@ -582,28 +560,10 @@ void CConfigManager::postConfigReload() {
if (disableStdout && m_isFirstLaunch)
Log::logger->log(Log::DEBUG, "Disabling stdout logs! Check the log for further logs.");
for (auto const& m : g_pCompositor->m_monitors) {
// mark blur dirty
m->m_blurFBDirty = true;
g_pCompositor->scheduleFrameForMonitor(m);
// Force the compositor to fully re-render all monitors
m->m_forceFullFrames = 2;
// also force mirrors, as the aspect ratio could've changed
for (auto const& mirror : m->m_mirrors)
mirror->m_forceFullFrames = 3;
}
handlePluginLoads();
if (!m_isFirstLaunch)
g_pCompositor->ensurePersistentWorkspacesPresent();
Layout::Supplementary::algoMatcher()->updateWorkspaceLayouts();
Config::Supplementary::refresher()->scheduleRefresh(Supplementary::REFRESH_ALL);
Config::Supplementary::refresher()->scheduleRefresh(Supplementary::REFRESH_ALL);
Event::bus()->m_events.config.reloaded.emit();
if (g_pEventManager)

View file

@ -3,6 +3,7 @@
#include "../../../managers/eventLoop/EventLoopManager.hpp"
#include "../../../managers/input/InputManager.hpp"
#include "../../../render/Renderer.hpp"
#include "../../../render/decorations/CHyprGroupBarDecoration.hpp"
#include "../../../Compositor.hpp"
#include "../../../layout/supplementary/WorkspaceAlgoMatcher.hpp"
#include "../../../layout/LayoutManager.hpp"
@ -96,6 +97,9 @@ void CPropRefresher::scheduleRefresh(PropRefreshBits prop) {
if (m_propsTripped & REFRESH_CONFIG_WATCHER)
Config::watcher()->update();
if (m_propsTripped & REFRESH_GRADIENTS_GROUPBAR)
refreshGroupBarGradients();
m_scheduled = false;
m_propsTripped = 0;
});

View file

@ -7,15 +7,16 @@
namespace Config::Supplementary {
enum ePropRefreshProp : uint16_t {
REFRESH_LAYOUTS = (1 << 0),
REFRESH_INPUT_DEVICES = (1 << 1),
REFRESH_SCREEN_SHADER = (1 << 2),
REFRESH_BLUR_FB = (1 << 3),
REFRESH_RULES = (1 << 4),
REFRESH_WINDOW_STATES = (1 << 5) | REFRESH_RULES,
REFRESH_MONITOR_STATES = (1 << 6) | REFRESH_LAYOUTS,
REFRESH_CURSOR_ZOOMS = (1 << 7),
REFRESH_CONFIG_WATCHER = (1 << 8),
REFRESH_LAYOUTS = (1 << 0),
REFRESH_INPUT_DEVICES = (1 << 1),
REFRESH_SCREEN_SHADER = (1 << 2),
REFRESH_BLUR_FB = (1 << 3),
REFRESH_RULES = (1 << 4),
REFRESH_WINDOW_STATES = (1 << 5) | REFRESH_RULES,
REFRESH_MONITOR_STATES = (1 << 6) | REFRESH_LAYOUTS,
REFRESH_CURSOR_ZOOMS = (1 << 7),
REFRESH_CONFIG_WATCHER = (1 << 8),
REFRESH_GRADIENTS_GROUPBAR = (1 << 9),
REFRESH_ALL = std::numeric_limits<std::underlying_type_t<ePropRefreshProp>>::max(),
};

View file

@ -385,10 +385,10 @@ std::vector<SP<IValue>> Values::getConfigValues() {
MS<Bool>("group:focus_removed_window", "whether Hyprland should focus on the window that has just been moved out of the group", true),
MS<Bool>("group:merge_groups_on_drag", "whether window groups can be dragged into other groups", true),
MS<Bool>("group:merge_groups_on_groupbar", "whether one group will be merged with another when dragged into its groupbar", true),
MS<Gradient>("group:col.border_active", "active group border color", CHyprColor{0x66ffff00}),
MS<Gradient>("group:col.border_inactive", "inactive group border color", CHyprColor{0x66777700}),
MS<Gradient>("group:col.border_locked_inactive", "inactive locked group border color", CHyprColor{0x66ff5500}),
MS<Gradient>("group:col.border_locked_active", "active locked group border color", CHyprColor{0x66775500}),
MS<Gradient>("group:col.border_active", "active group border color", CHyprColor{0x66ffff00}, {.refresh = Supplementary::REFRESH_GRADIENTS_GROUPBAR}),
MS<Gradient>("group:col.border_inactive", "inactive group border color", CHyprColor{0x66777700}, {.refresh = Supplementary::REFRESH_GRADIENTS_GROUPBAR}),
MS<Gradient>("group:col.border_locked_inactive", "inactive locked group border color", CHyprColor{0x66ff5500}, {.refresh = Supplementary::REFRESH_GRADIENTS_GROUPBAR}),
MS<Gradient>("group:col.border_locked_active", "active locked group border color", CHyprColor{0x66775500}, {.refresh = Supplementary::REFRESH_GRADIENTS_GROUPBAR}),
MS<Bool>("group:auto_group", "automatically group new windows", true),
MS<Int>("group:drag_into_group", "whether dragging a window into a unlocked group will merge them.", 1,
{.min = 0, .max = 2, .map = OptionMap{{"disabled", 0}, {"enabled", 1}, {"only when dragging into the groupbar", 2}}}),