mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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/DesktopCaptureSourceManager.h>
|
||||||
#include <tgcalls/desktop_capturer/DesktopCaptureSourceHelper.h>
|
#include <tgcalls/desktop_capturer/DesktopCaptureSourceHelper.h>
|
||||||
|
#include <QtGui/QGuiApplication>
|
||||||
#include <QtGui/QWindow>
|
#include <QtGui/QWindow>
|
||||||
|
|
||||||
namespace Calls::Group::Ui::DesktopCapture {
|
namespace Calls::Group::Ui::DesktopCapture {
|
||||||
|
@ -575,7 +576,15 @@ void ChooseSourceProcess::setupGeometryWithParent(
|
||||||
not_null<QWidget*> parent) {
|
not_null<QWidget*> parent) {
|
||||||
if (const auto handle = parent->windowHandle()) {
|
if (const auto handle = parent->windowHandle()) {
|
||||||
_window->createWinId();
|
_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();
|
const auto myScreen = _window->windowHandle()->screen();
|
||||||
if (parentScreen && myScreen != parentScreen) {
|
if (parentScreen && myScreen != parentScreen) {
|
||||||
_window->windowHandle()->setScreen(parentScreen);
|
_window->windowHandle()->setScreen(parentScreen);
|
||||||
|
|
Loading…
Add table
Reference in a new issue