Skip to content

Commit faeaefb

Browse files
committed
Fix focus problems on macOS
1 parent e4fcbd6 commit faeaefb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/scijava/ui/swing/search/SwingSearchBar.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,14 @@ protected void showPanel(final Container panel) {
253253
final int x = w.getLocation().x;
254254
final int y = w.getLocation().y + w.getHeight() + 1;
255255
dialog.setLocation(x, y);
256+
dialog.setFocusableWindowState(false);
256257
threadService.queue(() -> {
257258
dialog.setVisible(true);
258259
try { Thread.sleep(100); }
259260
catch (InterruptedException exc) {}
260261
grabFocus();
261262
requestFocus();
263+
dialog.setFocusableWindowState(true);
262264
});
263265
}
264266

0 commit comments

Comments
 (0)