fix toggle floating regression, closes #492
Disclosure
I used an LLM to generate these changes. I am not familiar with gnome extension programming. Review thoroughly.
Test plan
I've been using this patch on multiple machines for the last week and have experienced no adverse behavior. The patch works as intended.
LLM PR Description
The bug was introduced in commit 8ad9c9b (PR 484) when refactoring to fix dangling pointers. The refactoring changed addFloatOverride() and removeFloatOverride() to work with fresh data from ConfigManager via currentProps, but forgot to update the local this.windowProps cache.
This caused toggleFloatingMode() to fail because:
- First toggle: addFloatOverride() saves to config but doesn't update cache
- isFloatingExempt() still reads from old cache, doesn't see the new override
- Second toggle: thinks window is still not floating, tries to add again
- addFloatOverride() sees duplicate in fresh config data and returns early
- No visual change occurs because the window state never actually toggles
The fix updates this.windowProps after modifying overrides in both addFloatOverride() and removeFloatOverride() to keep the cache in sync.
Additionally, the early return check in addFloatOverride() was too aggressive and would prevent adding wmId overrides for different windows of the same class. The fix now properly checks wmId when withWmId is true, allowing multiple windows of the same class to have individual wmId overrides.
Fixes: Super+C and Super+Shift+C shortcuts now properly toggle and persist floating window state as intended.
🤖 Generated with Claude Code