mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Choose first screen for sharing by default.
This commit is contained in:
parent
5e255e56eb
commit
d5a0f4890d
1 changed files with 9 additions and 0 deletions
|
@ -454,8 +454,10 @@ void ChooseSourceProcess::fillSources() {
|
||||||
|
|
||||||
auto screenIndex = 0;
|
auto screenIndex = 0;
|
||||||
auto windowIndex = 0;
|
auto windowIndex = 0;
|
||||||
|
auto firstScreenSelected = false;
|
||||||
const auto active = _delegate->chooseSourceActiveDeviceId();
|
const auto active = _delegate->chooseSourceActiveDeviceId();
|
||||||
const auto append = [&](const tgcalls::DesktopCaptureSource &source) {
|
const auto append = [&](const tgcalls::DesktopCaptureSource &source) {
|
||||||
|
const auto firstScreen = !source.isWindow() && !screenIndex;
|
||||||
const auto title = !source.isWindow()
|
const auto title = !source.isWindow()
|
||||||
? tr::lng_group_call_screen_title(
|
? tr::lng_group_call_screen_title(
|
||||||
tr::now,
|
tr::now,
|
||||||
|
@ -471,6 +473,10 @@ void ChooseSourceProcess::fillSources() {
|
||||||
if (!active.isEmpty() && active.toStdString() == id) {
|
if (!active.isEmpty() && active.toStdString() == id) {
|
||||||
_selected = raw;
|
_selected = raw;
|
||||||
raw->setActive(true);
|
raw->setActive(true);
|
||||||
|
} else if (active.isEmpty() && firstScreen) {
|
||||||
|
_selected = raw;
|
||||||
|
raw->setActive(true);
|
||||||
|
firstScreenSelected = true;
|
||||||
}
|
}
|
||||||
_sources.back()->activations(
|
_sources.back()->activations(
|
||||||
) | rpl::filter([=] {
|
) | rpl::filter([=] {
|
||||||
|
@ -489,6 +495,9 @@ void ChooseSourceProcess::fillSources() {
|
||||||
for (const auto &source : windowsManager.sources()) {
|
for (const auto &source : windowsManager.sources()) {
|
||||||
append(source);
|
append(source);
|
||||||
}
|
}
|
||||||
|
if (firstScreenSelected) {
|
||||||
|
updateButtonsVisibility();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChooseSourceProcess::updateButtonsVisibility() {
|
void ChooseSourceProcess::updateButtonsVisibility() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue