Changeset View
Changeset View
Standalone View
Standalone View
src/platforms/xcb/kwindowsystem.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 56 | if (isDirty) { | |||
---|---|---|---|---|---|
65 | 65 | | |||
66 | QObject::connect(qApp, &QGuiApplication::screenAdded, dirtify); | 66 | QObject::connect(qApp, &QGuiApplication::screenAdded, dirtify); | ||
67 | QObject::connect(qApp, &QGuiApplication::screenRemoved, dirtify); | 67 | QObject::connect(qApp, &QGuiApplication::screenRemoved, dirtify); | ||
68 | const QList<QScreen *> screenList = QGuiApplication::screens(); | 68 | const QList<QScreen *> screenList = QGuiApplication::screens(); | ||
69 | QRegion region; | 69 | QRegion region; | ||
70 | for (int i = 0; i < screenList.count(); ++i) { | 70 | for (int i = 0; i < screenList.count(); ++i) { | ||
71 | const QScreen *screen = screenList.at(i); | 71 | const QScreen *screen = screenList.at(i); | ||
72 | connections << QObject::connect(screen, &QScreen::geometryChanged, dirtify); | 72 | connections << QObject::connect(screen, &QScreen::geometryChanged, dirtify); | ||
73 | region += screen->geometry(); | 73 | const QRect geometry = screen->geometry(); | ||
74 | const qreal dpr = screen->devicePixelRatio(); | ||||
75 | region += QRect(geometry.topLeft(), geometry.size() * dpr); | ||||
apol: I don't think that it makes sense to multiply topLeft by dpr, since dpr is local to the screen… | |||||
volkov: Only on a single screen. Thanks for notice. | |||||
74 | } | 76 | } | ||
75 | displayGeometry = region.boundingRect(); | 77 | displayGeometry = region.boundingRect(); | ||
76 | isDirty = false; | 78 | isDirty = false; | ||
77 | } | 79 | } | ||
78 | 80 | | |||
79 | return displayGeometry; | 81 | return displayGeometry; | ||
80 | } | 82 | } | ||
81 | 83 | | |||
▲ Show 20 Lines • Show All 1135 Lines • Show Last 20 Lines |
I don't think that it makes sense to multiply topLeft by dpr, since dpr is local to the screen you're treating.
How have you tested this?