Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ce70d66

Browse files
facchinmcmaglie
authored andcommitted
Fix find/replace focus on Windows
Probably this approach could be adopted by all OSes with a little care on the window lifecycle.
1 parent 449c99a commit ce70d66

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎app/src/cc/arduino/view/findreplace/FindReplace.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public FindReplace(Editor editor, Map<String, Object> state) {
6262
isTranslucencySupported();
6363
initComponents();
6464

65+
if (OSUtils.isWindows()) {
66+
setAutoRequestFocus(false);
67+
}
68+
6569
if (OSUtils.isMacOS()) {
6670
buttonsContainer.removeAll();
6771
buttonsContainer.add(replaceAllButton);
@@ -80,6 +84,10 @@ public FindReplace(Editor editor, Map<String, Object> state) {
8084

8185
editor.addWindowListener(new WindowAdapter() {
8286
public void windowActivated(WindowEvent e) {
87+
if (OSUtils.isWindows()) {
88+
toFront();
89+
return;
90+
}
8391
findField.requestFocusInWindow();
8492
findField.selectAll();
8593
setAlwaysOnTop(true);
@@ -89,12 +97,18 @@ public void windowActivated(WindowEvent e) {
8997
}
9098
}
9199
public void windowDeactivated(WindowEvent e) {
100+
if (OSUtils.isWindows()) {
101+
return;
102+
}
92103
setAlwaysOnTop(false);
93104
}
94105
});
95106

96107
addWindowListener(new WindowAdapter() {
97108
public void windowActivated(WindowEvent e) {
109+
if (OSUtils.isWindows()) {
110+
return;
111+
}
98112
findField.requestFocusInWindow();
99113
findField.selectAll();
100114
setAlwaysOnTop(true);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /