diff options
author | UnknownShadow200 <unknownshadow200@gmail.com> | 2019-08-12 17:09:08 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-08-12 17:09:08 +0300 |
commit | 69ebdd8b9384d2cdd9fd72458f14fe3a83ade1ef (patch) | |
tree | 6a49d7465310693bd39502910055a7f42f9d9c45 /mcs/class/System.Windows.Forms | |
parent | dd3f6e0d31a055f616e42561383e0365c8fc6e4c (diff) |
[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.
Diffstat (limited to 'mcs/class/System.Windows.Forms')
-rw-r--r-- | mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs index 8b90abdd4c2..cde5f7ae773 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/XplatUIX11.cs @@ -6215,9 +6215,9 @@ namespace System.Windows.Forms { XSetWMNormalHints(DisplayHandle, hwnd.whole_window, ref size_hints); - int[] atoms = new int[2]; - atoms [0] = 1; // Version 1 - atoms [1] = 1; // we want to be mapped + IntPtr[] atoms = new IntPtr[2]; + atoms [0] = (IntPtr)1; // Version 1 + atoms [1] = (IntPtr)1; // we want to be mapped // This line cost me 3 days... XChangeProperty(DisplayHandle, hwnd.whole_window, _XEMBED_INFO, _XEMBED_INFO, 32, PropertyMode.Replace, atoms, 2); |