diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/CodeViewerProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/CodeViewerProvider.java index f30d2923fd..b2cd9cf11f 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/CodeViewerProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/codebrowser/CodeViewerProvider.java @@ -24,7 +24,8 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.*; -import javax.swing.*; +import javax.swing.Icon; +import javax.swing.JComponent; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -39,7 +40,8 @@ import docking.widgets.fieldpanel.internal.FieldPanelCoordinator; import docking.widgets.fieldpanel.support.*; import generic.theme.GIcon; import ghidra.app.context.ListingActionContext; -import ghidra.app.nav.*; +import ghidra.app.nav.ListingPanelContainer; +import ghidra.app.nav.LocationMemento; import ghidra.app.plugin.core.clipboard.CodeBrowserClipboardProvider; import ghidra.app.plugin.core.codebrowser.actions.*; import ghidra.app.plugin.core.codebrowser.hover.ListingHoverService; @@ -164,6 +166,7 @@ public class CodeViewerProvider extends NavigatableComponentProviderAdapter codeViewerClipboardProvider = newClipboardProvider(); tool.addPopupActionProvider(this); + setDefaultFocusComponent(listingPanel.getFieldPanel()); } protected CodeBrowserClipboardProvider newClipboardProvider() { @@ -884,11 +887,6 @@ public class CodeViewerProvider extends NavigatableComponentProviderAdapter return true; } - @Override - public void requestFocus() { - listingPanel.getFieldPanel().requestFocus(); - } - @Override public void writeDataState(SaveState saveState) { super.writeDataState(saveState); diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/console/ConsoleComponentProvider.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/console/ConsoleComponentProvider.java index 2d1dc2786e..1565a705a1 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/console/ConsoleComponentProvider.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/console/ConsoleComponentProvider.java @@ -399,19 +399,6 @@ public class ConsoleComponentProvider extends ComponentProviderAdapter implement return component; } - @Override - public void requestFocus() { - KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager(); - Component focusOwner = kfm.getFocusOwner(); - if (focusOwner != null) { - if (SwingUtilities.isDescendingFrom(focusOwner, component)) { - return; // nothing to do - } - } - - component.requestFocus(); - } - public void setCurrentProgram(Program program) { currentProgram = program; } diff --git a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteViewerComponentProvider.java b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteViewerComponentProvider.java index a07c4fd548..62ed9e83f4 100644 --- a/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteViewerComponentProvider.java +++ b/Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/ProgramByteViewerComponentProvider.java @@ -366,13 +366,7 @@ public class ProgramByteViewerComponentProvider extends ByteViewerComponentProvi public boolean isVisible() { return tool.isVisible(this); } - - @Override - public void requestFocus() { - panel.getCurrentComponent().requestFocus(); - tool.toFront(this); - } - + //================================================================================================== // End Navigatable interface methods */ //================================================================================================== diff --git a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java index aae96424f0..9c1dd91bba 100644 --- a/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java +++ b/Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/DecompilerProvider.java @@ -165,6 +165,7 @@ public class DecompilerProvider extends NavigatableComponentProviderAdapter plugin.getTool().addServiceListener(serviceListener); programListener = new DecompilerProgramListener(controller, redecompileUpdater); + setDefaultFocusComponent(controller.getDecompilerPanel()); } //================================================================================================== @@ -287,12 +288,6 @@ public class DecompilerProvider extends NavigatableComponentProviderAdapter pendingViewerPosition = decompMemento.getViewerPosition(); } - @Override - public void requestFocus() { - controller.getDecompilerPanel().requestFocus(); - tool.toFront(this); - } - //================================================================================================== // DecompilerHighlightService interface methods //================================================================================================== diff --git a/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGProvider.java b/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGProvider.java index 2f096dac35..ba1362dde8 100644 --- a/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGProvider.java +++ b/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/FGProvider.java @@ -133,6 +133,8 @@ public class FGProvider extends VisualGraphComponentProvider setPendingLocationFromUpdateManager()); clipboardProvider = new FGClipboardProvider(tool, controller); + setDefaultFocusComponent(controller.getViewComponent()); + } @Override @@ -1286,16 +1288,6 @@ public class FGProvider extends VisualGraphComponentProvider