Choose the leftmost screen for the primary screen

This commit is contained in:
Victor Tran 2023-11-28 21:30:34 +11:00
parent 24361dc07b
commit 7c6422ae13
No known key found for this signature in database
2 changed files with 12 additions and 0 deletions

View file

@ -32,6 +32,7 @@
struct BackgroundControllerPrivate {
QNetworkAccessManager mgr;
QSettings* settings;
QFileSystemWatcher* settingsWatcher;
BackgroundController::BackgroundType type;
bool retrievingImages = false;

View file

@ -71,6 +71,17 @@ QList<SystemScreen*> WaylandScreenBackend::screens() {
SystemScreen* WaylandScreenBackend::primaryScreen() {
// TODO: Implement
if (d->heads.isEmpty()) return nullptr;
// For now, choose the leftmost screen
auto left = d->heads.first()->geometry().left();
for (auto head : d->heads) {
if (head->geometry().left() < left) left = head->geometry().left();
}
for (auto head : d->heads) {
if (head->geometry().left() == left) return head;
}
// ???
return d->heads.first();
}