Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple monitors, window opens on wrong monitor #27

Open
adamdry opened this issue Oct 11, 2017 · 5 comments
Open

Multiple monitors, window opens on wrong monitor #27

adamdry opened this issue Oct 11, 2017 · 5 comments

Comments

@adamdry
Copy link

adamdry commented Oct 11, 2017

I did these steps:

  • I added the code as per usage example
  • I ran my app, moved the window to the left screen (I have 3 24" screens)
  • maximised it
  • closed the window (the app is now terminated)
  • re-ran the app and the window opened maximised but in the centre screen

I'm running Ubuntu 16.04, using node 7.9.0, Chrome 58.0.3029.110, and Electron 1.7.8

Edit:
Further testing shows that my app's window will maximise on which ever screen the terminal window I'm launching it from is on

@adamdry adamdry changed the title Multiple monitors, window opens on wrong screen Multiple monitors, window opens on wrong monitor Oct 11, 2017
@tobiasmuecksch
Copy link

@adamdry This issue should have been fixed in the latest version 5.0.3

Please check and close this issue if solved.

@ThexXTURBOXx
Copy link

I am using altus, which uses 5.0.3.
The issue still seems to exist for me: amanharwara/altus#20.
I also reported an issue here as well with a workaround for users: electron/electron#17933
Maybe this could help resolving the issue?

@danivalls
Copy link

It keeps happening to me too. This is the configuration I have:

import { app, BrowserWindow } from 'electron'
import windowStateKeeper from 'electron-window-state'

let mainWindow

function createWindow () {
  /**
   * Load the previous state with fallback to defaults
   */
  let mainWindowState = windowStateKeeper({
    defaultWidth: 1000,
    defaultHeight: 600
  })

  /**
   * Initial window options
   */
  const { width, height, x, y } = mainWindowState

  mainWindow = new BrowserWindow({
    width,
    height,
    x,
    y,
    webPreferences: {
      nodeIntegration: true
    }
  })

  mainWindow.setMenu(null)
  mainWindow.loadURL(process.env.APP_URL)

  mainWindowState.manage(mainWindow)

  mainWindow.on('closed', () => {
    mainWindow = null
  })
}

app.on('ready', createWindow)

@kburns2kb
Copy link

Experiencing this issue

@edamlmmv
Copy link

You need to mention the .json file where to remember the values.

mainWindowState = windowStateKeeper({
file: 'mainWindowState.json',
defaultWidth: ?
defaultHeight: ?
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants