mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 13:17:08 +02:00
Use QWidget::setScreen with Qt 6
This commit is contained in:
parent
490ec7949f
commit
5180e0ec57
3 changed files with 13 additions and 1 deletions
|
@ -585,7 +585,6 @@ void ChooseSourceProcess::setupSourcesGeometry() {
|
|||
|
||||
void ChooseSourceProcess::setupGeometryWithParent(
|
||||
not_null<QWidget*> parent) {
|
||||
_window->createWinId();
|
||||
const auto parentScreen = [&] {
|
||||
if (const auto screen = QGuiApplication::screenAt(
|
||||
parent->geometry().center())) {
|
||||
|
@ -595,7 +594,12 @@ void ChooseSourceProcess::setupGeometryWithParent(
|
|||
}();
|
||||
const auto myScreen = _window->screen();
|
||||
if (parentScreen && myScreen != parentScreen) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
_window->setScreen(parentScreen);
|
||||
#else // Qt >= 6.0.0
|
||||
_window->createWinId();
|
||||
_window->windowHandle()->setScreen(parentScreen);
|
||||
#endif // Qt < 6.0.0
|
||||
}
|
||||
_window->setFixedSize(_fixedSize);
|
||||
_window->move(
|
||||
|
|
|
@ -804,7 +804,11 @@ void OverlayWidget::moveToScreen(bool inMove) {
|
|||
DEBUG_LOG(("Viewer Pos: Currently on screen %1, moving to screen %2")
|
||||
.arg(screenList.indexOf(myScreen))
|
||||
.arg(screenList.indexOf(activeWindowScreen)));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
_window->setScreen(activeWindowScreen);
|
||||
#else // Qt >= 6.0.0
|
||||
window()->setScreen(activeWindowScreen);
|
||||
#endif // Qt < 6.0.0
|
||||
DEBUG_LOG(("Viewer Pos: New actual screen: %1")
|
||||
.arg(screenList.indexOf(_window->screen())));
|
||||
}
|
||||
|
|
|
@ -514,7 +514,11 @@ void PipPanel::setPositionDefault() {
|
|||
const auto parentScreen = widgetScreen(_parent);
|
||||
const auto myScreen = widget()->screen();
|
||||
if (parentScreen && myScreen != parentScreen) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
widget()->setScreen(parentScreen);
|
||||
#else // Qt >= 6.0.0
|
||||
widget()->windowHandle()->setScreen(parentScreen);
|
||||
#endif // Qt < 6.0.0
|
||||
}
|
||||
auto position = Position();
|
||||
position.snapped = RectPart::Top | RectPart::Left;
|
||||
|
|
Loading…
Add table
Reference in a new issue