@@ -62,10 +62,6 @@ public FindReplace(Editor editor, Map<String, Object> state) {
62
62
isTranslucencySupported ();
63
63
initComponents ();
64
64
65
- if (OSUtils .isWindows ()) {
66
- setAutoRequestFocus (false );
67
- }
68
-
69
65
if (OSUtils .isMacOS ()) {
70
66
buttonsContainer .removeAll ();
71
67
buttonsContainer .add (replaceAllButton );
@@ -76,6 +72,9 @@ public FindReplace(Editor editor, Map<String, Object> state) {
76
72
}
77
73
78
74
Base .registerWindowCloseKeys (getRootPane (), e -> {
75
+ if (OSUtils .isWindows ()) {
76
+ setAutoRequestFocus (true );
77
+ }
79
78
setVisible (false );
80
79
Base .FIND_DIALOG_STATE = findDialogState ();
81
80
});
@@ -86,6 +85,7 @@ public FindReplace(Editor editor, Map<String, Object> state) {
86
85
public void windowActivated (WindowEvent e ) {
87
86
if (OSUtils .isWindows ()) {
88
87
toFront ();
88
+ setAutoRequestFocus (false );
89
89
return ;
90
90
}
91
91
findField .requestFocusInWindow ();
@@ -128,6 +128,11 @@ public void windowDeactivated(WindowEvent e) {
128
128
public void setVisible (boolean b ) {
129
129
getRootPane ().setDefaultButton (findButton );
130
130
131
+ if (OSUtils .isWindows ()) {
132
+ // means we are restoring the window visibility
133
+ setAutoRequestFocus (true );
134
+ }
135
+
131
136
super .setVisible (b );
132
137
}
133
138
0 commit comments