[WinForms] Fix NotifyIcon not showing in systray on 64bit linux (#16164)
commit69ebdd8b9384d2cdd9fd72458f14fe3a83ade1ef
authorUnknownShadow200 <unknownshadow200@gmail.com>
Mon, 12 Aug 2019 14:09:08 +0000 (13 00:09 +1000)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 12 Aug 2019 14:09:08 +0000 (12 16:09 +0200)
tree6a49d7465310693bd39502910055a7f42f9d9c45
parentdd3f6e0d31a055f616e42561383e0365c8fc6e4c
[WinForms] Fix NotifyIcon not showing in systray on 64bit linux (#16164)

https://bugzilla.xamarin.com/show_bug.cgi?id=14976

Credit goes to datnhanlz for noting that removing XChangeProperty(DisplayHandle, hwnd.whole_window, _XEMBED_INFO, _XEMBED_INFO, 32, PropertyMode.Replace, atoms, 2); would also fix the bug.

Note that the type of Atom is actually unsigned long (see usr/include/X11/X.h), however the code used a C# int for the atoms. As such the code worked without a problem on 32 bit linux, but broke on 64 bit linux.

I switched to using IntPtr instead to make the code also work on 64-bit.
mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs