File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,11 +15,12 @@ const { remote } = electron
1515const { Menu } = remote
1616
1717function hideFinder ( ) {
18- if ( process . platform === 'win32' ) {
19- remote . getCurrentWindow ( ) . minimize ( )
20- return
18+ let finderWindow = remote . getCurrentWindow ( )
19+ if ( global . process . platform === 'win32' ) {
20+ finderWindow . blur ( )
21+ finderWindow . hide ( )
2122 }
22- if ( process . platform === 'darwin' ) {
23+ if ( global . process . platform === 'darwin' ) {
2324 Menu . sendActionToFirstResponder ( 'hide:' )
2425 }
2526 remote . getCurrentWindow ( ) . hide ( )
@@ -48,6 +49,7 @@ class FinderMain extends React.Component {
4849 }
4950
5051 componentDidMount ( ) {
52+ this . refs . search . focus ( )
5153 window . addEventListener ( 'focus' , this . focusHandler )
5254 window . addEventListener ( 'blur' , this . blurHandler )
5355 }
Original file line number Diff line number Diff line change @@ -30,12 +30,21 @@ function toggleFinder () {
3030 finderWindow . show ( )
3131 }
3232 } else {
33- if ( ! finderWindow . isMinimized ( ) ) {
34- finderWindow . minimize ( )
33+ if ( finderWindow . isVisible ( ) ) {
34+ finderWindow . blur ( )
35+ finderWindow . hide ( )
3536 } else {
3637 nodeIpc . of . node . emit ( 'request-data' )
37- finderWindow . restore ( )
38+ finderWindow . show ( )
39+ finderWindow . focus ( )
3840 }
41+ // if (!finderWindow.isMinimized()) {
42+ // finderWindow.minimize()
43+ // } else {
44+ // nodeIpc.of.node.emit('request-data')
45+ // finderWindow.restore()
46+ // finderWindow.focus()
47+ // }
3948 }
4049}
4150
You can’t perform that action at this time.
0 commit comments