Skip to content

Commit

Permalink
Work around crash in wxStyledTextCtrl under Mac
Browse files Browse the repository at this point in the history
When not using double buffering, double-clicking to select text in the
control results in crashes.

Avoid this by using double-buffering under Mac, even though it shouldn't
be necessary.

This reverts the changes of cb79948
under Mac.

See wxWidgets#18085.
  • Loading branch information
mtangoo authored and vadz committed Feb 18, 2018
1 parent cad824d commit bf41832
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/stc/stc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ bool wxStyledTextCtrl::Create(wxWindow *parent,
// STC doesn't support RTL languages at all
SetLayoutDirection(wxLayout_LeftToRight);

// Rely on native double buffering by default.
#if wxALWAYS_NATIVE_DOUBLE_BUFFER
// Rely on native double buffering by default, except under Mac where it
// doesn't work for some reason, see #18085.
#if wxALWAYS_NATIVE_DOUBLE_BUFFER && !defined(__WXMAC__)
SetBufferedDraw(false);
#else
SetBufferedDraw(true);
Expand Down

0 comments on commit bf41832

Please sign in to comment.