Commit b94bc90d authored by Marco Martin's avatar Marco Martin Committed by Daniel Vrátil
Browse files

Revert "let kwin position the popup"

This reverts commit 282ad8db.
parent 30e53313
......@@ -86,6 +86,25 @@ void Osd::showOutputIdentifier(const KScreen::OutputPtr output)
showOsd();
}
void Osd::updatePosition()
{
if (!m_outputGeometry.isValid()) {
return;
}
auto *rootObject = m_osdObject->rootObject();
const int dialogWidth = rootObject->property("width").toInt();
const int dialogHeight = rootObject->property("height").toInt();
const int relx = m_outputGeometry.x();
const int rely = m_outputGeometry.y();
const int pos_x = relx + (m_outputGeometry.width() - dialogWidth) / 2;
const int pos_y = rely + (m_outputGeometry.height() - dialogHeight) / 2;
rootObject->setProperty("x", pos_x);
rootObject->setProperty("y", pos_y);
}
void Osd::showOsd()
{
m_osdTimer->stop();
......@@ -103,6 +122,7 @@ void Osd::showOsd()
} else {
rootObject->setProperty("visible", true);
}
updatePosition();
m_osdTimer->start(m_timeout);
}
......
......@@ -48,6 +48,7 @@ public:
private:
void hideOsd();
void showOsd();
void updatePosition();
KScreen::OutputPtr m_output;
QRect m_outputGeometry;
......
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