Skip to content

[Bug]: BrowserWindow.getPosition() returns [0, 0] on Wayland #40886

Closed

Description

@threema-danilo

Preflight Checklist

Electron Version

Reproduced with:

  • 28.1.1
  • 29.0.0-alpha.6
  • 38.3.0
  • 39.0.0-beta.3

What operating system are you using?

Other Linux

Operating System Version

Arch Linux with Sway WM (Wayland)

What arch are you using?

x64

Last Known Working Electron version

n/a

Expected Behavior

The BrowserWindow.getPosition() should return the window position on any OS.

Actual Behavior

When starting the application with Wayland support (with Electron 28, you need --ozone-platform-hint=auto --enable-features="WaylandWindowDecorations", with Electron 38 Wayland is used by default), the position returned is always [0, 0].

Testcase Gist URL

https://gist.github.com/threema-danilo/066f28235a408323a460966da82c7f3b

Additional Information

Load and start the Electron Fiddle and look at the console. The position is printed every second.

If you start the fiddle so that X is used (test with xeyes), the position is correct.

screenshot-20240104-180424

If you start the fiddle with Wayland support (default behavior in current versions of Electron), the position is always [0, 0].

screenshot-20240104-180356

Further Links

This may require support for a new Wayland protocol. Probably the ext-zones protocol draft? https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/264

As of October 2025, this is probably not yet fixable, until Wayland specs a protocol for window placement.

Activity

  1. threema-danilo commented on Jan 4, 2024

    @threema-danilo
    Author

    Hmm, this might be tricky: w3c/window-management#68

    Wayland was explicitly designed to prohibit clients from introspecting or programmatically changing their global window coordinates.

    I tend to agree with the notion that the application should not have to deal with window positioning, restoring the window position after re-starting the application should be the job of the window manager or desktop environment. However, on most platforms it actually needs to be handled by the client.

    From a developer point of view, in case it really isn't possible to get access to the coordinates, could we instead get some kind of flag that indicates that position cannot be determined, instead of returning the (potentially valid) position [0, 0]?

  2. moved this to 👀 Unsorted Items in 28-x-yon Jan 4, 2024
  3. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 28-x-yon Jan 10, 2024
  4. electron-issue-triage commented on Apr 4, 2024

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  5. threema-danilo commented on Apr 4, 2024

    @threema-danilo
    Author

    This is still an issue.

  6. electron-issue-triage commented on Jul 4, 2024

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  7. 17 remaining items

  8. electron-issue-triage commented on Oct 16, 2025

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  9. threema-danilo commented on Oct 16, 2025

    @threema-danilo
    Author

    Still an issue. I updated the issue description and the reproducer, now that we're 10 Electron versions into the future.

    Could someone from the Electron team (@codebytere?) re-tag the issue? This is not just an 28-x-y thing. Thanks! 🙏🏻

    Also, is there a way to disable the auto-stale bot for this issue?

  10. electron-issue-triage commented on Jan 15, 2026

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  11. donnybeelo commented on Jan 18, 2026

    @donnybeelo

    Still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions