Skip to content

fix(tabs): refresh tab highlight on monitor focus change#298

Open
sim590 wants to merge 1 commit into
outfoxxed:masterfrom
sim590:fix/focusmonitor-tab-highlight
Open

fix(tabs): refresh tab highlight on monitor focus change#298
sim590 wants to merge 1 commit into
outfoxxed:masterfrom
sim590:fix/focusmonitor-tab-highlight

Conversation

@sim590

@sim590 sim590 commented Apr 27, 2026

Copy link
Copy Markdown

Summary

  • Fix tab bar active highlight not updating when switching monitors with focusmonitor or hy3:movefocus monitor:
  • When switching away from a monitor, the active tab kept its highlight; when switching back, the highlight was lost until manually moving focus with movefocus

Root cause

Desktop::focusState()->monitor() is not yet updated when tab bars are recalculated during a monitor focus change. This caused active_monitor to be computed against the stale (previous) monitor value, producing inverted highlight behavior.

Fix

  • Track the focused monitor internally via g_focusedMonitor, updated from the monitor.focused event
  • Use g_focusedMonitor instead of Desktop::focusState()->monitor() in updateNodeList() to compute active_monitor
  • Trigger updateDecos() on all monitors when the focused monitor changes, so both the old and new monitor tab bars refresh correctly

@sim590
sim590 force-pushed the fix/focusmonitor-tab-highlight branch from e874aa7 to a6b7ef5 Compare April 28, 2026 02:20
@sim590

sim590 commented Apr 28, 2026

Copy link
Copy Markdown
Author

Update: Also include special workspaces (scratchpad) in the tab bar refresh loop. Previously, tabs inside a special workspace were not updated on monitor focus change because the listener only iterated over m_activeWorkspace and missed m_activeSpecialWorkspace.

… moniteur

Desktop::focusState()->monitor() n'est pas encore mis à jour au moment
où les barres d'onglets sont recalculées lors d'un changement de
moniteur. On suit maintenant le moniteur focalisé via un état interne
(g_focusedMonitor) mis à jour par l'événement monitor.focused, et on
rafraîchit les barres d'onglets de tous les moniteurs à ce moment.
@sim590
sim590 force-pushed the fix/focusmonitor-tab-highlight branch from a6b7ef5 to 0a3544e Compare May 27, 2026 18:33
@sim590
sim590 changed the base branch from 0.54 to master May 27, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant