mirror of
https://github.com/theCheeseboard/libtdesktopenvironment.git
synced 2025-01-22 10:22:02 -05:00
Choose the leftmost screen for the primary screen
This commit is contained in:
parent
24361dc07b
commit
7c6422ae13
2 changed files with 12 additions and 0 deletions
|
@ -32,6 +32,7 @@
|
|||
struct BackgroundControllerPrivate {
|
||||
QNetworkAccessManager mgr;
|
||||
QSettings* settings;
|
||||
QFileSystemWatcher* settingsWatcher;
|
||||
|
||||
BackgroundController::BackgroundType type;
|
||||
bool retrievingImages = false;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue