Enable the StackView's handling of hover events only when it's visible. See the included comment for details. (cherry picked from commit 714d98b0)