mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-23 05:03:36 +03:00
Properly identify primary display and ensure all screens are sorted by their X/Y bounds
This commit is contained in:
parent
fa6fa3f1ea
commit
38494c9704
@ -63,15 +63,15 @@ export class DockingService {
|
||||
}
|
||||
|
||||
getScreens () {
|
||||
return this.electron.screen.getAllDisplays().map((display, index) => {
|
||||
const primaryDisplayID = this.electron.screen.getPrimaryDisplay().id;
|
||||
return this.electron.screen.getAllDisplays().sort((a,b) => (
|
||||
a.bounds.x === b.bounds.x ? a.bounds.y - b.bounds.y : a.bounds.x - b.bounds.x
|
||||
)).map((display,index) => {
|
||||
return {
|
||||
id: display.id,
|
||||
name: [
|
||||
'Primary display',
|
||||
'Secondary display',
|
||||
][index] || `Display ${index + 1}`,
|
||||
name: display.id === primaryDisplayID ? 'Primary Display' : `Display ${index +1}`,
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
private repositionWindow () {
|
||||
|
Loading…
Reference in New Issue
Block a user