Skip to content

Commit

Permalink
fix(gui): codearea popup menu always disabled in macos (#1052) (PR #1086
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Shatyuka committed Jan 18, 2021
1 parent a3ea514 commit 707ed9a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions jadx-gui/src/main/java/jadx/gui/ui/codearea/JNodeMenuAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ public void popupMenuWillBecomeVisible(PopupMenuEvent e) {

@Nullable
private T getNode() {
Point pos = codeArea.getMousePosition();
if (pos != null) {
Token token = codeArea.viewToToken(pos);
int offset = codeArea.adjustOffsetForToken(token);
return getNodeByOffset(offset);
}
return null;
Point pos = MouseInfo.getPointerInfo().getLocation();
SwingUtilities.convertPointFromScreen(pos, codeArea);
Token token = codeArea.viewToToken(pos);
int offset = codeArea.adjustOffsetForToken(token);
return getNodeByOffset(offset);
}

@Override
Expand Down

0 comments on commit 707ed9a

Please sign in to comment.