Port Workspace::takeActivity() to VirtualDesktop

Workspace::takeActivity() forces the modal dialog and its parent window
to be on the same virtual desktop. It uses int-based desktop ids for
that purpose.

This change ports the relevant parts of Workspace::takeActivity() to the
VirtualDesktop object.
This commit is contained in:
Vlad Zahorodnii 2021-08-17 10:53:19 +03:00
parent ad6ff56468
commit 0c0118f5e8

View file

@ -349,8 +349,9 @@ bool Workspace::takeActivity(AbstractClient* c, ActivityFlags flags)
if (flags & ActivityFocus) { if (flags & ActivityFocus) {
AbstractClient* modal = c->findModal(); AbstractClient* modal = c->findModal();
if (modal != nullptr && modal != c) { if (modal != nullptr && modal != c) {
if (!modal->isOnDesktop(c->desktop())) if (modal->desktops() != c->desktops()) {
modal->setDesktop(c->desktop()); modal->setDesktops(c->desktops());
}
if (!modal->isShown(true) && !modal->isMinimized()) // forced desktop or utility window if (!modal->isShown(true) && !modal->isMinimized()) // forced desktop or utility window
activateClient(modal); // activating a minimized blocked window will unminimize its modal implicitly activateClient(modal); // activating a minimized blocked window will unminimize its modal implicitly
// if the click was inside the window (i.e. handled is set), // if the click was inside the window (i.e. handled is set),