diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2012-04-19 14:08:03 +0400 |
---|---|---|
committer | Lluis Sanchez <lluis@xamarin.com> | 2012-04-19 14:08:03 +0400 |
commit | 0b616b6f00ed85def19e639cfbfba93e75f02549 (patch) | |
tree | 791e2b48d5942a4990dc60eb48842197f90f974a /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs | |
parent | 582c5fc2d57d16fef6b882992c1948ea0450d91d (diff) |
Added workaround method for getting the current key modifiers
Gtk.Global.GetCurrentEventState only works when run inside a handler of a gtk event.
On mac, the global menu is not implemented in GTK, so when a menu command is
run, there is no current GTK event, so GetCurrentEventState doesn't return
the correct result. I added a workaround implementation which uses NSEvent when
running in mac, which will always return the correct result, no matter if we are handling
a GTK or a Cocoa event.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs index b2b2a828eb..66d8222ea1 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs @@ -338,8 +338,8 @@ namespace MonoDevelop.Ide.Commands protected override void Run (object dataItem) { string filename = (string)dataItem; - Gdk.ModifierType mtype; - bool inWorkspace = Gtk.Global.GetCurrentEventState (out mtype) && (mtype & Gdk.ModifierType.ControlMask) != 0; + Gdk.ModifierType mtype = Mono.TextEditor.GtkWorkarounds.GetCurrentKeyModifiers (); + bool inWorkspace = (mtype & Gdk.ModifierType.ControlMask) != 0; IdeApp.Workspace.OpenWorkspaceItem (filename, !inWorkspace); } } |