Skip to content

state: Don't animate when force-hidden

dcz requested to merge dcz/squeekboard:hide into master

Steps to reproduce:

  1. Focus an input field (yad --entry)
  2. Force hide panel with dbus
  3. Focus no input field

Actual result: panel blinks

Expected: Panel stays hidden

The reason this was glitched is that defocusing clears the temporary "force hide" flag, and hiding is animated based on defocus time.

The fix is to lie about the defocus time and push it way into the past, where the animation was already played.

An alternative fix without lying would be to remember the time of clearing the force hide, and suppressing animations if the clear time was recent enough. That's more complicated though, and the focus time is only stored for animation in the first place. Alternative fix: explicit "inactive since forever" state, but that would add extra branches in state management for little benefit.

Merge request reports