Compare commits

...

2 commits

3 changed files with 8 additions and 5 deletions

View file

@ -46,6 +46,7 @@ Window *FocusChain::getForActivation(VirtualDesktop *desktop) const
Window *FocusChain::getForActivation(VirtualDesktop *desktop, Output *output) const Window *FocusChain::getForActivation(VirtualDesktop *desktop, Output *output) const
{ {
qInfo("getForActivation");
// TODO: Find windows on other dedsktops that are also currently visible. // TODO: Find windows on other dedsktops that are also currently visible.
auto it = m_desktopFocusChains.constFind(desktop); auto it = m_desktopFocusChains.constFind(desktop);
if (it == m_desktopFocusChains.constEnd()) { if (it == m_desktopFocusChains.constEnd()) {

View file

@ -834,8 +834,6 @@ bool Window::isOnDesktop(VirtualDesktop *desktop) const
bool Window::isOnCurrentDesktop() const bool Window::isOnCurrentDesktop() const
{ {
bool is = isOnDesktop(VirtualDesktopManager::self()->currentDesktop(output()));
qInfo("isOnDesktop %d", is);
return isOnDesktop(VirtualDesktopManager::self()->currentDesktop(output())); return isOnDesktop(VirtualDesktopManager::self()->currentDesktop(output()));
} }

View file

@ -1015,6 +1015,7 @@ void Workspace::activateWindowOnNewDesktop(VirtualDesktop *desktop)
Window *Workspace::findWindowToActivateOnDesktop(VirtualDesktop *desktop) Window *Workspace::findWindowToActivateOnDesktop(VirtualDesktop *desktop)
{ {
qInfo("findWindowToActivateOnDesktop");
if (m_moveResizeWindow != nullptr && m_activeWindow == m_moveResizeWindow && m_focusChain->contains(m_activeWindow, desktop) && m_activeWindow->isShown() && m_activeWindow->isOnCurrentDesktop()) { if (m_moveResizeWindow != nullptr && m_activeWindow == m_moveResizeWindow && m_focusChain->contains(m_activeWindow, desktop) && m_activeWindow->isShown() && m_activeWindow->isOnCurrentDesktop()) {
// A requestFocus call will fail, as the window is already active // A requestFocus call will fail, as the window is already active
return m_activeWindow; return m_activeWindow;
@ -1111,11 +1112,13 @@ void Workspace::updateCurrentActivity(const QString &new_activity)
window = m_activeWindow; window = m_activeWindow;
} else if (options->focusPolicyIsReasonable()) { } else if (options->focusPolicyIsReasonable()) {
// Search in focus chain // Search in focus chain
window = m_focusChain->getForActivation(VirtualDesktopManager::self()->currentDesktop()); // TODO: Maybe we should give more info to the focuschain for it to find a more suitable window?
window = m_focusChain->getForActivation(VirtualDesktopManager::self()->currentDesktop(window->output()));
} }
if (!window) { if (!window) {
window = findDesktop(true, VirtualDesktopManager::self()->currentDesktop()); // TODO: Maybe we should give more info to the focuschain for it to find a more suitable window?
window = findDesktop(true, VirtualDesktopManager::self()->currentDesktop(window->output()));
} }
if (window != m_activeWindow) { if (window != m_activeWindow) {
@ -2441,7 +2444,8 @@ QRectF Workspace::clientArea(clientAreaOption opt, const Window *window, const O
{ {
const VirtualDesktop *desktop; const VirtualDesktop *desktop;
if (window->isOnCurrentDesktop()) { if (window->isOnCurrentDesktop()) {
desktop = VirtualDesktopManager::self()->currentDesktop(); // TODO: This will likely need serious refactoring in case support for different virtual desktop layouts per-output is needed? Or maybe I just don't undestand how this works at all.
desktop = VirtualDesktopManager::self()->currentDesktop(window->output());
} else { } else {
desktop = window->desktops().constLast(); desktop = window->desktops().constLast();
} }