intellihide: enable/disable unredirect when dock shows/hides #2149
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.
This PR tries to workaround #1381 by explicitly disabling unredirection when dock shows (
_animateIn
), and restoring (_animateOut
) when it hides in intellihide mode.Although there have been extensions disabling unredirection when they are enabled to workaround the glitch, users might still find their dock flickering after:
(This looks like a bug in gnome-shell, but I could not find a reliable way to trigger this.)
In mutter (src/compositor/compositor.c),
{disable,enable}_unredirect_for_display
controls the counterdisable_unredirect_count
, and it is used to control whether the compositor is "unredirect inhibited" or not. A similar counter is used here, and is intended to avoid unexpected unredirect enablement. Also note that it is impossible for extensions to know whether unredirection is disabled or not, as this counter is private.I was worrying about manually disabling/enabling unredirection might affect performance before, but it looks like
Meta.{disable,enable}_unredirect_for_display
is also used for many components in gnome-shell JavaScript code, so this might not be an issue.I have tested this for ~2 weeks on my laptop (with no other extensions controlling unredirection) and it works without glitches. This might still need more tests, and the code in patch might not be optimal.