Codebase list audacity / debian/2.0.6-2
Apply four wxWidgets related patches * Workaround for wx bug causing layout problems in recovery dialog. * Fix effect dialog segfault due to events before initialization and add workaround for wxWidgets bug "Reentry in clipboard". (Closes: #765341) * Fix cursor recapturing in track panel sliders. (Closes: #765779) Benjamin Drung 9 years ago
6 changed file(s) with 224 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 audacity (2.0.6-2) unstable; urgency=medium
1
2 [ Martin Steghöfer ]
3 * Workaround for wx bug causing layout problems in recovery dialog.
4 * Fix effect dialog segfault due to events before initialization and
5 add workaround for wxWidgets bug "Reentry in clipboard". (Closes: #765341)
6 * Fix cursor recapturing in track panel sliders. (Closes: #765779)
7
8 -- Benjamin Drung <bdrung@debian.org> Sat, 25 Oct 2014 23:42:05 +0200
9
010 audacity (2.0.6-1) unstable; urgency=medium
111
212 * New upstream release.
0 Description: Fix cursor recapturing in track panel sliders
1 wxWidgets 3.0 has added a lot of asserts to detect incorrect usage
2 of its APIs. Now capturing the cursor, when it's already captured,
3 throughs an assertion failure. This can be the case in the track
4 panel sliders because the sliders capture the cursor themselves
5 (because they are also used in other places outside the track panel,
6 where this is actually necessary), but the track panel also manages
7 the cursor capturing because it needs it for other operations.
8 Fix the recapturing problem by letting the sliders capture the cursor
9 only if necessary.
10 Author: Martin Steghöfer <martin@steghoefer.eu>
11 Bug-Debian: https://bugs.debian.org/765779
12
13 --- a/src/widgets/ASlider.cpp
14 +++ b/src/widgets/ASlider.cpp
15 @@ -1070,7 +1070,9 @@ void LWSlider::OnMouseEvent(wxMouseEvent & event)
16 event.ShiftDown());
17 }
18
19 - mParent->CaptureMouse();
20 + if (!mParent->HasCapture()) {
21 + mParent->CaptureMouse();
22 + }
23 // wxSetCursor(wxCURSOR_BLANK);
24 ((TipPanel*)LWSlider::sharedTipPanel)->SetTargetParent(mParent);
25 FormatPopWin();
00 fix-minsrc-autoreconf.patch
11 wxWidgets-3.0.patch
22 clang-ftbfs.patch
3 fix-cursor-recapturing-sliders.patch
4 workaround-wxwidgets-fit-recovery.patch
5 wxwidgets-clipboard-reentry-workaround.patch
6 wxwidgets-effect-dialogs-segfault.patch
0 Description: Workaround for wx bug causing layout problems in recovery dialog
1 Workaround for a bug in wxWidgets 3.0 that causes the Fit()
2 function to fail in certain desktop environments (gnome, xfce)
3 before the first window of the same style class is shown on
4 screen (http://trac.wxwidgets.org/ticket/16440). As a workaround,
5 call Fit() and other methods that depend on its results again
6 *after* we know that the window has been shown. While the bug
7 may affect other calls to Fit() on a low level, the workaround
8 is necessary only for the recovery dialog, which is particularly
9 vulnerable because:
10 1. It is shown very, very early in the program execution and
11 therefore very likely to be the first dialog of its style class
12 shown on screen.
13 2. It doesn't have scrollbars or flexible-size controls that
14 could compensate the wrong dialog size.
15 Author: Martin Steghöfer <martin@steghoefer.eu>
16 Forwarded: lllucius@gmail.com, 2014-10-20
17 Bug-Debian: http://bugs.debian.org/765341
18
19 --- a/src/AutoRecovery.cpp
20 +++ b/src/AutoRecovery.cpp
21 @@ -38,6 +38,10 @@
22 public:
23 AutoRecoveryDialog(wxWindow *parent);
24
25 +#if defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0)
26 + void OnShow(wxShowEvent & event);
27 +#endif
28 +
29 private:
30 void PopulateList();
31 void PopulateOrExchange(ShuttleGui & S);
32 @@ -65,6 +69,9 @@
33 EVT_BUTTON(ID_RECOVER_ALL, AutoRecoveryDialog::OnRecoverAll)
34 EVT_BUTTON(ID_RECOVER_NONE, AutoRecoveryDialog::OnRecoverNone)
35 EVT_BUTTON(ID_QUIT_AUDACITY, AutoRecoveryDialog::OnQuitAudacity)
36 +#if defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0)
37 + EVT_SHOW(AutoRecoveryDialog::OnShow)
38 +#endif
39 END_EVENT_TABLE()
40
41 void AutoRecoveryDialog::PopulateOrExchange(ShuttleGui& S)
42 @@ -102,6 +109,22 @@
43 Center();
44 }
45
46 +#if defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0)
47 +void AutoRecoveryDialog::OnShow(wxShowEvent & event)
48 +{
49 + // Workaround for wxWidgets bug #16440:
50 + // http://trac.wxwidgets.org/ticket/16440
51 + // Fit() doesn't work correctly in some desktop environments
52 + // with GTK. But it does work after the first window of the
53 + // same style class has been shown on screen. So re-execute
54 + // Fit() and other methods that depend on its result AFTER
55 + // we know that the window has been shown.
56 + Fit();
57 + SetMinSize(GetSize());
58 + Center();
59 +}
60 +#endif
61 +
62 void AutoRecoveryDialog::PopulateList()
63 {
64 mFileList->DeleteAllItems();
0 Description: Workaround for wxWidgets bug: Reentry in clipboard
1 The wxWidgets bug http://trac.wxwidgets.org/ticket/16636 prevents
2 us from doing clipboard operations in wxShowEvent and wxTimerEvent
3 processing because those event could possibly be processed during
4 the (not sufficiently protected) Yield() of a first clipboard
5 operation, causing reentry. Audacity had a workaround in place
6 for this problem (the class "CaptureEvents"), which however isn't
7 applicable with wxWidgets 3.0 because it's based on changing the
8 gdk event handler, a change that would be overridden by wxWidgets's
9 own gdk event handler change.
10 Instead, as a new workaround, specifically protect those processings
11 of wxShowEvent and wxTimerEvent that try to do clipboard operations
12 from being executed within Yield(). This is done by delaying their
13 execution by posting pure wxWidgets events - which are never executed
14 during Yield().
15 Author: Martin Steghöfer <martin@steghoefer.eu>
16 Bug-Debian: https://bugs.debian.org/765341
17
18 --- a/src/Project.cpp
19 +++ b/src/Project.cpp
20 @@ -1625,9 +1625,13 @@
21
22 // Call "OnSize" again (the previous calls to "OnSize" might not
23 // have succeeded because some methods are not available before
24 - // the actual creation/showing of the window)
25 - wxSizeEvent sizeEvent(GetSize());
26 - OnSize(sizeEvent);
27 + // the actual creation/showing of the window).
28 + // Post the event instead of calling OnSize(..) directly. This ensures that
29 + // this is a pure wxWidgets event (no GDK event behind it) and that it
30 + // therefore isn't processed within the YieldFor(..) of the clipboard
31 + // operations (workaround for Debian bug #765341).
32 + wxSizeEvent *sizeEvent = new wxSizeEvent(GetSize());
33 + GetEventHandler()->QueueEvent(sizeEvent);
34
35 // Further processing by default handlers
36 event.Skip();
37 --- a/src/TrackPanel.cpp
38 +++ b/src/TrackPanel.cpp
39 @@ -360,6 +360,8 @@
40 EVT_MENU(OnTimeTrackLinID, TrackPanel::OnTimeTrackLin)
41 EVT_MENU(OnTimeTrackLogID, TrackPanel::OnTimeTrackLog)
42 EVT_MENU(OnTimeTrackLogIntID, TrackPanel::OnTimeTrackLogInt)
43 +
44 + EVT_TIMER(wxID_ANY, TrackPanel::OnTimer)
45 END_EVENT_TABLE()
46
47 /// Makes a cursor from an XPM, uses CursorId as a fallback.
48 @@ -927,7 +929,7 @@
49 }
50
51 /// AS: This gets called on our wx timer events.
52 -void TrackPanel::OnTimer()
53 +void TrackPanel::OnTimer(wxTimerEvent& event)
54 {
55 mTimeCount++;
56 // AS: If the user is dragging the mouse and there is a track that
57 --- a/src/TrackPanel.h
58 +++ b/src/TrackPanel.h
59 @@ -207,7 +207,7 @@
60
61 virtual double GetMostRecentXPos();
62
63 - virtual void OnTimer();
64 + virtual void OnTimer(wxTimerEvent& event);
65
66 virtual int GetLeftOffset() const { return GetLabelWidth() + 1;}
67
68 @@ -541,7 +541,15 @@
69
70 class AUDACITY_DLL_API AudacityTimer:public wxTimer {
71 public:
72 - virtual void Notify() { parent->OnTimer(); }
73 + virtual void Notify() {
74 + // Don't call parent->OnTimer(..) directly here, but instead post
75 + // an event. This ensures that this is a pure wxWidgets event
76 + // (no GDK event behind it) and that it therefore isn't processed
77 + // within the YieldFor(..) of the clipboard operations (workaround
78 + // for Debian bug #765341).
79 + wxTimerEvent *event = new wxTimerEvent(*this);
80 + parent->GetEventHandler()->QueueEvent(event);
81 + }
82 TrackPanel *parent;
83 } mTimer;
84
0 Description: Fix effect dialog segfault due to events before initialization
1 Both the LV2EffectDialog and the VampEffectDialog receive EVT_TEXT events
2 before they are properly initialized. To prevent this, a workaround was
3 already in place, but was only active on Windows. Activated the workaround
4 for wxGTK with wxWidgets >= 3.0, too.
5 Author: Martin Steghöfer <martin@steghoefer.eu>
6 Bug-Debian: http://bugs.debian.org/765341
7
8 --- audacity-2.0.6.orig/src/effects/lv2/LV2Effect.cpp
9 +++ audacity-2.0.6/src/effects/lv2/LV2Effect.cpp
10 @@ -913,8 +913,8 @@ LV2EffectDialog::LV2EffectDialog(LV2Effe
11 mLength(length)
12 {
13
14 -#if defined(__WXMSW__)
15 - // On Windows, for some reason, wxWindows calls OnTextCtrl during creation
16 +#if defined(__WXMSW__) || (defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0))
17 + // On Windows and GTK (with wx3.0), wxWidgets calls OnTextCtrl during creation
18 // of the text control, and LV2EffectDialog::OnTextCtrl calls HandleText,
19 // which assumes all the mFields have been initialized.
20 // This can give us a bad pointer crash, so manipulate inSlider to
21 --- audacity-2.0.6.orig/src/effects/vamp/VampEffect.cpp
22 +++ audacity-2.0.6/src/effects/vamp/VampEffect.cpp
23 @@ -333,8 +333,8 @@ VampEffectDialog::VampEffectDialog(VampE
24
25 mParameters = plugin->getParameterDescriptors();
26
27 -#ifdef __WXMSW__
28 - // On Windows, for some reason, wxWidgets calls OnTextCtrl during creation
29 +#if defined(__WXMSW__) || (defined(__WXGTK__) && wxCHECK_VERSION(3, 0, 0))
30 + // On Windows and GTK (with wx3.0), wxWidgets calls OnTextCtrl during creation
31 // of the text control, and VampEffectDialog::OnTextCtrl calls HandleText,
32 // which assumes all the fields have been initialized.
33 // This can give us a bad pointer crash, so manipulate inSlider to