Skip to content

Commit

Permalink
fix: the dual-screen get info may incorrect
Browse files Browse the repository at this point in the history
fix the dual-screen get info may incorrect

Log: the dual-screen get info may incorrect
Bug: https://pms.uniontech.com/bug-view-298757.html
  • Loading branch information
add-uos authored and deepin-bot[bot] committed Jan 15, 2025
1 parent fec6eaf commit 6c032af
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/waylandrecord/waylandintegration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,11 @@ void WaylandIntegration::WaylandIntegrationPrivate::onDeviceChanged(quint32 name
m_screenId2Point.insert(devT->uuid(), devT->geometry());
m_screenCount = m_screenId2Point.size();

// 更新屏幕大小
m_screenSize.setWidth(0);
m_screenSize.setHeight(0);
for (auto p = m_screenId2Point.begin(); p != m_screenId2Point.end(); ++p) {
if (devT->enabled() == KWayland::Client::OutputDevice::Enablement::Disabled){
qDebug()<< devT->uuid() << "is disable";
continue;
}
if (p.value().x() + p.value().width() > m_screenSize.width()) {
m_screenSize.setWidth(p.value().x() + p.value().width());
}
Expand Down Expand Up @@ -1059,6 +1060,7 @@ void WaylandIntegration::WaylandIntegrationPrivate::setupRegistry()
{
qDebug() << "Current number of screens: " << m_screenCount;
for (auto p = m_screenId2Point.begin(); p != m_screenId2Point.end(); ++p) {
qDebug() << p.value() << m_screenSize;
if(p.value().width() == m_screenSize.width() &&
p.value().height() == m_screenSize.height() ){
m_isScreenExtension = false;
Expand All @@ -1069,6 +1071,7 @@ void WaylandIntegration::WaylandIntegrationPrivate::setupRegistry()
}

#ifdef KWAYLAND_REMOTE_BUFFER_RELEASE_FLAGE_ON
qDebug()<< "m_screenCount: "<< m_screenCount << "m_isScreenExtension: " << m_isScreenExtension << screenGeometry << "m_currentScreenBufs[0]->" << (m_currentScreenBufs[0] ? "true":"false") << "m_currentScreenBufs[1]->" << (m_currentScreenBufs[1] ? "true":"false");;
if (m_screenCount == 1 || !m_isScreenExtension)
{
if(m_currentScreenBufs[0] == nullptr)
Expand All @@ -1084,7 +1087,8 @@ void WaylandIntegration::WaylandIntegrationPrivate::setupRegistry()
frameCount++;
if(m_currentScreenBufs[0] != nullptr && !m_isAppendRemoteBuffer){
m_isAppendRemoteBuffer = true;
qInfo() << "How many frames of data are waiting? " << frameCount ;

qInfo() << "Single-How many frames of data are waiting? " << frameCount ;
frameCount = 0;
QtConcurrent::run(this, &WaylandIntegrationPrivate::appendRemoteBuffer);
}
Expand Down Expand Up @@ -1117,7 +1121,7 @@ void WaylandIntegration::WaylandIntegrationPrivate::setupRegistry()
if((m_currentScreenBufs[0] != nullptr && m_currentScreenBufs[1] != nullptr) &&
!m_isAppendRemoteBuffer){
m_isAppendRemoteBuffer = true;
qInfo() << "How many frames of data are waiting? " << frameCount ;
qInfo() << "Double-How many frames of data are waiting? " << frameCount ;
frameCount = 0;
QtConcurrent::run(this, &WaylandIntegrationPrivate::appendRemoteBuffer);
}
Expand Down

0 comments on commit 6c032af

Please sign in to comment.