Windows not centered when using `position: center` in Linux
See original GitHub issueNWJS 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:
- Created a year ago
- Comments:5
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is still broken in NW.js 0.67.1.
This is still broken in NW.js 0.65.1. I can also confirm it happens in both Ubuntu 20.04 and 22.04.