Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Tray missing on Ubuntu with data url #38140

Closed
3 tasks done
jijojosephk opened this issue May 2, 2023 · 16 comments
Closed
3 tasks done

[Bug]: Tray missing on Ubuntu with data url #38140

jijojosephk opened this issue May 2, 2023 · 16 comments

Comments

@jijojosephk
Copy link

Preflight Checklist

Electron Version

22.0.0

What operating system are you using?

Ubuntu

Operating System Version

22.04

What arch are you using?

x64

Last Known Working Electron version

21.0.1

Expected Behavior

When application launches tray icon should be visible.

Actual Behavior

Tray icon is not shown.

Testcase Gist URL

No response

Additional Information

DE: Budgie
Distro: Ubuntu Budgie 22.0.02

@jijojosephk
Copy link
Author

// Modules to control application life and create native browser window
const { app, BrowserWindow, Tray, nativeImage } = require('electron')
const path = require('path')
let tray = null;
function createWindow () {
  tray = new Tray(nativeImage.createFromDataURL('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAHYAAAB2AH6XKZyAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAEHZJREFUeJzFm3l8VdW1x7/rnHNvZhKCBIEQRI0i86hAAihSrGgt9hl8lamgBVqrfVCFZ4ePUVvLYNFq2/cUtGXSFqqI0sGKgEAAARGBoFQQEpAxCZlzk3vPWf0jJNzcKYlc9PfX3XuvvfZa666991p77yNcBjw7cXjHOtEnBB0HtAH2iOqvHl2x7W+XY7xLgUSb4YLJ2XeiugxoG9Ckgs54dPm2xdEe81IQVQMsmDh8AOJsB9xhSDyG6fR/5E/bP43muJcCI5rM1HDmEl55gFjHNl5ZlZNjRnPcS4EVTWaGMkCbJ7vRfV38g+9l9EkFvUugK0olItsF+d0thR9vjaZMzSG6HoCWR2o3TfPz27/57S+GjRz9rKCPC/QHUhEyQO9VnC3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3ZsLyBMcOcI9wGbvrIHiW7TS/v4oBPyiBAkyP0jIdZvZ7bVds5+cTLsewUR7QBf4YtMt+klyVWF4b9KihBuDXh+x4Q2qN7ZmjGKnIs53aFD+48ohH8ip/IpfIUGCAXTisWyQr+oqfEZo4nw3CYU8n2HG5Olg7t2F0WiVbFfh6/ZACAQJmxQJPRRUwSccorY7v2Y6rqa2vPFJX0jkG6cu2z7ToiCAY61r/IS/jzuS0GhNt6y1yF81tq+B3yH7XdPbLwDeB4IvilV9qqXiQ3FS/eA1att0GZvJeVCCt2iTFr06MNDVpZrTOxgUfkFEO69T3BX9Mnv5bz43pzleY9VX5PXzTB0pKjmirJQlHuT4z03zv1z3smL9FFA1/6Tnwd5KFx7j64pXNs5kYryYuISr2DnJ+coKvOEI0eV7MK9S/P86+ZvnTRIRSaKci9wZYhudQJPzMle9nRrZI+KAdL7Tu5sGnKAgDQ2Mc5iwYybGNarQxN6T53N79bks+Ldw8HMlHUFe5d+K9xYq1blmJ+nx45G5XaUGwykVlX3iCHL52QtPdJa2aOWDGX0n3KrKGuQiw+kfv39G7n9pvSwfZ5Yuoc1W475V+2x66xvnMh/uXUBwyUgartA4UdL3zNVBwF/BWozO7eJqDzA1Nuva/h5WlVz7djq7K9SebhMz+U79JmUkDsubXrHNjqpOdqleaVT16zJ2A/RP0doCaL8yUw9zuxbXlXRL7usQrXZZzWDYn2n1/DK16I8fO2B0NePy2YAdVr2Ft5tteAi4TLiMnqAFLeAyFvlKQt7K/VV4LIZwG25NgMRvyME/pm7uvkvQS4nLpsBZv1pU6mq/g+Evc0qstVp7uuOy47L+g3v+n3H997aN32HqHRDSKN+1ykB3rBN+7uPLdvx+eUcvyX4Dz+uTcg44HPfAAAAAElFTkSuQmCC'));
  // Create the browser window.
  const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js')
    }
  })


  // and load the index.html of the app.
  mainWindow.loadFile('index.html')

  // Open the DevTools.
  // mainWindow.webContents.openDevTools()
}

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
  createWindow()

  app.on('activate', function () {
    // On macOS it's common to re-create a window in the app when the
    // dock icon is clicked and there are no other windows open.
    if (BrowserWindow.getAllWindows().length === 0) createWindow()
  })
})

// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function () {
  if (process.platform !== 'darwin') app.quit()
})

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

@codebytere codebytere changed the title [Bug]: [Bug]: Tray missing on Ubuntu with data url May 3, 2023
@jijojosephk
Copy link
Author

@codebytere it's not specific to data url. The same is with file path also.

@Zen33
Copy link

Zen33 commented May 5, 2023

same issue in production mode.

@awilkins
Copy link

awilkins commented May 11, 2023

Suspect this might be linked to desktop environment, @jijojosephk - do any of the apps for ....

  • Discord
  • Slack
  • Element

Exhibit the same problem on Budgie?

Tray icons for all of these are absent for me, I suspect (may be wrong) because Electron has moved to the KDE StatusNotifierItem implementation with no fallback to libindicator and my desktop (Unity) doesn't implement StatusNotifierItem AFAICT.

@jijojosephk
Copy link
Author

Yes, Discord and Element do face the same issue and possibly Slack too. I tried to find something my own in electron repo and could see something changed for Tray Icon. I wonder why such a move when from libappindicator. At least it should support both libappindicator and KDEStatusNotifierItem unless it's something with the chromium. I'm not sure this is not widely discussed but to me it's a major breaking change.

@awilkins
Copy link

I think Chromium have been trying to remove it since 2014...

@jijojosephk
Copy link
Author

@awilkins it could be a chromium problem as well then. Thanks for letting me know. Any idea, how to fix? or only a desktop environment can fix the problem?

@awilkins
Copy link

awilkins commented May 14, 2023

Looks like an update to a newer version of Electron may fix it?

#36602 is closed and links to
#36815

Edit : updated my very basic Electron Tray test project to 24.3.0 ; still not working on Unity (works fine on GNOME Shell).

This version has the fallback patch linked above in it, so either the fallback patch is broken or GtkStatusIcon isn't supported on my desktop (Unity).

Quite an old comment but seems like it might not be

@jijojosephk
Copy link
Author

Not fixed for me.

@jijojosephk
Copy link
Author

@awilkins budgie has an applet today I noticed. I installed and now I can see the tray icon. I think now, they fixed the tray icon implementation toKStatusNotifierItem. So the desktop environment does not have it, probably fail showing tray icons.

image

@jijojosephk
Copy link
Author

@jijojosephk
Copy link
Author

jijojosephk commented May 24, 2023

But it's not maintained. Last build was in 2018, also buggy.

@tamer-hassan
Copy link

Tray icons for all of these are absent for me, I suspect (may be wrong) because Electron has moved to the KDE StatusNotifierItem implementation with no fallback to libindicator and my desktop (Unity) doesn't implement StatusNotifierItem AFAICT.

@awilkins Unity7 (in Ubuntu Unity 22.04/23.04) does support SNI via libayatana*
The issue is with updated XDG_CURRENT_DESKTOP environment variable. There's a temporary workaround which I detailed here, until this is supported by Electron (hopefully): #38979

@jijojosephk
Copy link
Author

The problem is more with chromium project than electron. I feel now the responsibility is with individual desktop environments on app indicator implementation. I'm on Ubuntu budgie and had raised a defect. That's resolved now. Not sure that's uploaded to upstream projects.

@electron-issue-triage
Copy link

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!

@electron-issue-triage
Copy link

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

@electron-issue-triage electron-issue-triage bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants