Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: attempt to improve field rename issues with "n" shortcut #2075

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions jadx-gui/src/main/java/jadx/gui/ui/dialog/RenameDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;

import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -42,9 +43,11 @@ public class RenameDialog extends JDialog {
private transient JButton renameBtn;

public static boolean rename(MainWindow mainWindow, JRenameNode node) {
RenameDialog renameDialog = new RenameDialog(mainWindow, node);
UiUtils.uiRun(() -> renameDialog.setVisible(true));
UiUtils.uiRun(renameDialog::initRenameField); // wait for UI events to propagate
SwingUtilities.invokeLater(() -> {
RenameDialog renameDialog = new RenameDialog(mainWindow, node);
renameDialog.initRenameField();
renameDialog.setVisible(true);
});
return true;
}

Expand Down