Add Workspace::geometryChanged() signal

The new signal can be used to monitor workspace geometry changes. It can
be used by the Scene.
This commit is contained in:
Vlad Zahorodnii 2021-11-09 12:38:17 +02:00
parent 48f943bd75
commit 158fb016a4
2 changed files with 6 additions and 0 deletions

View file

@ -2070,6 +2070,7 @@ void Workspace::desktopResized()
{
const auto outputs = kwinApp()->platform()->enabledOutputs();
const QRect oldGeometry = m_geometry;
m_geometry = QRect();
for (const AbstractOutput *output : outputs) {
m_geometry = m_geometry.united(output->geometry());
@ -2087,6 +2088,10 @@ void Workspace::desktopResized()
// TODO: emit a signal instead and remove the deep function calls into edges and effects
ScreenEdges::self()->recreateEdges();
if (m_geometry != oldGeometry) {
Q_EMIT geometryChanged();
}
}
void Workspace::saveOldScreenSizes()

View file

@ -503,6 +503,7 @@ Q_SIGNALS:
* This can be used to connect to for performing post-workspace initialization.
*/
void workspaceInitialized();
void geometryChanged();
//Signals required for the scripting interface
void desktopPresenceChanged(KWin::AbstractClient*, int);