question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Windows not centered when using `position: center` in Linux

See original GitHub issue

NWJS Version : 0.61.0 through 0.64.1 Operating System : Linux (Ubuntu 20.04)

Expected behavior

When setting position: center in a window’s manifest, that window should appear centered on the primary display.

Actual behavior

The position: center manifest property is ignored, starting with NW.js version 0.61.0. Windows appear in the top-left corner, instead.

This works properly with NW.js 0.60.0 and earlier builds. It fails with 0.61.0 and all later builds.

How to reproduce

package.json

{
  "name": "test",
  "main": "index.html",
  "window": {
    "position": "center"
  }
}

index.html

<html><body>Hello world</body></html>

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
sysragecommented, Aug 12, 2022

This is still broken in NW.js 0.67.1.

1reaction
sysragecommented, Jun 11, 2022

This is still broken in NW.js 0.65.1. I can also confirm it happens in both Ubuntu 20.04 and 22.04.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix: Window centering in XFCE does not work properly
Re-apply your theme in Settings -> Window Manager -> Style. Now window placement will work properly and new windows will be opened at...
Read more >
Open windows in center of screen - Ask Ubuntu
Then open it and go to Window Management > Place Windows, enable it, and in "Placement Mode" choose Centered.
Read more >
Xlib center window - linux - Stack Overflow
To center, you would set the win_gravity to Center, which allows you to position the center of the window (including its decorations) instead...
Read more >
Center windows by default? - Desktop - Ubuntu Community Hub
Centering tends to hide windows, I would say it kinda maximizes window overlapping. And there is very little to be gained in a...
Read more >
Desktop not centered - Linux Mint Forums
Have you tried taking a look at "Driver Manager" to see if an update/recommended display driver is available? In mate, it's in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found