Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#51028 - [electron] 1.4.1-2 lost HiDPI ability

Attached to Project: Community Packages
Opened by hexchain (hexchain) - Thursday, 29 September 2016, 02:11 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Thursday, 25 April 2019, 12:01 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Nicola Squartini (tensor5)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:

After upgrading to 1.4.1-2 from 1.4.1-1, electron no longer scales itself to screen DPI.

1.4.1-1 does not have this problem.

Additional info:
$ xdpyinfo | grep -B2 resolution
screen #0:
dimensions: 2560x1600 pixels (338x211 millimeters)
resolution: 192x193 dots per inch

$ xrdb -query | grep Xft.dpi
Xft.dpi: 192

$ pacman -Q electron
electron 1.4.1-2

Steps to reproduce:
1. upgrade to 1.4.1-2
2. start electron (or atom)

There are screenshots.
This task depends upon

Closed by  Bruno Pagani (ArchangeGabriel)
Thursday, 25 April 2019, 12:01 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed a long time ago.
Comment by Nicola Squartini (tensor5) - Thursday, 29 September 2016, 08:14 GMT
What is the output of `gtk-query-settings |grep gtk-xft-dpi`? Is GDK_SCALE set in your environment?
Comment by hexchain (hexchain) - Friday, 30 September 2016, 02:04 GMT
gtk-xft-dpi: 196608

GDK_SCALE is not set.
Comment by Nicola Squartini (tensor5) - Friday, 30 September 2016, 11:10 GMT
That's strange, from I read if GDK_SCALE is unset gtk-xft-dpi should be 98304 (96 dpi) independently on the actual pixel density. Let me also make sure your output of `gsettings get org.gnome.desktop.interface scaling-factor` and are you on X11 or Wayland?
Comment by Nicola Squartini (tensor5) - Friday, 30 September 2016, 13:48 GMT
In fact, could you compile this program and run it?

gcc `pkg-config --cflags gtk+-3.0` gtk-print-scale-factor.c -o gtk-print-scale-factor `pkg-config --libs gtk+-3.0`
Comment by hexchain (hexchain) - Saturday, 01 October 2016, 08:45 GMT
I'm on X11, XFCE4 with AwesomeWM.

I guess this is not very useful outside GNOME?
$ gsettings get org.gnome.desktop.interface scaling-factor
uint32 0

And your gtk-print-scale-factor:
Scale factor: 1
Comment by hexchain (hexchain) - Saturday, 01 October 2016, 08:59 GMT
Tried the above command in "GNOME on Xorg":

$ gsettings get org.gnome.desktop.interface scaling-factor
uint32 0

gtk-print-scale-factor:
Scale factor: 2

And electron correctly scales itself in GNOME.

So I guess it starts to depend on GTK scale factor instead of X dpi settings?
Comment by Nicola Squartini (tensor5) - Sunday, 02 October 2016, 14:11 GMT
Thank you for your feedback, I'll work on a fix as soon as I can. BTW, do other gtk3 applications scale correctly in your environment? Can you try something like evince or gnome-terminal?
Comment by hexchain (hexchain) - Sunday, 02 October 2016, 14:18 GMT
Will do, but I'm afraid that'll be 5 days later.

For now I can only recall that some GTK3 applications (Nemo file manager at least) do not scale at all because of no GDK_SCALE set outside GNOME, but Chromium (and Slack, aur/slack-desktop, which is using a prebuilt electron) scales correctly.
Comment by Narthana Epa (trigtriarius) - Monday, 03 October 2016, 04:59 GMT
I too have this issue, running atom from a KDE environment. My display is 3840x2160 and the scale factor is set to 2 in the KDE display settings. The font dpi is set to 192 in the KDE settings.

Running the commands gives:
gsettings get org.gnome.desktop.interface scaling-factor:
uint32 0

gtk-print-scale-factor:
Scale factor: 1

From the KDE environment, firefox scales fine. However, I installed gnome-terminal, nautilus and gedit and they do not scale. (gnome-terminal was deceptive because the console font seemed fine, but the menus were not)
When I unset the font dpi (to 96) firefox did not scale and nautilus and gnome-terminal, at least, were even smaller.
Comment by Narthana Epa (trigtriarius) - Friday, 07 October 2016, 06:41 GMT
Found a workaround, run it with:

export GDK_SCALE=2 && atom

The same thing does not work with nautilus, gedit or gnome-terminal, with the result either being what appear to be no scaling or 4x scaling. It seems to me that this is a wider problem with the scaling of GTK3 apps outside of gnome.

