Closed Voros-Roka closed 2 weeks ago
What is the full error?
Changing the encoing check to allow mmap
may be enough.
If not, then re-using code similar to this function may be needed:
https://github.com/Xpra-org/xpra/blob/83822072dec3038ee30f98f61cffcdc2a8fffca1/xpra/opengl/util.py#L46-L61
Like i already wrote, changing
https://github.com/Xpra-org/xpra/blob/83822072dec3038ee30f98f61cffcdc2a8fffca1/xpra/client/gui/client_tray.py#L241
to
if encoding != "rgb" and encoding != "mmap":
does somewhat work but the drawn icons then look like in the following picture:
But they should look like this (i only have examples for the last two icons):
I think the relevant log entrys are the following:
if encoding != "rgb":
and error
2024-10-24 11:50:25,582 ClientTray(5:connman-gtk).draw_region(0, 0, 47, 47, 'mmap', '1 bytes', 141, typedict({'rgb_format': 'RGB', 'flush': 0}), [<function WindowClient._do_draw.<locals>.record_decode_time at 0x79fb2e963380>])
2024-10-24 11:50:25,582 ClientTray(5:connman-gtk).after_draw_update_tray(False, invalid encoding for tray: 'mmap')
2024-10-24 11:50:25,583 Warning: tray paint update failed: "invalid encoding for tray: 'mmap'"
2024-10-24 11:50:25,583 for 47x47 mmap update with options=typedict({'rgb_format': 'RGB', 'flush': 0, 'encoding': 'mmap'})
if encoding != "rgb" and encoding != "mmap":
and no error
2024-10-24 11:57:23,250 ClientTray(5:connman-gtk).draw_region(0, 0, 47, 47, 'mmap', '1 bytes', 141, typedict({'rgb_format': 'RGB', 'flush': 0}), [<function WindowClient._do_draw.<locals>.record_decode_time at 0x74b70e3dd080>])
2024-10-24 11:57:23,251 ClientTray(5:connman-gtk).after_draw_update_tray(True, )
2024-10-24 11:57:23,251 tray backing=<xpra.client.gui.client_tray.TrayBacking object at 0x74b70c149a00>, data: True
2024-10-24 11:57:23,252 ClientTray(5:connman-gtk).set_tray_icon(RGB, 47, 47, 141, 6627 bytes)
2024-10-24 11:57:23,253 GTKStatusIconTray.get_geometry() <Gtk.StatusIcon object at 0x74b70c14ec80 (GtkStatusIcon at 0x57501e4284f0)>.get_geometry()=(True, screen=<GdkX11.X11Screen object at 0x74b6e9cdb000 (GdkX11Screen at 0x57501c511dd0)>, area=<Gdk.Rectangle object at 0x74b70c19deb0 (GdkRectangle at 0x57501db7bc00)>, orientation=<enum GTK_ORIENTATION_HORIZONTAL of type Gtk.Orientation>)
2024-10-24 11:57:23,254 GTKStatusIconTray.get_geometry() geometry area rectangle=(3503, 2113, 47, 47)
2024-10-24 11:57:23,254 GTKStatusIconTray.get_geometry() <Gtk.StatusIcon object at 0x74b70c14ec80 (GtkStatusIcon at 0x57501e4284f0)>.get_geometry()=(True, screen=<GdkX11.X11Screen object at 0x74b70c170e00 (GdkX11Screen at 0x57501c511dd0)>, area=<Gdk.Rectangle object at 0x74b70c19d850 (GdkRectangle at 0x57501e42b5b0)>, orientation=<enum GTK_ORIENTATION_HORIZONTAL of type Gtk.Orientation>)
2024-10-24 11:57:23,255 GTKStatusIconTray.get_geometry() geometry area rectangle=(3503, 2113, 47, 47)
2024-10-24 11:57:23,255 set_icon_from_pixbuf(<GdkPixbuf.Pixbuf object at 0x74b70e3a0700 (GdkPixbuf at 0x57501dbb6fc0)>) geometry=(3503, 2113, 47, 47), icon size=(47, 47)
2024-10-24 11:57:23,256 GTKStatusIconTray.get_geometry() <Gtk.StatusIcon object at 0x74b70c14ec80 (GtkStatusIcon at 0x57501e4284f0)>.get_geometry()=(True, screen=<GdkX11.X11Screen object at 0x74b6e9cdc440 (GdkX11Screen at 0x57501c511dd0)>, area=<Gdk.Rectangle object at 0x74b70c19d850 (GdkRectangle at 0x57501db7bc00)>, orientation=<enum GTK_ORIENTATION_HORIZONTAL of type Gtk.Orientation>)
2024-10-24 11:57:23,256 GTKStatusIconTray.get_geometry() geometry area rectangle=(3503, 2113, 47, 47)
2024-10-24 11:57:23,257 ClientTray(5:connman-gtk).reconfigure(False) geometry=(3503, 2113, 47, 47)
Just to be sure here are the full logs:
Describe the bug When connecting to a xpra server with mmap and vsock the client tray icons reserve space in the tray but the icons themself do not show up.
To Reproduce Steps to reproduce the behavior:
xpra start :0 --uid=1000 --gid=1000 --mdns=no --exit-with-client=no --exit-with-children=no --exit-with-windows=no --daemon=no --mmap=/sys/devices/pci0000:00/0000:00:08.0/resource2_wc --bind-vsock=auto:2000
XPRA_USE_NATIVE_TRAY=0 xpra attach vsock://4:2000 --mmap=/dev/shm/my-ivshmem --border=red,8 --opengl=no --sharing=yes
System Information (please complete the following information):
Additional context The server runs with xdummy inside a qemu vm. LightDM and AwesomeWM are used on both server and client. I compared the version that last worked for me (I think it was 6.0.2.1) with the version that has the missing icons and could track down the error to commit 5e33862 that changed "xpra/client/gui/client_tray.py" and introduced the function "do_paint_rgb" (and later again changed by commit 260efe0). When xpra is using mmap the function argument "encoding" is set to "mmap" but the function errors out when "encoding" is not "rgb" (happens in line 241). The prev version had no such condition and worked without a problem. I changed the condition to not error out when the encoding is "mmap" and the icons get drawn again but it seems multiple times at slight different positions leaving uncleard pixels behind. I did not investigate further into why they are not drawn right.