mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-30 08:19:54 +00: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 () {
|
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 {
|
return {
|
||||||
id: display.id,
|
id: display.id,
|
||||||
name: [
|
name: display.id === primaryDisplayID ? 'Primary Display' : `Display ${index +1}`,
|
||||||
'Primary display',
|
|
||||||
'Secondary display',
|
|
||||||
][index] || `Display ${index + 1}`,
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private repositionWindow () {
|
private repositionWindow () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user