TTrayIcon at times do not showing the icon properly. Cannot get ON_PAINT working lazarus / 31-LCL ---------------------------------------------------------------------- Nevada Smith · 2024-10-20 08:57 I have a strange problem with TTrayIcon which happens only in Linux (XFCE & LXDE). Occasionally the tray icon gets set to an error icon (please see the attachment). Roughly 75% of the time the icon shows up okay, rest of the time the error icon is shown. I am periodically changing the TrayIcon, although this is not animation. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i tiMain.Icon.Assign(FTrayProgressIcons[Index + 1].Bitmap); I tried tiMain.ShowIcon:= False; but this seem to do nothing. OnPaint event does not get triggered. Any pointers on how to get OnPaint event get working. Also, how do I invalidate the icon so that OnPaint gets triggered.Alternatively, what is wrong with what I am doing - Icon.Assign? Any tweaks which would get it to work in XFCE & LXDE? ---------------------------------------------------------------------- Nevada Smith · 2024-10-20 09:22 export LAZUSEAPPIND=NO fixed the problem. Now I have to see if I need to use UnityWSCtrls.GlobalUseAppInd as mentioned at https://wiki.freepascal.org/How_to_use_a_TrayIcon..