Giter Site home page Giter Site logo

Comments (3)

NykoKar avatar NykoKar commented on June 2, 2024 1

@clavin
Thank you for your feedback but I'm not sure you understand my issue (because I really think there is one) so I'll try to explain it better.

I have two screens next to each other (main in front of me, secondary on my right) and the function screen.getAllDisplays() also give me the right values:

[
  {
    id: 2,
    label: 'DELL U2720Q',
    bounds: { x: 0, y: 0, width: 3008, height: 1692 },
    workArea: { x: 0, y: 25, width: 3008, height: 1667 },
    accelerometerSupport: 'unknown',
    monochrome: false,
    colorDepth: 24,
    colorSpace: '{primaries:BT709, transfer:SRGB, matrix:RGB, range:FULL}',
    depthPerComponent: 8,
    size: { width: 3008, height: 1692 },
    displayFrequency: 59,
    workAreaSize: { width: 3008, height: 1667 },
    scaleFactor: 2,
    rotation: 0,
    internal: false,
    touchSupport: 'unknown'
  },
  {
    id: 1,
    label: 'VG248',
    bounds: { x: 3008, y: 0, width: 1920, height: 1080 },
    workArea: { x: 3008, y: 25, width: 1920, height: 1055 },
    accelerometerSupport: 'unknown',
    monochrome: false,
    colorDepth: 24,
    colorSpace: '{r:[0.6502, 0.3292], g:[0.3301, 0.6229], b:[0.1513, 0.3292], w:[0.3127, 0.3290]}, transfer:BT709_APPLE, matrix:RGB, range:FULL}',
    depthPerComponent: 8,
    size: { width: 1920, height: 1080 },
    displayFrequency: 60,
    workAreaSize: { width: 1920, height: 1055 },
    scaleFactor: 1,
    rotation: 0,
    internal: false,
    touchSupport: 'unknown'
  }
]

So the second monitor, which is the VG248, has

bounds: { x: 3008, y: 0, width: 1920, height: 1080 },

So, to create a BrowserWindow on this monitor, I put these parameters on the constructor (x & y + 50 as indicated on electron's documentation ):
new BrowserWindow({ x: 3008 + 50, y: 0 + 50, })

On my side, this BrowserWindow will be created on my primary screen whereas it should be displayed on my secondary as I have put coordinate of my secondary monitor.

Additional information: I'm working on a mac mini. So, maybe there is a difference of behaviour between macbook with 1 external screen and mac mini with 2 external screens, just an idea.

from electron.

NykoKar avatar NykoKar commented on June 2, 2024

A better gist (to test on Fiddle for example): https://gist.github.com/NykoKar/002b79bdaed2bf36ab8f9bc30dbefec3

from electron.

clavin avatar clavin commented on June 2, 2024

I'm sorry, I'm unable to reproduce this issue given the test case provided on macOS. I checked my display settings and the displays reported by screen.getAllDisplays() and everything seems to be working properly.

Check out the Electron community. There are also a bunch of helpful people in this Discord that should be willing to point you in the right direction. For your question, I'd recommend the Discord - we have many active help channels and mentors, as well as fellow devs, who can help you out.

from electron.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.