Merge branch 'Plasma/5.19'
This commit is contained in:
commit
da6c775d11
3 changed files with 32 additions and 4 deletions
|
@ -88,4 +88,14 @@ void X11Output::setGammaRampSize(int size)
|
|||
m_gammaRampSize = size;
|
||||
}
|
||||
|
||||
QSize X11Output::physicalSize() const
|
||||
{
|
||||
return m_physicalSize;
|
||||
}
|
||||
|
||||
void X11Output::setPhysicalSize(const QSize &size)
|
||||
{
|
||||
m_physicalSize = size;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -54,6 +54,9 @@ public:
|
|||
int gammaRampSize() const override;
|
||||
bool setGammaRamp(const GammaRamp &gamma) override;
|
||||
|
||||
QSize physicalSize() const override;
|
||||
void setPhysicalSize(const QSize &size);
|
||||
|
||||
private:
|
||||
void setCrtc(xcb_randr_crtc_t crtc);
|
||||
void setGammaRampSize(int size);
|
||||
|
@ -61,6 +64,7 @@ private:
|
|||
xcb_randr_crtc_t m_crtc = XCB_NONE;
|
||||
QString m_name;
|
||||
QRect m_geometry;
|
||||
QSize m_physicalSize;
|
||||
int m_gammaRampSize;
|
||||
int m_refreshRate;
|
||||
|
||||
|
|
|
@ -506,15 +506,29 @@ void X11StandalonePlatform::doUpdateOutputs()
|
|||
o->setGeometry(geo);
|
||||
o->setRefreshRate(refreshRate * 1000);
|
||||
|
||||
QString name;
|
||||
for (int j = 0; j < info->num_outputs; ++j) {
|
||||
Xcb::RandR::OutputInfo outputInfo(outputInfos.at(j));
|
||||
if (crtc == outputInfo->crtc) {
|
||||
name = outputInfo.name();
|
||||
if (outputInfo->crtc != crtc) {
|
||||
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;
|
||||
}
|
||||
o->setName(outputInfo.name());
|
||||
o->setPhysicalSize(physicalSize);
|
||||
break;
|
||||
}
|
||||
o->setName(name);
|
||||
|
||||
m_outputs << o;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue