Merge branch 'Plasma/5.19'

icc-effect-master
Vlad Zahorodnii 2020-06-17 11:05:27 +03:00
commit da6c775d11
3 changed files with 32 additions and 4 deletions

View File

@ -88,4 +88,14 @@ void X11Output::setGammaRampSize(int size)
m_gammaRampSize = size; m_gammaRampSize = size;
} }
QSize X11Output::physicalSize() const
{
return m_physicalSize;
}
void X11Output::setPhysicalSize(const QSize &size)
{
m_physicalSize = size;
}
} }

View File

@ -54,6 +54,9 @@ public:
int gammaRampSize() const override; int gammaRampSize() const override;
bool setGammaRamp(const GammaRamp &gamma) override; bool setGammaRamp(const GammaRamp &gamma) override;
QSize physicalSize() const override;
void setPhysicalSize(const QSize &size);
private: private:
void setCrtc(xcb_randr_crtc_t crtc); void setCrtc(xcb_randr_crtc_t crtc);
void setGammaRampSize(int size); void setGammaRampSize(int size);
@ -61,6 +64,7 @@ private:
xcb_randr_crtc_t m_crtc = XCB_NONE; xcb_randr_crtc_t m_crtc = XCB_NONE;
QString m_name; QString m_name;
QRect m_geometry; QRect m_geometry;
QSize m_physicalSize;
int m_gammaRampSize; int m_gammaRampSize;
int m_refreshRate; int m_refreshRate;

View File

@ -506,15 +506,29 @@ void X11StandalonePlatform::doUpdateOutputs()
o->setGeometry(geo); o->setGeometry(geo);
o->setRefreshRate(refreshRate * 1000); o->setRefreshRate(refreshRate * 1000);
QString name;
for (int j = 0; j < info->num_outputs; ++j) { for (int j = 0; j < info->num_outputs; ++j) {
Xcb::RandR::OutputInfo outputInfo(outputInfos.at(j)); Xcb::RandR::OutputInfo outputInfo(outputInfos.at(j));
if (crtc == outputInfo->crtc) { if (outputInfo->crtc != crtc) {
name = outputInfo.name(); continue;
}
QSize physicalSize(outputInfo->mm_width, outputInfo->mm_height);
switch (info->rotation) {
case XCB_RANDR_ROTATION_ROTATE_0:
case XCB_RANDR_ROTATION_ROTATE_180:
break;
case XCB_RANDR_ROTATION_ROTATE_90:
case XCB_RANDR_ROTATION_ROTATE_270:
physicalSize.transpose();
break;
case XCB_RANDR_ROTATION_REFLECT_X:
case XCB_RANDR_ROTATION_REFLECT_Y:
break; break;
} }
o->setName(outputInfo.name());
o->setPhysicalSize(physicalSize);
break;
} }
o->setName(name);
m_outputs << o; m_outputs << o;
} }
} }