Skip to content

Commit 7e53e86

Browse files
committed
Use Windows method for all OS
1 parent af59f8e commit 7e53e86

File tree

1 file changed

+5
-33
lines changed

1 file changed

+5
-33
lines changed

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

+5-33
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ public FindReplace(Editor editor, Map<String, Object> state) {
7272
}
7373

7474
Base.registerWindowCloseKeys(getRootPane(), e -> {
75-
if (OSUtils.isWindows()) {
76-
setAutoRequestFocus(true);
77-
}
75+
setAutoRequestFocus(true);
7876
setVisible(false);
7977
Base.FIND_DIALOG_STATE = findDialogState();
8078
});
@@ -83,39 +81,17 @@ public FindReplace(Editor editor, Map<String, Object> state) {
8381

8482
editor.addWindowListener(new WindowAdapter() {
8583
public void windowActivated(WindowEvent e) {
86-
if (OSUtils.isWindows()) {
87-
toFront();
88-
setAutoRequestFocus(false);
89-
return;
90-
}
91-
findField.requestFocusInWindow();
92-
findField.selectAll();
93-
setAlwaysOnTop(true);
94-
if (useTranslucency) {
95-
// Window is decorated, so tranparency doesn't work :(
96-
//setOpacity(0.7f);
97-
}
84+
toFront();
85+
setAutoRequestFocus(false);
9886
}
9987
public void windowDeactivated(WindowEvent e) {
100-
if (OSUtils.isWindows()) {
10188
return;
102-
}
103-
setAlwaysOnTop(false);
10489
}
10590
});
10691

10792
addWindowListener(new WindowAdapter() {
10893
public void windowActivated(WindowEvent e) {
109-
if (OSUtils.isWindows()) {
11094
return;
111-
}
112-
findField.requestFocusInWindow();
113-
findField.selectAll();
114-
setAlwaysOnTop(true);
115-
if (useTranslucency) {
116-
// Window is decorated, so tranparency doesn't work :(
117-
//setOpacity(1.0f);
118-
}
11995
}
12096
public void windowDeactivated(WindowEvent e) {
12197
}
@@ -127,12 +103,8 @@ public void windowDeactivated(WindowEvent e) {
127103
@Override
128104
public void setVisible(boolean b) {
129105
getRootPane().setDefaultButton(findButton);
130-
131-
if (OSUtils.isWindows()) {
132-
// means we are restoring the window visibility
133-
setAutoRequestFocus(true);
134-
}
135-
106+
// means we are restoring the window visibility
107+
setAutoRequestFocus(true);
136108
super.setVisible(b);
137109
}
138110

0 commit comments

Comments
 (0)