Setting application icon for Wayland

Our application sets a window icon on the main frame using

self.SetIcon(wx.Icon())

On X11, it seems to use this icon as the application icon when running (taskbar, alt-tabbing, etc). However, on Wayland, it’s just a default blank document icon.

Anyone know how to get this to work on Wayland?

For reference, here’s the issue page I’m trying to debug, might have more useful information: https://github.com/pyfa-org/Pyfa/issues/1607

Thanks!

I believe that you just need to create a .desktop file that includes an "Icon=xyz" line. Then install the .desktop file to /usr/share/applications and run update-desktop-database.

Scott

···

On Fri, 25 May 2018, Ryan Holmes wrote:

Our application sets a window icon on the main frame using
self.SetIcon(wx.Icon())

On X11, it seems to use this icon as the application icon when running
(taskbar, alt-tabbing, etc). However, on Wayland, it's just a default blank
document icon.

Anyone know how to get this to work on Wayland?

For reference, here's the issue page I'm trying to debug, might have more
useful information: Pyfa icon is not shown in linux/wayland session · Issue #1607 · pyfa-org/Pyfa · GitHub

Hi,

After the creation of the main frame add this code:

favicon = wx.Icon(“imgs/logo24.ico”, wx.BITMAP_TYPE_ICO, 128,128)
wx.Frame.SetIcon(self,favicon)

···

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

Are you sure? I just tried with a 128x128 icon, but it did not make a difference on Wayland.

Regards,

Dietmar

···

On 5/28/2018 3:07 AM, Mario Lacunza wrote:

After the creation of the main frame add this code:

favicon = wx.Icon("imgs/logo24.ico", wx.BITMAP_TYPE_ICO, 128,128)
wx.Frame.SetIcon(self,favicon)

Works for me in Ubuntu 16, 18.04 with Gnome and Xubuntu

···

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

and need to be ICO not JPG or PNG just in case…

···

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

But on Ubuntu 16 you usually don't have Wayland and 18.04 is X by default.

The result of 'echo $XDG_SESSION_TYPE' should be 'wayland'.

Regards,

Dietmar

···

On 6/1/2018 4:27 AM, Mario Lacunza wrote:

Works for me in Ubuntu 16, 18.04 with Gnome and Xubuntu

I test it using both and works for me.

···

Enviado desde mi celular LG

El vie., 1 de jun. de 2018 05:15, Dietmar Schwertberger maillist@schwertberger.de escribió:

On 6/1/2018 4:27 AM, Mario Lacunza wrote:

Works for me in Ubuntu 16, 18.04 with Gnome and Xubuntu

But on Ubuntu 16 you usually don’t have Wayland and 18.04 is X by default.

The result of ‘echo $XDG_SESSION_TYPE’ should be ‘wayland’.

Regards,

Dietmar

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

OK, but only on wxPython Classic, which uses gtk2 which runs in X compatibility mode...

So for Phoenix there's no solution yet. But at least that shows that it's technically possible without a .desktop file.

Regards,

Dietmar

···

On 6/1/2018 6:33 PM, Mario Lacunza wrote:

I test it using both and works for me.

Uhm… Im using Phoenix.

···

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru

That's strange.

To be sure:
- you're using the wheel from Index of /wxPython4/extras/linux/gtk3/ubuntu-16.04 ?
- you're not using a custom build with gtk2? (this is available as option and also is the default if gtk3 is not found)
- echo '$XDG_SESSION_TYPE' really returns 'wayland'?

Regards,
Dietmar

···

On 6/1/2018 10:01 PM, Mario Lacunza wrote:

Uhm... Im using Phoenix.

In 18.04 I install all from sources… actually I dont have a 16 version, but the SAME code works in it.

···

Saludos / Best regards

Mario Lacunza
Email:: mlacunza@gmail.com
Personal Website:: http://www.lacunza.biz/
Hosting:: http://mlv-host.com/
Skype: mlacunzav

Lima - Peru