Emit Workspace::windowAdded() at more intuitive time when starting to manage an X11 window

Emitting the Workspace::windowAdded() signal before actually adding the
window to the Workspace is counter-intuitive and it can a source of
potential bugs as relevant window lists in Workspace don't contain the
window yet.
This commit is contained in:
Vlad Zahorodnii 2022-05-17 20:44:59 +03:00
parent 67181d5db7
commit f1c9cb5d64

View file

@ -657,6 +657,7 @@ X11Window *Workspace::createX11Window(xcb_window_t windowId, bool is_mapped)
return nullptr;
}
addX11Window(window);
Q_EMIT windowAdded(window);
return window;
}
@ -680,9 +681,6 @@ Unmanaged *Workspace::createUnmanaged(xcb_window_t windowId)
void Workspace::addX11Window(X11Window *window)
{
Group *grp = findGroup(window->window());
Q_EMIT windowAdded(window);
if (grp != nullptr) {
grp->gotLeader(window);
}