diff --git a/screens.cpp b/screens.cpp index 23caf59352..c351c7e12e 100644 --- a/screens.cpp +++ b/screens.cpp @@ -117,6 +117,17 @@ int Screens::current() const return m_current; } +int Screens::intersecting(const QRect &r) const +{ + int cnt = 0; + for (int i = 0; i < count(); ++i) { + if (geometry(i).intersects(r)) { + ++cnt; + } + } + return cnt; +} + DesktopWidgetScreens::DesktopWidgetScreens(QObject *parent) : Screens(parent) , m_desktop(QApplication::desktop()) diff --git a/screens.h b/screens.h index f05f818519..0ba11d1aa9 100644 --- a/screens.h +++ b/screens.h @@ -68,6 +68,8 @@ public: inline bool isChanging() { return m_changedTimer->isActive(); } + int intersecting(const QRect &r) const; + public Q_SLOTS: void reconfigure();