Dear Andoru,

thanks a lot for the bug report! :-)

With the upgrade to 3.0, wxWidgets enforces the correct usage of its API a lot more with asserts. So now, many bugs that were in Audacity before become visible as error messages (which themselves may cause even more undesired behavior, if they pop up in the wrong moment like here).

In this case it complains about capturing a cursor that is already captured. This happens in the track panel sliders because the sliders capture the cursor themselves (because they are also used in other places outside the track panel, where this is actually necessary), but the track panel also manages the cursor capturing because it needs it for other operations.

Fortunately, this has an easy fix: Simply prevent the sliders from capturing the cursor, if it's already captured (see patch attached).

Regarding the small buttons in the recovery window: This is due to a bug in upstream wxWidgets (http://trac.wxwidgets.org/ticket/16440). Unfortunately, my bug report (filed months ago) hasn't received a lot of attention. So we may have to think of a workaround for Audacity. If you want to help, you can compile the example I submitted in the upstream report and confirm the problem there, so at least the status can upgrade from "new" to "confirmed". Maybe that makes it receive a little more attention.

Cheers,
Martin

Description: Fix cursor recapturing in track panel sliders
 wxWidgets 3.0 has added a lot of asserts to detect incorrect usage
 of its APIs. Now capturing the cursor, when it's already captured,
 throughs an assertion failure. This can be the case in the track
 panel sliders because the sliders capture the cursor themselves
 (because they are also used in other places outside the track panel,
 where this is actually necessary), but the track panel also manages
 the cursor capturing because it needs it for other operations.
 Fix the recapturing problem by letting the sliders capture the cursor
 only if necessary.
Author: Martin Steghöfer <mar...@steghoefer.eu>
Bug-Debian: https://bugs.debian.org/

--- a/src/widgets/ASlider.cpp
+++ b/src/widgets/ASlider.cpp
@@ -1070,7 +1070,9 @@ void LWSlider::OnMouseEvent(wxMouseEvent & event)
                event.ShiftDown());
       }
 
-      mParent->CaptureMouse();
+      if (!mParent->HasCapture()) {
+         mParent->CaptureMouse();
+      }
       // wxSetCursor(wxCURSOR_BLANK);
       ((TipPanel*)LWSlider::sharedTipPanel)->SetTargetParent(mParent);
       FormatPopWin();

Reply via email to