Skip to content

tray displayBalloon does not work well #5844

Closed

Description

@horious
  • Electron version: after 1.1.2
  • Operating system: Windows

It works well up to version 1.1.1.
Since version 1.1.2 displayBalloon does not work well. Especially when multiple asynchronous operations are made at the same time displayBalloon often ignored.

        setInterval(function(){
            tray.displayBalloon({
                title:'hello',
                content:'world'
            });    
        },3000);

Activity

  1. added
    blocked/need-info ❌
    on Jun 3, 2016
  2. zcbenz commented on Jun 3, 2016

    @zcbenz
    Contributor

    Did you pass icon to the balloon? And have you tried v1.2.1?

  3. horious commented on Jun 4, 2016

    @horious
    Author

    I found new information.
    If I run electron with --debug option. displayBalloon does not work well
    It occurs in version 1.2.1 too.

  4. zcbenz commented on Jun 6, 2016

    @zcbenz
    Contributor

    Can you provide a minimal app that can reproduce this problem?

  5. dataich commented on Jun 15, 2016

    @dataich
    Contributor

    Same things on 1.1.3 😢

  6. djpereira commented on Jun 27, 2016

    @djpereira
    Contributor

    @zcbenz I have the same issue.
    I am using Windows 10 and electron 1.2.5.
    Here's a very simple example: https://github.com/djpereira/electron-quick-start/tree/tray-balloon-issues
    The weird thing is that it works at the beginning, however as you switch to other windows back and forth and keep trying, at some point the notifications stop showing up.
    I am not sure about the exact pattern, but after switching around and resizing a few windows, the issue happens.

  7. djpereira commented on Jun 27, 2016

    @djpereira
    Contributor

    An additional thing that I noticed is that if I set the icon either via a string or a nativeImage, it just never works.

      ipcMain.on('display-balloon', (event, title, content) => {
        const nativeImage = require('electron').nativeImage;
        let image = nativeImage.createFromPath('icon.ico');
        tray.displayBalloon({ title: title, content: content, icon: image });
        console.log(`displaying balloon ${title} ${content}`);
      });
    

    The code executes with no errors, but nothing happens. As @horious mentioned, it seems to work well with 1.1.1.

    I don't know if it is relevant but my screen is set to 150% DPI.

  8. wangxiexe commented on Jun 28, 2016

    @wangxiexe

    I also found this issue, it stopped work after showing 5 messages on my win10.

  9. added and removed
    blocked/need-info ❌
    on Jun 29, 2016
  10. zcbenz commented on Jul 2, 2016

    @zcbenz
    Contributor

    Hmm I don't know why but I can not reproduce this on either Windows 10 or 8.1.

  11. djpereira commented on Jul 2, 2016

    @djpereira
    Contributor

    @zcbenz let me see if I can put together more consistent repro steps.

  12. sloom commented on Jul 8, 2016

    @sloom

    I also confirm this on 1.2.6 on Windows 7 (64bit)

  13. 9 remaining items

  14. Apteryx0 commented on Apr 25, 2017

    @Apteryx0

    For me changing my .ico files to .png did not work, however, calling setImage immediately before displayBalloon does....

    Update: I take it back - that only worked once so it is probably unrelated...

  15. kczx3 commented on Jun 20, 2017

    @kczx3

    I can confirm that this still does not function when a .ico file is used for the icon. If I omit that, the balloon works and actually uses the application's icon, albeit a horrendously pixelated version of it. Using Windows 10.

  16. GorvGoyl commented on Nov 14, 2017

    @GorvGoyl

    I'm on electron 1.8.1 and tray balloon doesnt work from async calls. tried setting the icon to png/ico but no balloon.

  17. insideGen commented on Nov 15, 2017

    @insideGen
    Contributor
    • Electron version: 1.8.1
    • Operating system: Windows 10 (64 bits)

    The following code works correctly: when a click event is detected, the balloon appears.

    appTray.on("click", function (event, bounds) {
      appTray.displayBalloon({
        title: "Tray icon",
        content: "Click event"
      });
    });

    The following code works incorrectly: when an update event is detected, log.info() works but appTray.displayBalloon() doesn't.

    autoUpdater.on("update-available", function (info) {
      log.info("update-available", info);
      appTray.displayBalloon({
        title: "Update",
        content: "Available"
      });
    });

    If I add the icon property inside the balloon object, it's work fine. But the icon needs to be a .png format, not .ico.

    autoUpdater.on("update-available", function (info) {
      log.info("update-available", info);
      appTray.displayBalloon({
        icon: path.join(__dirname, "./appIcon.png"),
        title: "Update",
        content: "Available"
      });
    });
  18. damianobarbati commented on May 31, 2018

    @damianobarbati

    I have a problem similar to @ralphstodomingo but I'm always using pngs.

    If I call tray.displayBalloon, it doesn't show up. Calling it again it shows up. And so on.

  19. redplane commented on Jun 29, 2018

    @redplane

    Same to me.

    I added icon in displayBalloon as @insideGen said and it works. Without icon, tray message cannot be displayed.

  20. codebytere commented on Sep 23, 2018

    @codebytere
    Member

    Given that there exist workarounds for this, and that this isn't currently on our roadmap, i'm going to go ahead and label this a wontfix. However, should someone determine a workable solution we would be very open to accepting a PR!

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions