Skip to content

New fullscreen windows do not respect the primary screen under Linux #7937

Open
@chewi

Description

@chewi

Issue Type

  • Bug Report

  • Feature Request

  • Successfully reproduced against the latest version of NW.js?

Current/Missing Behavior

When I start CrossCode (using the latest NW.js, not the bundled one) in fullscreen under Linux, it does not respect the "primary" screen. Instead, it starts on the top left screen, essentially at 0, 0. This happens under both Xfce/X11 and KDE/Wayland.

If I exit fullscreen, drag the window across to the correct screen, and make it fullscreen again, then it stays on the correct screen, but this does not persist to the next invocation.

Expected/Proposed Behavior

Both of these environments have the concept of a primary screen so it should respect this like other applications do. I have checked the Chromium source and found even that has the concept of a primary screen.

I don't think this is a bug with CrossCode itself, but I do not know of another NW.js example I could try for comparison. I'd be happy to do so if pointed at one though.

I wonder whether NW.js even needs to check for the primary screen. This code in nw_content.cc seems to anchor new windows at 0, 0 almost unconditionally. What if it simply didn't do that?

  int x = 0, y = 0;
  if (manifest->GetInteger(switches::kmX, &x))
    ret.window_spec.bounds.set_x(x);
  if (manifest->GetInteger(switches::kmY, &y))
    ret.window_spec.bounds.set_y(y);

Additional Info

  • Operating System: Gentoo Linux
  • NW.js Version: 0.67.0
  • Repro Link: N/A
  • Code snippet: N/A
  • Crash report: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions