#15643 closed defect (fixed)

Animate Effects bug on non-visible windows

Reported by: Chuddah Owned by:
Priority: normal Milestone:
Component: wxMSW Version: 2.9.3-rc1
Keywords: animate infobar shown Cc:
Blocked By: Blocking:
Patch: yes

Description

Win32 only:
Animations on win32 are not behaving correctly when the window is not visible.

The example I have uses a wxInfoBar which animates the message into and out of view. This seems to work as expected when the window is visible.
When the window is hidden (eg. in a non-visible notebook page) the animation\hiding doesn't seem to happen in the MSW components (although the wx object wrapper assumes that it has been).

This causes graphical glitches when viewing the previously hidden window.

The fix is to simply not animate the window if the parent is not visible on the screen.

Attachments (2)

win32_animate_bug_on_non_visible_windows.py download (2.0 KB) - added by Chuddah 14 months ago.
bug example
window_no_effect_if_not_shown.patch download (419 bytes) - added by Chuddah 14 months ago.
patch

Download all attachments as: .zip

Change History (6)

Changed 14 months ago by Chuddah

bug example

Changed 14 months ago by Chuddah

patch

comment:1 follow-up: Changed 14 months ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [75130]) Don't use animations when showing non-visible windows.

This is useless anyhow but also results in artefacts when the window becomes
visible later.

Closes #15643.

comment:2 in reply to: ↑ 1 Changed 14 months ago by Chuddah

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to VZ:

(In [75130]) Don't use animations when showing non-visible windows.

This is useless anyhow but also results in artefacts when the window becomes
visible later.

Closes #15643.

I independently tried 75130 fix firstly but found that it didn't work as expected.

Making an animation occur when the window is visible (ie wxInfoBar::Dismiss()) this works fine as the check (in 75130) IsShownOnScreen is called on the wxInfoBar instance. This will (correctly) return true if the infobar (and its parent) are displayed and false otherwise. This will animate the wxInfoBar into an hidden state.

In the case of showing animating the wxInfoBar IsShownOnScreen is again called on the wxInfoBar instance which will (correctly) return false if its parent window is not visible but (falsely) report false if its parent is show on the screen. This false-positive comes from the fact that the InfoBar is hidden. The wxInfoBar will be shown but will not animate into position.

The fix I have submitted is to check the widget under animations' Parent item for visibility on the screen.
Admittedly, this is a fix concentrating on the wxInfoBar as the test case, whereas 75130 may be concentrating on other animated items. Can you think of any test cases where this is not a generic fix for this problem.

Ta,
Damien

comment:3 Changed 14 months ago by vadz

  • Milestone 2.8.13 deleted

Sorry, I simply misread the patch (I didn't apply it automatically because it wasn't done from the root directory...) and accidentally omitted the GetParent()-> part. Will add it now, thanks for rechecking.

comment:4 Changed 14 months ago by VZ

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [75131]) Correct check for animating non-visible windows added in r75130.

Check whether the parent is not shown instead of checking the window itself
because the window is never shown when we're in process of showing it. We need
to avoid animations in the case when it still won't be shown even after
showing it, and this is achieved by checking its parent visibility.

Closes #15643.

Note: See TracTickets for help on using tickets.