diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/MainWindow.cpp | 5 | ||||
-rw-r--r-- | src/MainWindow.h | 3 | ||||
-rw-r--r-- | src/timeline/InputBar.cpp | 10 |
3 files changed, 13 insertions, 5 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index b7834cba..a4a0eff0 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -201,9 +201,14 @@ NhekoFixupPaletteEventFilter::eventFilter(QObject *obj, QEvent *event) // reason?!? if (event->type() == QEvent::ChildAdded && obj->metaObject()->className() == QStringLiteral("QQuickRootItem")) { + QSet<QWindow *> newWindows; for (const auto window : QGuiApplication::topLevelWindows()) { + newWindows.insert(window); + if (m_postedWindows.contains(window)) + continue; QGuiApplication::postEvent(window, new QEvent(QEvent::ApplicationPaletteChange)); } + m_postedWindows.swap(newWindows); } return false; } diff --git a/src/MainWindow.h b/src/MainWindow.h index c493b5b2..928446aa 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -45,6 +45,9 @@ public: } bool eventFilter(QObject *obj, QEvent *event) override; + +private: + QSet<QWindow *> m_postedWindows; }; class MainWindow : public QQuickView diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index bcb30aa0..d37e403f 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -461,11 +461,11 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow text.body = replaceMatrixToMarkdownLink(msg.trimmed()).toStdString(); // Don't send formatted_body, when we don't need to - // Specifically, if it includes no html tag and no newlines (which behave differently in - // formatted bodies). Probably we forgot something, so this might need to expand at some - // point. + // Specifically, if it includes no html tag and no newlines or + // backslashes (which behave differently in formatted bodies). Probably + // we forgot something, so this might need to expand at some point. if (text.formatted_body.find('<') == std::string::npos && - text.body.find('\n') == std::string::npos) + text.body.find('\n') == std::string::npos && text.body.find('\\') == std::string::npos) text.formatted_body = ""; else text.format = "org.matrix.custom.html"; @@ -880,7 +880,7 @@ InputBar::command(const QString &command, QString args) err->matrix_error.error); }); } else if (command == QLatin1String("shrug")) { - message("¯\\_(ツ)_/¯" + (args.isEmpty() ? QLatin1String("") : " " + args)); + message("¯\\\\\\_(ツ)\\_/¯" + (args.isEmpty() ? QLatin1String("") : " " + args)); } else if (command == QLatin1String("fliptable")) { message(QStringLiteral("(╯°□°)╯︵ ┻━┻")); } else if (command == QLatin1String("unfliptable")) { |