-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
BrowserWindow.getContentSize() does not behave the same as expected #25295
Comments
same problem when I use setPosition or setBounds change window position |
the window width is 850, but window.getSize return 851
|
@lmx-Hexagram and @ColorfulHorse I am having a bit of trouble recreating your issues. Could you try running this Fiddle gist and confirm whether or not you are experiencing the same thing?: Gist |
i will create a gist as soon as possiable |
I am sorry that I am not very good at using gist, |
That's no problem, I was able to use your electron-quick-start fork. (And if anyone else wants to take a look, here is another gist repro: gist) Unfortunately, I still cannot recreate the issue on my end. Perhaps see if you made any other changes when upgrading from version 9 to version 10? Concerning it becoming weird when you change from |
this problem disappeared after upgrade version 9.0.2 to 10.1.1, but i still dont know why |
I can still repro with 10.1.1 using the gist mlaurencin linked above.
Can repro with 12.0.1 as well. In both cases, I have to move the window a little to trigger it. Possibly related to this |
@mlaurencin @lmx-Hexagram @pushkin- I recreate the issue after change system layout scale to 125% this.win = new BrowserWindow({
maximizable: false,
fullscreen: false,
frame: false,
transparent: true,
// focusable: true,
width: this.width,
height: this.height,
minWidth: this.width,
minHeight: this.height,
// maxWidth: this.width,
// maxHeight: this.height,
resizable: true,
movable: true,
closable: true,
skipTaskbar: true,
x: (width - this.width) / 2,
y: height - this.height,
webPreferences: {
nodeIntegration: Boolean(process.env.ELECTRON_NODE_INTEGRATION),
nodeIntegrationInWorker: true,
enableRemoteModule: true,
webSecurity: false
},
show: false
}) |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Repros on Electron 21, though I feel like this issue is a dupe of another one. |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
repros in v22 |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
bump |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
bump |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment! |
Preflight Checklist
Issue Details
In some cases,I need to change the height of the windwo and keep the width the same.
when I use
then width will excatly +1 when I call these code
(in another case,the height will excatly +1 also)
It looks the getContentSize always get 1px more then window.
Even though I can simply -1 after I get the size of the window,I still want kown why
Expected Behavior
window.getContentSize() should return the excat px of the window
Actual Behavior
window.getContentSize() get 1px more on both width and height
To Reproduce
Screenshots
Additional Information
getSize() will behave the same as getContentSize()
The text was updated successfully, but these errors were encountered: