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
{{ message }}
Repository navigation
Electron >= 38.2.0 ignores bounds and places all windows on the "active" screen. setBounds() doesn't work at all. #48833
also should position the window on the first screen at 200,200
Actual Behavior
neither is working since version 38.2.x
with the new versions the electron window is always placed at the active screen (where the mouse cursor resides) in the center.. always centered!
i am using a simple dualscreen setup (primary extended with secondary east)
i have testet electron 38.2 - 40.0.0-alpha.2 - none of them is positiononing the window correctly on kde plasma/wayland
i was afraid so...
unfortunately using ozone-platform x11 isn't a reliable option either...
so this is not a bug - it's a wayland "feature" 👎
the linked platform-notices state that even focus and blur aren't available anymore withou user-input. that's really bad because i heavily rely on those features for a kiosk-like application (which is already hard to implement on multiscreen setups)
does that mean that if i would ask the user if he would like to trigger a bunch of actions like setBounds() and this is triggered right after the user klicks on ok.. would itl work?
It it helps, using ozone-platform=x11 will make all these features work exactly as they did in 38.1. The only difference in 38.2 is the default value of that flag. I understand it sucks to be stuck in X11 mode, but it's how your app and others were working until now, and there's no reason to expect it to stop working any time soon.
does that mean that if i would ask the user if he would like to trigger a bunch of actions like setBounds() and this is triggered right after the user klicks on ok.. would itl work?
This is an interesting question. The docs for xdg_toplevel_move say:
This request must be used in response to some sort of user action like a button press, key press, or touch down event. The passed serial is used to determine the type of interactive move (touch, pointer, etc).
So in principle, it is possible to initiate a move request from a mouse click callback. I do know if this would actually work in practice, or if it would be possible to wire it up across the renderer process in Electron. And even in the best case you would not be able to chain multiple actions or delay handling. Wayland really does try to enforce the user input requirement.
Since you said you are making a kiosk app, another approach you could take is to create a fullscreen window (even a transparent one). Then you can position both web content and views within that window any way you'd like. You'd basically be building your own mini window manager inside of a window.
(Might sound silly but it's actually what Wayland devs recommend and it's not too dissimilar to how GTK apps draw their own window frames on Wayland.)
Activity
mitchchn commentedon Nov 7, 2025
Electron runs in native Wayland mode by default in 38.2, and windows cannot position themselves programmatically on Wayland. Please review: https://www.electronjs.org/docs/latest/api/browser-window#platform-notices.
valueerrorx commentedon Nov 7, 2025
i was afraid so...
unfortunately using ozone-platform x11 isn't a reliable option either...
so this is not a bug - it's a wayland "feature" 👎
the linked platform-notices state that even focus and blur aren't available anymore withou user-input. that's really bad because i heavily rely on those features for a kiosk-like application (which is already hard to implement on multiscreen setups)
does that mean that if i would ask the user if he would like to trigger a bunch of actions like setBounds() and this is triggered right after the user klicks on ok.. would itl work?
mitchchn commentedon Nov 7, 2025
Yeah it's rough. :)
It it helps, using
ozone-platform=x11will make all these features work exactly as they did in 38.1. The only difference in 38.2 is the default value of that flag. I understand it sucks to be stuck in X11 mode, but it's how your app and others were working until now, and there's no reason to expect it to stop working any time soon.This is an interesting question. The docs for
xdg_toplevel_movesay:https://wayland.app/protocols/xdg-shell#xdg_toplevel:request:move
So in principle, it is possible to initiate a move request from a mouse click callback. I do know if this would actually work in practice, or if it would be possible to wire it up across the renderer process in Electron. And even in the best case you would not be able to chain multiple actions or delay handling. Wayland really does try to enforce the user input requirement.
The proposed Zones extension might make this better in the future, but it's still a ways out: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/264.
Since you said you are making a kiosk app, another approach you could take is to create a fullscreen window (even a transparent one). Then you can position both web content and views within that window any way you'd like. You'd basically be building your own mini window manager inside of a window.
(Might sound silly but it's actually what Wayland devs recommend and it's not too dissimilar to how GTK apps draw their own window frames on Wayland.)
nikwen commentedon Nov 7, 2025
Thanks for replying here, @mitchchn! I'll close the issue given that there is nothing we can do about it.
Linux root cause: force X11 on the real command line, not from app code