fix toggle floating regression, closes #492 #496
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Disclosure
I am not familiar with gnome extension programming an used an LLM to generate these changes. Please 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.
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:
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.