Skip to content

[Wayland toplevel icon protocol] icon parameter for BaseWindow doesn't work #49285

Closed

Description

@alexsch01

Preflight Checklist

Electron Version

39.2.7

What operating system(s) are you using?

Other Linux

Operating System Version

Fedora 43

What arch are you using?

x64

Last Known Working Electron version

never worked

Does the issue also appear in Chromium / Google Chrome?

No

Desktops Affected

KDE Plasma 6.3+ OR labwc 0.90+ (they both have toplevel icon protocol for Wayland)

Expected Behavior

I expected both cases in "Additional Information" section to both display the icon

Actual Behavior

this does not work to display the icon

const win = new BaseWindow({
  width: 800,
  height: 600,
  icon: myIcon,
})

this does work to display the icon, but both cases should work

const win = new BaseWindow({
  width: 800,
  height: 600,
})

win.setIcon(myIcon)

Testcase Gist URL

No response

Additional Information

Try the following code with // icon: myIcon, or // win.setIcon(myIcon) uncommented

const { app, BaseWindow } = require('electron')

app.whenReady().then(() => {
  const myIcon =  'icon.png'

  const win = new BaseWindow({
    width: 800,
    height: 600,
    // icon: myIcon,
  })

  // win.setIcon(myIcon)
})

Activity

  1. added theissue type on Dec 30, 2025
  2. moved this to 👀 Unsorted Items in 39-x-yon Dec 30, 2025
  3. nikwen commented on Dec 30, 2025

    @nikwen
    Member

    Thanks for opening this issue!

    What's the reason for closing the existing issue #45638 and marking it as replaced by this one?

  4. added
    blocked/need-info ❌
    on Dec 30, 2025
  5. alexsch01 commented on Dec 30, 2025

    @alexsch01
    ContributorAuthor

    I realized top-level icon protocol was working since it inherited it from chromium code

  6. removed
    blocked/need-info ❌
    on Dec 30, 2025
  7. changed the title [-][Wayland] win.setIcon works but icon parameter for BrowserWindow doesn't work[/-] [+][Wayland toplevel icon protocol] win.setIcon works but icon parameter for BrowserWindow doesn't work[/+] on Dec 30, 2025
  8. changed the title [-][Wayland toplevel icon protocol] win.setIcon works but icon parameter for BrowserWindow doesn't work[/-] [+][Wayland toplevel icon protocol] icon parameter for BaseWindow doesn't work[/+] on Jan 1, 2026
  9. alexsch01 commented on Jan 1, 2026

    @alexsch01
    ContributorAuthor

    Made the example smaller and replaced BrowserWindow with BaseWindow


    Used electron/build-tools to build the electron source code

    In electron/src/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc

    https://github.com/chromium/chromium/blob/a5f7d6da96c4c6d476a301909ccf27a4e76aa261/ui/ozone/platform/wayland/host/wayland_toplevel_window.cc#L331-L335

    xdg_toplevel_ is NULL when this issue happens

  10. nikwen commented on Jan 2, 2026

    @nikwen
    Member

    Thanks for explaining, @alexsch01, and for working on a PR!

    Could you restore the previous text on #45638 from the edit history and instead leave a comment explaining why you closed the issue? That's much better for historical context when someone looks at the issue in the future. Thank you! :)

  11. alexsch01 commented on Jan 2, 2026

    @alexsch01
    ContributorAuthor

    Done!

  12. alexsch01 commented on Jan 3, 2026

    @alexsch01
    Author
  13. nikwen commented on Jan 3, 2026

    @nikwen
    Member

    Thanks for updating the old issue!

    We'd leave the component/BaseWindow tag on this issue because that's the part of Electron that's affected. It doesn't matter which file the change is made in. BaseWindow is where the app developer will experience the issue. :)

  14. alexsch01 commented on Jan 6, 2026

    @alexsch01
    ContributorAuthor

    @nikwen who could be assigned for the PR? I'm sorry I haven't contributed to Electron before

  15. moved this from 👀 Unsorted Items to 👍 Does Not Block Stable in 39-x-yon Jan 7, 2026
  16. alexsch01 commented on Jan 8, 2026

    @alexsch01
    ContributorAuthor

    I just signed my commit

  17. nikwen commented on Jan 9, 2026

    @nikwen
    Member

    @alexsch01 Nobody is assigned to PRs on the Electron repository.

    When maintainers have time, they pick PRs they want to review. Someone should get to it soon. Due to the quiet period during December, there is currently a large backlog of PRs to go through, so it might take a little bit longer than usual.

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

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions