Skip to content

[Feature Request]: Target a Display when fullscreen-ing a BrowserWindow #30249

Closed as not planned

Description

@jjeff

Preflight Checklist

Problem Description

Right now, the win.setFullScreen() method will fullscreen the window on its current display. There is no way to target a different display when fullscreening.

Proposed Solution

Add an optional second "display" argument to the setFullScreen() method:

win.setFullScreen(flag, display)

This would identify the target Display for fullscreening. When win.setFullScreen(false) is called, the BrowserWindow would return to it's original location on its original Display.

Alternatives Considered

The current method for doing this is clunky.

function fullScreenOnDisplay(win, disp) {
  const currentDisplay = screen.getDisplayMatching(win.getBounds())
  if (currentDisplay === disp) {
    // we're already on the right screen, no need to move
  } else {
    // we need to move the window to the correct screen before fullscreening
    // ensure that the window isn't already fullscreened
    win.setFullScreen(false)
    win.setPosition(disp.workArea.x, disp.workArea.y)
    // --- unnecessary window repaint happens here with non-fullscreen window on target display ---
  }
  win.setFullScreen(true)
}

However, when win.setFullScreen(false) is called, the window will end up on the target display and not in its original location.

Additional Information

A few of the other BrowserWindow instance methods could be multi-screen aware as well.

win.maximize()
win.center()

and/or possbly a new method of:
win.moveToDisplay(display)

Activity

  1. codebytere commented on May 28, 2025

    @codebytere
    Member

    Hi, while we appreciate this enhancement request it's not something that our team will be able to implement in the near future, and since we use our issues tab as the team's backlog, we prefer to only retain issues that are on our immediate roadmap. If you'd like to make a PR for this request we would welcome that but in the meantime I'm going to go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions