mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-05 00:46:08 +00:00
Fixed handling of requests to open media from non-primary windows.
This commit is contained in:
@@ -353,12 +353,16 @@ void Application::run() {
|
||||
showOpenGLCrashNotification();
|
||||
}
|
||||
|
||||
_primaryWindow->openInMediaViewRequests(
|
||||
_openInMediaViewRequests.events(
|
||||
) | rpl::start_with_next([=](Media::View::OpenRequest &&request) {
|
||||
if (_mediaView) {
|
||||
_mediaView->show(std::move(request));
|
||||
}
|
||||
}, _primaryWindow->lifetime());
|
||||
}, _lifetime);
|
||||
_primaryWindow->openInMediaViewRequests(
|
||||
) | rpl::start_to_stream(
|
||||
_openInMediaViewRequests,
|
||||
_primaryWindow->lifetime());
|
||||
|
||||
{
|
||||
const auto countries = std::make_shared<Countries::Manager>(
|
||||
@@ -448,6 +452,12 @@ void Application::enumerateWindows(Fn<void(
|
||||
}
|
||||
}
|
||||
|
||||
void Application::processSecondaryWindow(
|
||||
not_null<Window::Controller*> window) {
|
||||
window->openInMediaViewRequests(
|
||||
) | rpl::start_to_stream(_openInMediaViewRequests, window->lifetime());
|
||||
}
|
||||
|
||||
void Application::startTray() {
|
||||
using WindowRaw = not_null<Window::Controller*>;
|
||||
_tray->create();
|
||||
@@ -1163,6 +1173,7 @@ Window::Controller *Application::ensureSeparateWindowForPeer(
|
||||
peer->owner().history(peer),
|
||||
std::make_unique<Window::Controller>(peer, showAtMsgId)
|
||||
).first->second.get();
|
||||
processSecondaryWindow(result);
|
||||
result->widget()->show();
|
||||
result->finishFirstShow();
|
||||
return activate(result);
|
||||
|
Reference in New Issue
Block a user