Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Russell <cody@jhu.edu>2014-05-13 05:08:23 +0400
committerCody Russell <cody@jhu.edu>2014-05-13 05:08:23 +0400
commitf19dbec603d02fbc1b87e90a196714773f004654 (patch)
tree784e6ddcbdbbb6f664b5100a19fda29cfdab21d7 /main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands
parent1337b75d6a46f376de3485e237865b3c1c8845ee (diff)
[Mac] Use native menus for right-click context menus on Mac.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs17
1 files changed, 12 insertions, 5 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
index beca49e70d..df626a8897 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
@@ -36,6 +36,7 @@ using MonoDevelop.Components.Commands.ExtensionNodes;
using Mono.TextEditor;
using Mono.Addins;
using MonoDevelop.Core;
+using MonoDevelop.Ide;
namespace MonoDevelop.Components.Commands
{
@@ -703,12 +704,18 @@ namespace MonoDevelop.Components.Commands
/// <param name='initialCommandTarget'>
/// Initial command route target. The command handler will start looking for command handlers in this object.
/// </param>
- public void ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, CommandEntrySet entrySet,
+ public bool ShowContextMenu (Gtk.Widget parent, Gdk.EventButton evt, CommandEntrySet entrySet,
object initialCommandTarget = null)
{
- var menu = CreateMenu (entrySet);
- if (menu != null)
- ShowContextMenu (parent, evt, menu, initialCommandTarget);
+ if (Platform.IsMac) {
+ return DesktopService.ShowContextMenu (this, parent, evt.X, evt.Y, entrySet);
+ } else {
+ var menu = CreateMenu (entrySet);
+ if (menu != null)
+ ShowContextMenu (parent, evt, menu, initialCommandTarget);
+
+ return true;
+ }
}
/// <summary>
@@ -732,7 +739,7 @@ namespace MonoDevelop.Components.Commands
if (menu is CommandMenu) {
((CommandMenu)menu).InitialCommandTarget = initialCommandTarget ?? parent;
}
-
+
Mono.TextEditor.GtkWorkarounds.ShowContextMenu (menu, parent, evt);
}