You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Windows, having high DPI for lower quality and bigger font and icon size in general. and since Chrome 36 upgrade, I'm using chrome with --force-device-scale-factor=1 to reset pixels to the actual size of a pixel in the browser. but how can I set this for atom-shell's?
For what it's worth, if you do something like gsettings set org.gnome.desktop.interface scaling-factor 2 it does have an effect on Atom. Unfortunately it appears that scaling-factor key is an int32 value in gsettings, so you can only get increments of 100%, and if your environment already has Xft.dpi set to an appropriate value for your display (via .Xresources or .fonts.conf or perhaps automatically by the X server), then some of Atom's UI elements will end up scaled twice. The menus in particular are affected by this, and end up being gigantic with their contents overrunning the edges of the panels.
I think Chromium is finally getting hidpi support straightened out on Linux as of version 43, so it may be worth taking another look at their implementation at some point.
Interesting, my distribution handles DPI somewhere else. Setting that just makes atom interface components inconsistently sized (0.5x-8x). I've been waiting for chromium HiDPI support for years, I can wait a bit longer.
@niedzielski Word, I'll give it a try. Though I'm confused, is it for the atom text editor or to be used in electron apps in general? I'm dealing with the latter
Electron does not support Atom packages. But im pretty sure you can still use require('web-frame').setZoomFactor(), which is what atom-hidpi uses. I haven't used electron so I do not know where you would put that code.
@mcanders Right, so for an app that would be distributed to people, how would one do this automagically? I'm thinking that my laptop has a 3200x1800 and that I could do something like:
x = zoom factor = floor( log_base_2( size / (800_600) ) )... or basically the lowest log_base_2 of how many 800_600 screens fit in the actual resolution.
So the app would be x1 on a 800x600 screen, x2 on a 1600x1200 screen... and for my high dpi screen size of 3200x1800, it would be x3? Yeah that works.
That seems right. But if you are distributing this app, I would provide some configuration options. Resolution isn't a great indicator of DPI and there is no surefire way to get the correct dpi value on all platforms. But that seems like good default behavior.
@tgy your issue is probably related to the implementation of the software you're using, because I can confirm that Visual Studio Code (which uses electron) is clearly supporting high dpi.
Activity
zcbenz commentedon Sep 8, 2014
Steps to implement this:
enable_hidpiflag in libchromiumcontent--force-device-scale-factor=2Problems:
geminorum commentedon Oct 1, 2014
In Windows, having high DPI for lower quality and bigger font and icon size in general. and since Chrome 36 upgrade, I'm using chrome with
--force-device-scale-factor=1to reset pixels to the actual size of a pixel in the browser. but how can I set this for atom-shell's?Nek- commentedon Mar 12, 2015
Looks like it doesnt work at all...
Dell XPS 2014 / Ubuntu 14.04 (well configured for hidpi of course)
summer4096 commentedon Mar 22, 2015
Same as above. This fixes it, but I wish it didn't:
niedzielski commentedon Apr 6, 2015
I'm not sure what the recommended configuration is but @devtristan's snippet seems to work well.
summer4096 commentedon Apr 6, 2015
Updated to handle overlays properly (jshint etc):
benley commentedon Apr 6, 2015
For what it's worth, if you do something like
gsettings set org.gnome.desktop.interface scaling-factor 2it does have an effect on Atom. Unfortunately it appears that scaling-factor key is an int32 value in gsettings, so you can only get increments of 100%, and if your environment already hasXft.dpiset to an appropriate value for your display (via.Xresourcesor.fonts.confor perhaps automatically by the X server), then some of Atom's UI elements will end up scaled twice. The menus in particular are affected by this, and end up being gigantic with their contents overrunning the edges of the panels.I think Chromium is finally getting hidpi support straightened out on Linux as of version 43, so it may be worth taking another look at their implementation at some point.
summer4096 commentedon Apr 6, 2015
Interesting, my distribution handles DPI somewhere else. Setting that just makes atom interface components inconsistently sized (0.5x-8x). I've been waiting for chromium HiDPI support for years, I can wait a bit longer.
niedzielski commentedon Apr 9, 2015
@benley neat. I see the same behavior on Xubuntu you described. I think I'll stick with @devtristan's solution for the time being. Thanks!
cart commentedon Apr 10, 2015
Zooming the interface is the best approach I found (https://discuss.atom.io/t/how-to-set-the-font-for-the-settings-ui-and-the-command-browser/13498/4). I made this addon and it has been working pretty well for me https://atom.io/packages/hidpi.
summer4096 commentedon Apr 10, 2015
👍
Nice addon.
If you don't need automatic switching, you can open the command palette and type "init script" then add this line to the bottom:
This works better than the
zoom: 2trick. Needs an atom restart to take effect, though.Mingling94 commentedon Jun 28, 2015
@zcbenz Sorry if this is rather ignorant, but I've been trying to find out how to perform the below steps to no avail:
Is this
electron ./orelectron app/for my case?I'm having trouble understanding what this means.
Same 3 options as the first quoted line.
niedzielski commentedon Jun 28, 2015
FWIW, I've since switched to using the HiDPI package and it works well for me.
Mingling94 commentedon Jun 28, 2015
@niedzielski Word, I'll give it a try. Though I'm confused, is it for the atom text editor or to be used in electron apps in general? I'm dealing with the latter
niedzielski commentedon Jun 29, 2015
@Mingling94, sorry! I was thinking Atom. I do not know if the HiDPI package supports Electron apps but I would guess not.
cart commentedon Jun 29, 2015
Electron does not support Atom packages. But im pretty sure you can still use require('web-frame').setZoomFactor(), which is what atom-hidpi uses. I haven't used electron so I do not know where you would put that code.
Mingling94 commentedon Jun 29, 2015
@mcanders Right, so for an app that would be distributed to people, how would one do this automagically? I'm thinking that my laptop has a 3200x1800 and that I could do something like:
x = zoom factor = floor( log_base_2( size / (800_600) ) )... or basically the lowest log_base_2 of how many 800_600 screens fit in the actual resolution.
So the app would be x1 on a 800x600 screen, x2 on a 1600x1200 screen... and for my high dpi screen size of 3200x1800, it would be x3? Yeah that works.
cart commentedon Jun 29, 2015
That seems right. But if you are distributing this app, I would provide some configuration options. Resolution isn't a great indicator of DPI and there is no surefire way to get the correct dpi value on all platforms. But that seems like good default behavior.
Zeioth commentedon Sep 23, 2021
Does this work? I don't seem to be able to scale stremio or franz (the two electron apps I use) with this.
choucavalier commentedon Feb 20, 2022
i don't understand why this issue is closed as HiDPI support clearly does not work yet 😕
Nek- commentedon Feb 20, 2022
@tgy your issue is probably related to the implementation of the software you're using, because I can confirm that Visual Studio Code (which uses electron) is clearly supporting high dpi.
choucavalier commentedon Feb 20, 2022
@Nek- thx! was actually trying to run signal-desktop under Wayland. HiDPI does not work well with Wayland but works with Xorg...
Nek- commentedon Feb 21, 2022
@tgy there are indeed a lot of issues with wayland : https://github.com/electron/electron/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+wayland 😅