Commit d9b3fc64 authored by Àlex Fiestas's avatar Àlex Fiestas
Browse files

Use the information from currentOutput, not from the unapplied config

Before this patch, we were looking for the size of the current Mode
in the Output object of the config that is passed to Config::setConfig
which either can or can't have the wanted Mode.

This has been kinda working so far because and ONLY because in
Generator (from kscreen/kded) we use the currentConfig as the base for
the config that we are generating, so all modes are included.


BUG: 320537
BUG: 321708
BUG: 321699
FIXED-IN: 1.0.1
parent c7a4578e
......@@ -161,7 +161,7 @@ void XRandRConfig::applyKScreenConfig(KScreen::Config *config)
QSize size = output->mode(currentOutput->currentModeId())->size();
QSize size = currentOutput->currentMode()->size();
int x, y;
......@@ -48,4 +48,9 @@ KScreen::Mode *XRandRMode::toKScreenMode(KScreen::Output *parent)
return kscreenMode;
QSize XRandRMode::size() const
return m_size;
#include "xrandrmode.moc"
......@@ -45,6 +45,7 @@ public:
KScreen::Mode* toKScreenMode(KScreen::Output *parent);
QSize size() const;
int m_id;
QString m_name;
......@@ -87,6 +87,16 @@ QString XRandROutput::currentModeId() const
return m_currentMode;
XRandRMode* XRandROutput::currentMode() const
int modeId = m_currentMode.toInt();
if (!m_modes.contains(modeId)) {
return 0;
return m_modes[modeId];
KScreen::Output::Rotation XRandROutput::rotation() const
return m_rotation;
......@@ -81,6 +81,7 @@ public:
bool isPrimary() const;
QPoint position() const;
QString currentModeId() const;
XRandRMode* currentMode() const;
KScreen::Output::Rotation rotation() const;
inline bool isHorizontal() const { return ((m_rotation == KScreen::Output::None) || (m_rotation == KScreen::Output::Inverted)); }
KScreen::Edid* edid() const;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment