mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
X and Y options to not work #248
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bsparacino on GitHub (Dec 27, 2018).
Originally assigned to: @GregorBiswanger on GitHub.
I am trying to position the window to the top left corner of the screen 0,0 but the window opens at the default setting, right in the middle of the scree. It appear that the X and Y coordinate options are being ignored.
var mainWindow = await Electron.WindowManager.CreateWindowAsync(new BrowserWindowOptions { X = 0, Y = 0 });@GregorBiswanger commented on GitHub (Jan 3, 2019):
@bsparacino Okay, that problem is the json serializer in the backend.. we ignore default value handling.. if you instanciate a BrowserWindowOptions object.. all integer properties get a default 0 value.. and then we get a not expected behavior for all applications, that not like a x,y 0 position...
X = 1 and Y = 1 should work...
@GregorBiswanger commented on GitHub (Jan 3, 2019):
@bsparacino mmhh.. on native electron don´t work a absolute 0, 0 position.. I get every time a one pixel distance.. but I implement a solution for the next Electron.NET version.. then you can use you BrowserWindowOptions with X, Y 0 :)
mainWindow.setPosition(0, 0)should eventually work as alternative..@bsparacino commented on GitHub (Jan 3, 2019):
@GregorBiswanger
Native electron does work with 0,0
Off the top of my head this would be the code
new BrowserWindow({ x: 0, y: 0, frame: false })My application is with LED boards so it's important to have it line up exactly and not be even 1 pixel off.
Your issue is that you might not be using a frameless window.
Thanks for looking into this!
@GregorBiswanger commented on GitHub (Jan 3, 2019):
I have this problem with the native Electron API:
https://github.com/electron/electron/issues/4045
@GregorBiswanger commented on GitHub (Jan 3, 2019):
Okay, that is a Windows 10/Native Electron problem.. I implement the workaround solution.. the next Electron.NET update have it implemented :)
@GregorBiswanger commented on GitHub (Jan 3, 2019):
fixed