mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Try to always use QWidget::screen
This commit is contained in:
parent
4befb125e3
commit
3a9eb8463d
3 changed files with 5 additions and 30 deletions
|
@ -23,7 +23,6 @@ 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 {
|
||||
|
@ -585,13 +584,7 @@ void ChooseSourceProcess::setupSourcesGeometry() {
|
|||
|
||||
void ChooseSourceProcess::setupGeometryWithParent(
|
||||
not_null<QWidget*> parent) {
|
||||
const auto parentScreen = [&] {
|
||||
if (const auto screen = QGuiApplication::screenAt(
|
||||
parent->geometry().center())) {
|
||||
return screen;
|
||||
}
|
||||
return parent->screen();
|
||||
}();
|
||||
const auto parentScreen = parent->screen();
|
||||
const auto myScreen = _window->screen();
|
||||
if (parentScreen && myScreen != parentScreen) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
|
|
|
@ -860,20 +860,12 @@ void OverlayWidget::moveToScreen(bool inMove) {
|
|||
if (!_fullscreen || _wasWindowedMode) {
|
||||
return;
|
||||
}
|
||||
const auto widgetScreen = [&](auto &&widget) -> QScreen* {
|
||||
if (!widget) {
|
||||
return nullptr;
|
||||
}
|
||||
if (const auto screen = QGuiApplication::screenAt(
|
||||
widget->geometry().center())) {
|
||||
return screen;
|
||||
}
|
||||
return widget->screen();
|
||||
};
|
||||
const auto applicationWindow = Core::App().activeWindow()
|
||||
? Core::App().activeWindow()->widget().get()
|
||||
: nullptr;
|
||||
const auto activeWindowScreen = widgetScreen(applicationWindow);
|
||||
const auto activeWindowScreen = applicationWindow
|
||||
? applicationWindow->screen()
|
||||
: nullptr;
|
||||
const auto myScreen = _window->screen();
|
||||
if (activeWindowScreen && myScreen != activeWindowScreen) {
|
||||
const auto screenList = QGuiApplication::screens();
|
||||
|
|
|
@ -481,17 +481,7 @@ PipPanel::Position PipPanel::countPosition() const {
|
|||
}
|
||||
|
||||
void PipPanel::setPositionDefault() {
|
||||
const auto widgetScreen = [&](auto &&widget) -> QScreen* {
|
||||
if (!widget) {
|
||||
return nullptr;
|
||||
}
|
||||
if (const auto screen = QGuiApplication::screenAt(
|
||||
widget->geometry().center())) {
|
||||
return screen;
|
||||
}
|
||||
return widget->screen();
|
||||
};
|
||||
const auto parentScreen = widgetScreen(_parent);
|
||||
const auto parentScreen = _parent ? _parent->screen() : nullptr;
|
||||
const auto myScreen = widget()->screen();
|
||||
if (parentScreen && myScreen != parentScreen) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue