Work around crash in wxStyledTextCtrl under Mac

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 cb799483b7
under Mac.

See #18085.
This commit is contained in:
Stefano D. Mtangoo 2018-02-17 19:10:11 +01:00 committed by Vadim Zeitlin
parent cad824d089
commit bf418320b7

View File

@ -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);