mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Fixed some global shortcuts with non-primary windows.
This commit is contained in:
parent
032372f150
commit
6450c213e6
5 changed files with 13 additions and 5 deletions
Telegram/SourceFiles
history
info
menu
window
|
@ -398,7 +398,8 @@ void Widget::setupShortcuts() {
|
|||
) | rpl::filter([=] {
|
||||
return Ui::AppInFocus()
|
||||
&& Ui::InFocusChain(this)
|
||||
&& !Ui::isLayerShown();
|
||||
&& !Ui::isLayerShown()
|
||||
&& isActiveWindow();
|
||||
}) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
using Command = Shortcuts::Command;
|
||||
request->check(Command::Search, 2) && request->handle([=] {
|
||||
|
|
|
@ -1814,7 +1814,8 @@ void HistoryWidget::setupShortcuts() {
|
|||
) | rpl::filter([=] {
|
||||
return Ui::AppInFocus()
|
||||
&& Ui::InFocusChain(this)
|
||||
&& !Ui::isLayerShown();
|
||||
&& !Ui::isLayerShown()
|
||||
&& (Core::App().activeWindow() == &controller()->window());
|
||||
}) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
using Command = Shortcuts::Command;
|
||||
if (_history) {
|
||||
|
|
|
@ -109,7 +109,9 @@ WrapWidget::WrapWidget(
|
|||
void WrapWidget::setupShortcuts() {
|
||||
Shortcuts::Requests(
|
||||
) | rpl::filter([=] {
|
||||
return requireTopBarSearch();
|
||||
return requireTopBarSearch()
|
||||
&& (Core::App().activeWindow()
|
||||
== &_controller->parentController()->window());
|
||||
}) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
using Command = Shortcuts::Command;
|
||||
request->check(Command::Search) && request->handle([=] {
|
||||
|
|
|
@ -104,7 +104,9 @@ void SetupMenuAndShortcuts(
|
|||
});
|
||||
|
||||
Shortcuts::Requests(
|
||||
) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
) | rpl::filter([=] {
|
||||
return button->isActiveWindow();
|
||||
}) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
using Command = Shortcuts::Command;
|
||||
|
||||
const auto now = type();
|
||||
|
|
|
@ -767,7 +767,9 @@ void SessionController::initSupportMode() {
|
|||
session().supportHelper().registerWindow(this);
|
||||
|
||||
Shortcuts::Requests(
|
||||
) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
) | rpl::filter([=] {
|
||||
return (Core::App().activeWindow() == &window());
|
||||
}) | rpl::start_with_next([=](not_null<Shortcuts::Request*> request) {
|
||||
using C = Shortcuts::Command;
|
||||
|
||||
request->check(C::SupportHistoryBack) && request->handle([=] {
|
||||
|
|
Loading…
Add table
Reference in a new issue