Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit a6110a5

Browse files
committed
Fix 988924: Some commands (save, undo) do not work if editor is detatched from IDE into its own window
Problem is that when command comes in, it first goes to CocoaTextViewControl and then up NSView treeview, problem starts when migrating to GTK treeview because GtkNSViewHost is not set as it should be, after debugging why this happens it appears that `GetFocusedChild` method wasn't returning `GtkNSViewHost` as expected, upon further debugging it turns out thats because logic of drilling down GTK treeview doesn't work because `GetFocusedChild` parameter is `NSWindow` instead of `GtkWindow`. So fix is to convert `NSWindow` to `GtkWindow` and now everything works as expected. Reason we are getting `NSWindow` instead of `GtkWindow` is somewhere in `GetActiveWindow` method, but I'm not sure if its bug or not....
1 parent f284ff9 commit a6110a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2426,7 +2426,8 @@ Windows.GtkWPFWidget GetFocusedWpfWidget ()
24262426
Gtk.Widget GetFocusedChild (Control widget)
24272427
{
24282428
Gtk.Container container;
2429-
2429+
if (widget?.nativeWidget is AppKit.NSWindow window)
2430+
widget = Mac.GtkMacInterop.GetGtkWindow (window)?.Child;
24302431
do {
24312432
container = widget?.nativeWidget is Gtk.Container ? widget.GetNativeWidget<Gtk.Container> () : null;
24322433
if (container != null) {

0 commit comments

Comments
 (0)