File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,10 +9,8 @@ import {AppsMain} from "../mapi/app/main";
99let tray = null
1010
1111const showApp = ( ) => {
12- // if (isMac) {
13- // app.dock.show()
14- // }
1512 AppRuntime . mainWindow . show ( )
13+ AppRuntime . mainWindow . focus ( )
1614}
1715
1816const hideApp = ( ) => {
Original file line number Diff line number Diff line change @@ -256,6 +256,20 @@ export const ManagerWindow = {
256256 view . webContents . once ( 'dom-ready' , async ( ) => {
257257 DevToolsManager . autoShow ( view )
258258 } ) ;
259+ view . webContents . on ( 'before-input-event' , ( event , input ) => {
260+ // console.log('ManagerWindow.open.before-input-event', input)
261+ if ( input . type === 'keyUp' ) {
262+ // exit when Escape key is pressed
263+ if ( mainWindowView === view ) {
264+ if ( input . key === 'Escape' ) {
265+ if ( mainWindowView ) {
266+ ManagerWindow . close ( )
267+ AppRuntime . mainWindow . webContents . focus ( )
268+ }
269+ }
270+ }
271+ }
272+ } )
259273 const windowOption = {
260274 width,
261275 height,
@@ -286,16 +300,6 @@ export const ManagerWindow = {
286300 if ( autoDetach ) {
287301 await this . _showInDetachWindow ( view , windowOption )
288302 } else {
289- view . webContents . on ( 'before-input-event' , ( event , input ) => {
290- if ( input . type === 'keyUp' ) {
291- if ( input . key === 'Escape' ) {
292- if ( mainWindowView ) {
293- ManagerWindow . close ( )
294- AppRuntime . mainWindow . webContents . focus ( )
295- }
296- }
297- }
298- } )
299303 await this . _showInMainWindow ( view , windowOption )
300304 }
301305 // Log.info('open.PluginReady', JSON.stringify({readyData, action}))
Original file line number Diff line number Diff line change 6565 </div >
6666 </div >
6767 <div v-else
68+ @dblclick =" onSearchDoubleClick"
6869 class =" main-search" ></div >
6970 <div class =" content-right"
7071 @click =" doShowMenu" >
Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ window.__page.onLeaveFullScreen(() => {
105105 isFullscreen .value = false
106106 console .log (' onLeaveFullScreen' )
107107})
108-
108+ window .addEventListener (' keydown' , (e ) => {
109+ console .log (' PageDetachWindow.keydown' , e )
110+ })
109111 </script >
110112
111113<template >
You can’t perform that action at this time.
0 commit comments