mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Synchronize capture source chooser's screen detection code with media viewer
This commit is contained in:
parent
3967e5d4ff
commit
49e143f84e
1 changed files with 10 additions and 1 deletions
|
@ -22,6 +22,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
|
||||
#include <tgcalls/desktop_capturer/DesktopCaptureSourceManager.h>
|
||||
#include <tgcalls/desktop_capturer/DesktopCaptureSourceHelper.h>
|
||||
#include <QtGui/QGuiApplication>
|
||||
#include <QtGui/QWindow>
|
||||
|
||||
namespace Calls::Group::Ui::DesktopCapture {
|
||||
|
@ -575,7 +576,15 @@ void ChooseSourceProcess::setupGeometryWithParent(
|
|||
not_null<QWidget*> parent) {
|
||||
if (const auto handle = parent->windowHandle()) {
|
||||
_window->createWinId();
|
||||
const auto parentScreen = handle->screen();
|
||||
const auto parentScreen = [&] {
|
||||
if (!::Platform::IsWayland()) {
|
||||
if (const auto screen = QGuiApplication::screenAt(
|
||||
parent->geometry().center())) {
|
||||
return screen;
|
||||
}
|
||||
}
|
||||
return handle->screen();
|
||||
}();
|
||||
const auto myScreen = _window->windowHandle()->screen();
|
||||
if (parentScreen && myScreen != parentScreen) {
|
||||
_window->windowHandle()->setScreen(parentScreen);
|
||||
|
|
Loading…
Add table
Reference in a new issue