2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Detach SystemMediaControls from Window::Controller.

This commit is contained in:
John Preston
2023-01-19 09:38:52 +04:00
parent 6b8f80bd63
commit cdfdccbb66
12 changed files with 67 additions and 53 deletions

View File

@@ -15,7 +15,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/stickers/data_stickers.h" // Stickers::setsRef()
#include "main/main_domain.h"
#include "main/main_session.h"
#include "mainwidget.h" // MainWidget::closeBothPlayers
#include "media/audio/media_audio_capture.h"
#include "media/player/media_player_instance.h"
#include "platform/mac/touchbar/mac_touchbar_audio.h"
@@ -171,9 +170,7 @@ const auto kAudioItemIdentifier = @"touchbarAudio";
autorelease];
item.groupTouchBar = touchBar;
[touchBar closeRequests] | rpl::start_with_next([=] {
if (const auto session = _controller->sessionController()) {
session->content()->closeBothPlayers();
}
Media::Player::instance()->stopAndClose();
}, [item lifetime]);
return [item autorelease];
}