From d6f073cff9c11590aec99be028f85453e379c604 Mon Sep 17 00:00:00 2001 From: zxc524580210 <768994664@qq.com> Date: Fri, 5 Mar 2021 20:56:33 +0800 Subject: [PATCH] adapt mac's retina screen --- src/forms/window-agora-main.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/forms/window-agora-main.cpp b/src/forms/window-agora-main.cpp index 2d9908d5..aa85847d 100644 --- a/src/forms/window-agora-main.cpp +++ b/src/forms/window-agora-main.cpp @@ -394,8 +394,19 @@ void AgoraBasic::resizeEvent(QResizeEvent *event) CreateDisplay(); if (isVisible() && display) { +#if _WIN32 QSize size = this->size(); obs_display_resize(display, size.width(), size.height()); +#else + QSize size = this->size() * ui->preview->devicePixelRatioF(); + if (m_lstRemoteVideoUids.size() >= 1) { + + obs_display_resize(display, size.width()/ (m_lstRemoteVideoUids.size() + 1), size.height() / (m_lstRemoteVideoUids.size())); + }else + { + obs_display_resize(display, size.width(), size.height()); + } +#endif } } @@ -410,9 +421,11 @@ void AgoraBasic::CreateDisplay() QWindow* window = ui->preview->windowHandle(); if (display) return; - +#if _WIN32 QSize size = this->size(); - +#else + QSize size = this->size() * ui->preview->devicePixelRatioF(); +#endif gs_init_data info = {}; info.cx = size.width(); info.cy = size.height();