diff options
author | abrevet-dev <57099550+abrevet-dev@users.noreply.github.com> | 2019-12-06 20:41:47 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2019-12-06 20:41:47 +0300 |
commit | 4be2a9a20763a232c94c9d0fcbcce877bd7c5474 (patch) | |
tree | 5e65277d7a56936d3aff8c8486a2ecf05c669cec /mcs/class | |
parent | d1db937e78834aac251ed78cb5d44e2d62c7df2a (diff) |
[WinForms] Handle menu for wheel button click (close the contextmenu) (#18049)
Fixes #18019
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs index c92b7a7aae3..ae2526aa514 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/Control.cs @@ -5377,6 +5377,12 @@ namespace System.Windows.Forms } private void WmMButtonUp (ref Message m) { + // Menu handle. + if (XplatUI.IsEnabled (Handle) && active_tracker != null) { + ProcessActiveTracker (ref m); + return; + } + MouseEventArgs me; me = new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()) | MouseButtons.Middle, @@ -5395,6 +5401,12 @@ namespace System.Windows.Forms } private void WmMButtonDown (ref Message m) { + // Menu handle. + if (XplatUI.IsEnabled (Handle) && active_tracker != null) { + ProcessActiveTracker (ref m); + return; + } + InternalCapture = true; OnMouseDown (new MouseEventArgs (FromParamToMouseButtons ((int) m.WParam.ToInt32()), mouse_clicks, LowOrder ((int) m.LParam.ToInt32 ()), HighOrder ((int) m.LParam.ToInt32 ()), |