@@ -428,6 +428,7 @@ void CHyprBar::renderBarButtons(const Vector2D& bufferSize, const float scale) {
428428 static auto * const PBARBUTTONPADDING = (Hyprlang::INT* const *)HyprlandAPI::getConfigValue (PHANDLE, " plugin:hyprbars:bar_button_padding" )->getDataStaticPtr ();
429429 static auto * const PBARPADDING = (Hyprlang::INT* const *)HyprlandAPI::getConfigValue (PHANDLE, " plugin:hyprbars:bar_padding" )->getDataStaticPtr ();
430430 static auto * const PALIGNBUTTONS = (Hyprlang::STRING const *)HyprlandAPI::getConfigValue (PHANDLE, " plugin:hyprbars:bar_buttons_alignment" )->getDataStaticPtr ();
431+ static auto * const PINACTIVECOLOR = (Hyprlang::INT* const *)HyprlandAPI::getConfigValue (PHANDLE, " plugin:hyprbars:inactive_button_color" )->getDataStaticPtr ();
431432
432433 const bool BUTTONSRIGHT = std::string{*PALIGNBUTTONS} != " left" ;
433434 const auto visibleCount = getVisibleButtonCount (PBARBUTTONPADDING, PBARPADDING, bufferSize, scale);
@@ -449,8 +450,15 @@ void CHyprBar::renderBarButtons(const Vector2D& bufferSize, const float scale) {
449450 const auto scaledButtonsPad = **PBARBUTTONPADDING * scale;
450451
451452 const auto pos = Vector2D{BUTTONSRIGHT ? bufferSize.x - offset - scaledButtonSize / 2.0 : offset + scaledButtonSize / 2.0 , bufferSize.y / 2.0 }.floor ();
453+ auto color = button.bgcol ;
452454
453- cairo_set_source_rgba (CAIRO, button.bgcol .r , button.bgcol .g , button.bgcol .b , button.bgcol .a );
455+ if (**PINACTIVECOLOR > 0 ) {
456+ color = m_bWindowHasFocus ? color : CHyprColor (**PINACTIVECOLOR);
457+ if (button.userfg && button.iconTex ->m_texID != 0 )
458+ button.iconTex ->destroyTexture ();
459+ }
460+
461+ cairo_set_source_rgba (CAIRO, color.r , color.g , color.b , color.a );
454462 cairo_arc (CAIRO, pos.x , pos.y , scaledButtonSize / 2 , 0 , 2 * M_PI);
455463 cairo_fill (CAIRO);
456464
@@ -558,6 +566,15 @@ void CHyprBar::renderPass(PHLMONITOR pMonitor, const float& a) {
558566 static auto * const PENABLETITLE = (Hyprlang::INT* const *)HyprlandAPI::getConfigValue (PHANDLE, " plugin:hyprbars:bar_title_enabled" )->getDataStaticPtr ();
559567 static auto * const PENABLEBLUR = (Hyprlang::INT* const *)HyprlandAPI::getConfigValue (PHANDLE, " plugin:hyprbars:bar_blur" )->getDataStaticPtr ();
560568 static auto * const PENABLEBLURGLOBAL = (Hyprlang::INT* const *)HyprlandAPI::getConfigValue (PHANDLE, " decoration:blur:enabled" )->getDataStaticPtr ();
569+ static auto * const PINACTIVECOLOR = (Hyprlang::INT* const *)HyprlandAPI::getConfigValue (PHANDLE, " plugin:hyprbars:inactive_button_color" )->getDataStaticPtr ();
570+
571+ if (**PINACTIVECOLOR > 0 ) {
572+ bool currentWindowFocus = PWINDOW == g_pCompositor->m_lastWindow .lock ();
573+ if (currentWindowFocus != m_bWindowHasFocus) {
574+ m_bWindowHasFocus = currentWindowFocus;
575+ m_bButtonsDirty = true ;
576+ }
577+ }
561578
562579 const CHyprColor DEST_COLOR = m_bForcedBarColor.value_or (**PCOLOR);
563580 if (DEST_COLOR != m_cRealBarColor->goal ())
0 commit comments