diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index a8de70ed9..2268a6b0d 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -104,6 +104,7 @@ DBIPlatform gPlatform = dbipLinux32; QString gPlatformString; QUrl gUpdateURL; bool gIsElCapitan = false; +bool gIsSnowLeopard = false; int gOtherOnline = 0; @@ -195,6 +196,9 @@ void InitFromCommandLine(int argc, char *argv[]) { gIsElCapitan = true; } #else // OS_MAC_OLD + if (QSysInfo::macVersion() < QSysInfo::MV_10_7) { + gIsSnowLeopard = true; + } gPlatform = dbipMacOld; #endif // OS_MAC_OLD #endif // Q_OS_MAC diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index 51dab5e1b..9c024c932 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -248,6 +248,7 @@ DeclareSetting(int32, IntRetinaFactor); DeclareReadSetting(DBIPlatform, Platform); DeclareReadSetting(QString, PlatformString); DeclareReadSetting(bool, IsElCapitan); +DeclareReadSetting(bool, IsSnowLeopard); DeclareReadSetting(QUrl, UpdateURL); DeclareSetting(int, OtherOnline); diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp index 3b655aa02..710277fe2 100644 --- a/Telegram/SourceFiles/ui/text/text.cpp +++ b/Telegram/SourceFiles/ui/text/text.cpp @@ -37,6 +37,15 @@ inline int32 countBlockHeight(const ITextBlock *b, const style::TextStyle *st) { } // namespace +bool chIsBad(QChar ch) { +#ifdef OS_MAC_OLD + if (cIsSnowLeopard() && (ch == 8207 || ch == 8206)) { + return true; + } +#endif // OS_MAC_OLD + return (ch == 0) || (ch >= 8232 && ch < 8237) || (ch >= 65024 && ch < 65040 && ch != 65039) || (ch >= 127 && ch < 160 && ch != 156) || (cPlatform() == dbipMac && ch >= 0x0B00 && ch <= 0x0B7F && chIsDiac(ch) && cIsElCapitan()); // tmp hack see https://bugreports.qt.io/browse/QTBUG-48910 +} + QString textcmdSkipBlock(ushort w, ushort h) { static QString cmd(5, TextCommand); cmd[1] = QChar(TextCommandSkipBlock); diff --git a/Telegram/SourceFiles/ui/text/text.h b/Telegram/SourceFiles/ui/text/text.h index 99d8fb6e5..87a84c226 100644 --- a/Telegram/SourceFiles/ui/text/text.h +++ b/Telegram/SourceFiles/ui/text/text.h @@ -275,9 +275,9 @@ inline bool chIsSpace(QChar ch, bool rich = false) { inline bool chIsDiac(QChar ch) { // diac and variation selectors return (ch.category() == QChar::Mark_NonSpacing) || (ch == 1652) || (ch >= 64606 && ch <= 64611); } -inline bool chIsBad(QChar ch) { - return (ch == 0) || (ch >= 8232 && ch < 8237) || (ch >= 65024 && ch < 65040 && ch != 65039) || (ch >= 127 && ch < 160 && ch != 156) || (cPlatform() == dbipMac && ch >= 0x0B00 && ch <= 0x0B7F && chIsDiac(ch) && cIsElCapitan()); // tmp hack see https://bugreports.qt.io/browse/QTBUG-48910 -} + +bool chIsBad(QChar ch); + inline bool chIsTrimmed(QChar ch, bool rich = false) { return (!rich || ch != TextCommand) && (chIsSpace(ch) || chIsBad(ch)); } diff --git a/Telegram/SourceFiles/ui/twidget.cpp b/Telegram/SourceFiles/ui/twidget.cpp index 8e2eff83e..a78af59dd 100644 --- a/Telegram/SourceFiles/ui/twidget.cpp +++ b/Telegram/SourceFiles/ui/twidget.cpp @@ -133,8 +133,10 @@ void CreateWidgetStateRecursive(not_null target) { if (!target->testAttribute(Qt::WA_WState_Created)) { if (!target->isWindow()) { CreateWidgetStateRecursive(target->parentWidget()); + WidgetCreator::Create(target); + } else if (!cIsSnowLeopard()) { + WidgetCreator::Create(target); } - WidgetCreator::Create(target); } }