Revert "拼接屏2"

This reverts commit f94eb54e82.
This commit is contained in:
hanpinlong 2024-04-30 06:51:05 +00:00 committed by Gitee
parent 8ec7c9cabf
commit 5fb142d672
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 8 additions and 14 deletions

View File

@ -536,7 +536,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
, m_crtc(output ? output->crtc : XCB_NONE)
, m_outputName(getOutputName(output))
, m_outputSizeMillimeters(output ? QSize(output->mm_width, output->mm_height) : QSize())
, m_cursor(std::make_unique<QXcbCursor>(connection, this))
{
// if (connection->hasXRandr()) {
if (connection->isAtLeastXRandR12()) {
@ -565,7 +564,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
if (m_sizeMillimeters.isEmpty())
m_sizeMillimeters = virtualDesktop->physicalSize();
// m_cursor = new QXcbCursor(connection, this);
m_cursor = new QXcbCursor(connection, this);
// if (connection->hasXRandr()) { // Parse EDID
if (connection->isAtLeastXRandR12()) { // Parse EDID
@ -593,7 +592,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
: QXcbObject(connection)
, m_virtualDesktop(virtualDesktop)
, m_monitor(monitorInfo)
, m_cursor(std::make_unique<QXcbCursor>(connection, this))
{
setMonitor(monitorInfo, timestamp);
}
@ -651,9 +649,9 @@ void QXcbScreen::setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp
m_singlescreen = (monitorGeometry == (QRect(crtc->x, crtc->y, crtc->width, crtc->height)));
if (m_singlescreen) {
if (crtc->mode) {
// if (crtc->rotation == XCB_RANDR_ROTATION_ROTATE_90 ||
// crtc->rotation == XCB_RANDR_ROTATION_ROTATE_270)
// std::swap(crtc->width, crtc->height);
if (crtc->rotation == XCB_RANDR_ROTATION_ROTATE_90 ||
crtc->rotation == XCB_RANDR_ROTATION_ROTATE_270)
std::swap(crtc->width, crtc->height);
updateGeometry(QRect(crtc->x, crtc->y, crtc->width, crtc->height), crtc->rotation);
if (mode() != crtc->mode)
updateRefreshRate(crtc->mode);
@ -677,13 +675,10 @@ void QXcbScreen::setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp
QByteArray ba = connection()->atomName(monitorInfo->name);
m_outputName = getName(monitorInfo);
// if (monitorInfo->primary)
if (connection()->primaryScreenNumber() == virtualDesktop()->number() && monitorInfo->primary)
if (monitorInfo->primary)
m_primary = true;
// m_cursor = new QXcbCursor(connection(), this);
else
m_primary = false;
m_cursor = new QXcbCursor(connection(), this);
}
@ -691,7 +686,7 @@ void QXcbScreen::setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp
QXcbScreen::~QXcbScreen()
{
// delete m_cursor;
delete m_cursor;
}
QString QXcbScreen::getName(xcb_randr_monitor_info_t *monitorInfo)
@ -866,8 +861,7 @@ QDpi QXcbScreen::logicalDpi() const
QPlatformCursor *QXcbScreen::cursor() const
{
// return m_cursor;
return m_cursor.get();
return m_cursor;
}
void QXcbScreen::setOutput(xcb_randr_output_t outputId,