diff options
author | David Karlaš <david.karlas@xamarin.com> | 2019-05-07 20:25:49 +0300 |
---|---|---|
committer | David Karlaš <david.karlas@xamarin.com> | 2019-05-09 07:02:52 +0300 |
commit | 61aceef1cc0fb65180d3cb32211779d9dcc1c07f (patch) | |
tree | 7d4f9bcd40fe881cd45e0cf9fc29e62cc0d25378 /main/src/addins/MonoDevelop.DesignerSupport | |
parent | ce1a3ab0091a6cd01eb3704a3077e33939a0a268 (diff) |
Changed order of executing `GrabFocus` and executing `OnActivateSelectedItem` for MacToolboxWidget
MouseDownActivated needs to be called before logic activating toolbox item
because MacToolbox uses this event to focus GTK widget that hosts MacToolboxWidget
resulting into stealing focus from toolbox consumer that gains focus when toolbox item is activated
Diffstat (limited to 'main/src/addins/MonoDevelop.DesignerSupport')
-rw-r--r-- | main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/MacToolboxWidget.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/MacToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/MacToolboxWidget.cs index e52c52eb18..eff82d18aa 100644 --- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/MacToolboxWidget.cs +++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/MacToolboxWidget.cs @@ -256,13 +256,16 @@ namespace MonoDevelop.DesignerSupport.Toolbox public override void MouseDown (NSEvent theEvent) { + // MouseDownActivated needs to be called before logic activating toolbox item + // because MacToolbox uses this event to focus GTK widget that hosts MacToolboxWidget + // resulting into stealing focus from toolbox consumer that gains focus when toolbox item is activated + MouseDownActivated?.Invoke (theEvent); + collectionViewDelegate.IsLastSelectionFromMouseDown = true; base.MouseDown (theEvent); if (SelectedItem != null && theEvent.ClickCount > 1) { OnActivateSelectedItem (EventArgs.Empty); } - - MouseDownActivated?.Invoke (theEvent); } public void RedrawItems (bool invalidates, bool reloads) |