mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-27 14:50:21 +03:00
return correct screen geometry from corona
--signal triggering for screenGeometryChanged(id) can not be added yet as it is not plasma 5.8 compatible
This commit is contained in:
parent
0a1d4bd0b8
commit
237cf1db36
@ -210,12 +210,21 @@ int DockCorona::numScreens() const
|
||||
QRect DockCorona::screenGeometry(int id) const
|
||||
{
|
||||
const auto screens = qGuiApp->screens();
|
||||
const QScreen *screen{qGuiApp->primaryScreen()};
|
||||
|
||||
if (id >= 0 && id < screens.count()) {
|
||||
return screens[id]->geometry();
|
||||
QString screenName;
|
||||
|
||||
if (m_screenPool->knownIds().contains(id))
|
||||
screenName = m_screenPool->connector(id);
|
||||
|
||||
foreach (auto scr, screens) {
|
||||
if (scr->name() == screenName) {
|
||||
screen = scr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return qGuiApp->primaryScreen()->geometry();
|
||||
return screen->geometry();
|
||||
}
|
||||
|
||||
QRegion DockCorona::availableScreenRegion(int id) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user