*edit: you have to unset the font DPI or you will get 4x scaling
Comment by hexchain (hexchain) - Saturday, 08 October 2016, 02:16 GMT
@trigtriarius: or set GDK_DPI_SCALE=0.5 too. But this causes more problem.

@tensor5: just confirmed that GTK3 apps' UI elements does not scale if only X dpi and Xft dpi are set, only text scales.
Comment by Nicola Squartini (tensor5) - Saturday, 08 October 2016, 06:09 GMT
For the people not using GNOME: have you tried

gsettings set org.gnome.desktop.interface scaling-factor 2

?
Comment by hexchain (hexchain) - Saturday, 08 October 2016, 06:11 GMT
No effect on Electron or GTK3 apps.
Comment by hexchain (hexchain) - Tuesday, 01 November 2016, 06:09 GMT
Any update on this? The HiDPI support is still broken in electron 1.4.4-1 outside GNOME.
Comment by Nicola Squartini (tensor5) - Tuesday, 01 November 2016, 16:11 GMT
I could revert it to the state of 1.4.1-1, but this is a bug affecting all GTK3 apps running outside GNOME, so in my opinion we should open a new bug for that.
Comment by hexchain (hexchain) - Wednesday, 02 November 2016, 02:16 GMT
For other GTK3 apps and Chromium (GTK2), the text size changes according to Xft.dpi. For electron that value is useless.

In this case I guess electron should behave like Chromium?
Comment by Nicola Squartini (tensor5) - Sunday, 27 November 2016, 16:47 GMT
@hexchain, can you try electron 1.4.8-2?
Comment by Narthana Epa (trigtriarius) - Monday, 28 November 2016, 23:01 GMT
I can confirm that it respects the DPI set in plasma's system settings now (which is probably Xft.dpi, but I can't be bothered checking).
Comment by Peter Fern (pdf) - Tuesday, 13 December 2016, 03:09 GMT
Broken again in 1.4.12-1
Comment by Bruno Pagani (ArchangeGabriel) - Monday, 27 March 2017, 02:58 GMT
Hi there, so this is probably the issue I’m facing with Riot (Matrix webapp client, using electron). I can’t get it to work correctly with HiDPI, while all others applications on my system behave well.

I’m using the --dpi arg of X to start it at a 192 DPI resolution, and have GDK_SCALE=2 in my profile.
Comment by Bruno Pagani (ArchangeGabriel) - Friday, 02 June 2017, 17:09 GMT
I was advised we can pass “--force-device-scale-factor=2” to electron apps as a workaround. But a fix would be better.

That being said, maybe this would be solved by updating to latest electron, current release in Arch is very old.
Comment by Nicola Squartini (tensor5) - Sunday, 04 June 2017, 03:04 GMT
I'll look into it more deeply once I complete the upgrade to Electron 1.6.
Comment by hexchain (hexchain) - Sunday, 04 June 2017, 03:08 GMT
I don't have this problem anymore, with 1.4.16-2.

~> xrdb -query | grep Xft.dpi
Xft.dpi: 192
~> xdpyinfo | grep -B2 resolution
screen #0:
dimensions: 3200x1800 pixels (847x476 millimeters)
resolution: 96x96 dots per inch

And there are no $GDK_* set.
Comment by Balló György (City-busz) - Friday, 26 January 2018, 12:25 GMT
Is it working for you with the latest electron 1.7.11-1 release?
Comment by Bruno Pagani (ArchangeGabriel) - Friday, 26 January 2018, 13:19 GMT
Does not work for me. Still have to pass “--force-device-scale-factor=2” as arg.
Comment by Balló György (City-busz) - Friday, 26 January 2018, 13:26 GMT
Do we really need this patch? What happens if you rebuild the package without it?
https://git.archlinux.org/svntogit/community.git/tree/trunk/chromium-gtk3.patch?h=packages/electron
Comment by hexchain (hexchain) - Friday, 26 January 2018, 13:50 GMT
It works for me. I'm using XFCE on Xorg.

~ $ xrdb -query | grep Xft.dpi
Xft.dpi: 192
~ $ xdpyinfo | grep -B2 resolution
screen #0:
dimensions: 3200x1800 pixels (846x476 millimeters)
resolution: 96x96 dots per inch

No $GDK_* environment variables set.
Comment by hexchain (hexchain) - Friday, 26 January 2018, 13:51 GMT
It still works if I set GDK_SCALE=2 GDK_DPI_SCALE=0.5 .

Loading...