1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 01:33:50 +03:00

window belongs in a screen whenever touching it

--whenever a window geometry is touching a screen geometry
is now considered that this window belongs to that screen.
This way a window could look active to more that one screens.
This way all last active window considerations now work
properly even when the window center is out of screen.
This commit is contained in:
Michail Vourlakos 2021-12-27 23:25:42 +02:00
parent cd2ec88274
commit 5ecb8ab767
2 changed files with 8 additions and 5 deletions

View File

@ -138,7 +138,7 @@ Latte::View *TrackedViewInfo::view() const
bool TrackedViewInfo::isTracking(const WindowInfoWrap &winfo) const
{
return TrackedGeneralInfo::isTracking(winfo)
&& m_screenGeometry.contains(winfo.geometry().center());
&& m_screenGeometry.intersects(winfo.geometry());
}
}

View File

@ -704,8 +704,10 @@ bool Windows::isActiveInViewScreen(Latte::View *view, const WindowInfoWrap &winf
qRound(screenGeometry.height() * factor));
}
return (winfo.isValid() && winfo.isActive() && !winfo.isMinimized()
&& screenGeometry.contains(winfo.geometry().center()));
return (winfo.isValid()
&& winfo.isActive()
&& !winfo.isMinimized()
&& screenGeometry.intersects(winfo.geometry()));
}
bool Windows::isMaximizedInViewScreen(Latte::View *view, const WindowInfoWrap &winfo)
@ -723,10 +725,11 @@ bool Windows::isMaximizedInViewScreen(Latte::View *view, const WindowInfoWrap &w
//! updated implementation to identify the screen that the maximized window is present
//! in order to avoid: https://bugs.kde.org/show_bug.cgi?id=397700
return (winfo.isValid() && !winfo.isMinimized()
return (winfo.isValid()
&& !winfo.isMinimized()
&& !winfo.isShaded()
&& winfo.isMaximized()
&& screenGeometry.contains(winfo.geometry().center()));
&& screenGeometry.intersects(winfo.geometry()));
}
bool Windows::isTouchingView(Latte::View *view, const WindowSystem::WindowInfoWrap &winfo)