Gaurav
Gaurav

Reputation: 1294

How to avoid windows zoom in electron app

If the Windows display zoom is set to 150%, the Electron app also appears zoomed. I want my app to avoid the windows zoom level and always display in 100% zoom only.

I have tried the zoomFactor:1 but it's not working.

enter image description here

Upvotes: 7

Views: 4587

Answers (1)

Gaurav
Gaurav

Reputation: 1294

As per @hijleh suggestion, adding the following lines in the main process has resolved the issue. The app is now avoiding the Windows display zoom.

app.commandLine.appendSwitch('high-dpi-support', 1)
app.commandLine.appendSwitch('force-device-scale-factor', 1)

Upvotes: 9

Related Questions