Fixed text insertion from menu bar on macOS when input field is hidden.

This commit is contained in:
23rd 2024-01-25 13:43:30 +03:00 committed by John Preston
parent 0372f2be9c
commit 92f0358800
2 changed files with 16 additions and 0 deletions

View file

@ -337,6 +337,14 @@ HistoryWidget::HistoryWidget(
) | rpl::start_with_next([=] {
fieldChanged();
}, _field->lifetime());
#ifdef Q_OS_MAC
// Removed an ability to insert text from the menu bar
// when the field is hidden.
_field->shownValue(
) | rpl::start_with_next([=](bool shown) {
_field->setEnabled(shown);
}, _field->lifetime());
#endif // Q_OS_MAC
connect(
controller->widget()->windowHandle(),
&QWindow::visibleChanged,

View file

@ -1558,6 +1558,14 @@ void ComposeControls::initField() {
) | rpl::start_with_next([=] {
fieldChanged();
}, _field->lifetime());
#ifdef Q_OS_MAC
// Removed an ability to insert text from the menu bar
// when the field is hidden.
_field->shownValue(
) | rpl::start_with_next([=](bool shown) {
_field->setEnabled(shown);
}, _field->lifetime());
#endif // Q_OS_MAC
InitMessageField(_show, _field, [=](not_null<DocumentData*> emoji) {
if (_history && Data::AllowEmojiWithoutPremium(_history->peer)) {
return true;