Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X and Y options to not work #193

Closed
bsparacino opened this issue Dec 27, 2018 · 6 comments
Closed

X and Y options to not work #193

bsparacino opened this issue Dec 27, 2018 · 6 comments
Assignees
Labels
Milestone

Comments

@bsparacino
Copy link

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 GregorBiswanger self-assigned this Jan 3, 2019
@GregorBiswanger
Copy link
Member

@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
Copy link
Member

@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
Copy link
Author

@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
Copy link
Member

I have this problem with the native Electron API:

electron/electron#4045

@GregorBiswanger
Copy link
Member

Okay, that is a Windows 10/Native Electron problem.. I implement the workaround solution.. the next Electron.NET update have it implemented :)

@GregorBiswanger
Copy link
Member

fixed

@GregorBiswanger GregorBiswanger added this to the 0.0.12 milestone Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants