You are not logged in.

#1 2024-10-30 11:53:23

cbrnr
Member
Registered: 2016-11-15
Posts: 17

Electron apps cannot be resized when running on Wayland

I'm running GNOME on Wayland using fractional scaling, so to avoid blurry rendering (which affects all apps on XWayland), I set the following Electron flag for my Electron apps:

--ozone-platform-hint=auto

Apps that support this flag are then rendered by Wayland natively, which means they appear crisp on my fractional scaling desktop. However, many Electron apps have stopped resizing via mouse, i.e., when I hover over the border or corner of a window, the mouse cursor does not even change and therefore I cannot resize the window.

FWIW, I've tried adding more flags such as

--ozone-platform=wayland

and/or

--enable-features=WaylandWindowDecorations

However, these do not seem to have any effect.

Currently, Visual Studio Code, Discord, and Signal are affected by this behavior, but Google Chrome and RStudio work normally.

Any ideas why this might be happening? BTW, I do know that I can resize any window on GNOME with the Alt+F8 shortcut, but this is a really cumbersome workaround.

Last edited by cbrnr (2024-10-30 13:22:11)

Offline

#2 2024-10-30 12:58:14

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: Electron apps cannot be resized when running on Wayland

Apps that support this flag are then rendered by Wayland natively

Nope. Not necessarily.
https://wiki.archlinux.org/title/Chromi … er_Wayland
https://wiki.archlinux.org/title/Waylan … s_visually

when I hover over the border or corner of a window, the mouse cursor does not even change … I can resize any window on GNOME with the Alt+F8 shortcut

Idk about gnome, but usually WMs allow you to resize windows w/ some mouse button shortcut, typically Alt+RMB or Win+RMB
Other than that, are the clients configured to use their internal decoration? What if you use the system titlebar instead?

Edit: https://bbs.archlinux.org/viewtopic.php?id=292623 (for VS Code)

Last edited by seth (2024-10-30 13:01:30)

Offline

#3 2024-10-30 13:19:33

cbrnr
Member
Registered: 2016-11-15
Posts: 17

Re: Electron apps cannot be resized when running on Wayland

The apps I mentioned do run on Wayland natively (as verified by e.g. xeyes). The additional flag for VS Code does not change anything. Clients are configured to use the native titlebar. If I set VS Code to use a custom titlebar, resizing works, but I do not get any window borders or shadows, which makes it really hard to see when other windows are also open. I did find a GNOME shortcut for resizing windows with Super + right-click, which can be enabled in Tweaks. This is at least a viable workaround, but I'd still prefer that resizing just worked as expected. Could this be due to some Electron update? About one or two weeks ago, resizing worked fine in VS Code (whereas Discord has not worked for much longer).

Offline

#4 2024-10-30 13:20:58

cbrnr
Member
Registered: 2016-11-15
Posts: 17

Re: Electron apps cannot be resized when running on Wayland

Oh, and I completely forgot to mention that Google Chrome works just fine!

Offline

#5 2024-10-30 13:30:29

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: Electron apps cannot be resized when running on Wayland

but what about https://archlinux.org/packages/extra/x86_64/code/

https://aur.archlinux.org/packages/visu … o-code-bin comes w/ a bunlded electron version (god knows which) and indeed was updated only yesterday (are you currently running 1.95.0-1 ?)

Offline

#6 2024-10-30 13:55:22

cbrnr
Member
Registered: 2016-11-15
Posts: 17

Re: Electron apps cannot be resized when running on Wayland

Yeah, I do use the current 1.95.0-1 AUR package. I'm a bit hesitant to try the open-source version (I don't want to lose my settings), but I will try it and report back. But this does not explain why Discord is not working, since it should use the shipped Electron AFAIK.

Offline

#7 2024-10-30 14:03:08

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: Electron apps cannot be resized when running on Wayland

https://archlinux.org/packages/extra/x86_64/discord/ is a binary bundle provided by upstream that ships its own chrome-sandbox and opengl libraries…

It is however irritating that gnome allows you to resize these windows w/ various shortcuts but apparently doesn't add the handles to the frame.
Do you get resize handles for gtk3-demo ?

Offline

#8 2024-10-30 14:08:00

cbrnr
Member
Registered: 2016-11-15
Posts: 17

Re: Electron apps cannot be resized when running on Wayland

OK, I didn't know that, so it could really be due to some Electron behavior that packages ship in their own sandbox. And yes, gtk3-demo works fine, as do all other apps I have been trying. It only affects Electron apps.

Offline

#9 2024-10-30 14:18:14

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: Electron apps cannot be resized when running on Wayland

There've been related bugs in electron (like, 2 years ago…), it could be that those binary blobs only now run into the affected versions.
Another sanity check: xterm is fine?

The OSS code version aside you could also just try to downgrade the AUR package to, I guess,  1.93.1 and see whether that fixes it.

Offline

#10 2024-10-31 09:42:18

cbrnr
Member
Registered: 2016-11-15
Posts: 17

Re: Electron apps cannot be resized when running on Wayland

xterm works fine. I downgraded Visual Studio Code and found that it worked up until 1.94.2, so the current 1.95.0 is the first version where resizing stopped working. So it is indeed very likely that they upgraded Electron to a version which is buggy in this regard. Now the question is: where do I report this issue?

Edit: I commented in this issue, as this seems related (but not really identical). Let's see if they can at least point me to a better location, but it seems like this bug has indeed been introduced with Electron 32 (resizing worked up until Electron 31).

Last edited by cbrnr (2024-10-31 10:04:15)

Offline

#11 2024-11-15 01:45:54

bbsdragon
Member
Registered: 2021-08-15
Posts: 1

Re: Electron apps cannot be resized when running on Wayland

I found a workaround for gnome, when Visual Studio Code is focused, press Alt-F8. Then you can resize either by moving the mouse or using the arrow keys.

Offline

#12 2024-11-15 07:41:19

seth
Member
Registered: 2012-09-03
Posts: 59,045

Re: Electron apps cannot be resized when running on Wayland

cbrnr wrote:

I did find a GNOME shortcut for resizing windows with Super + right-click, which can be enabled in Tweaks.

and that's pretty much a stadard feature of all adult windowmanagers.

Offline

Board footer

Powered by FluxBB