@@ -36,6 +36,9 @@ router.post("/hide", (req, res) => {
3636} ) ;
3737router . post ( "/create" , ( req , res ) => {
3838 res . sendStatus ( 200 ) ;
39+ if ( state . activeMenuBar ) {
40+ return ;
41+ }
3942 const { width, height, url, label, alwaysOnTop, vibrancy, backgroundColor, transparency, icon, showDockIcon, onlyShowContextMenu, windowPosition, contextMenu, tooltip, resizable, event, } = req . body ;
4043 if ( onlyShowContextMenu ) {
4144 const tray = new Tray ( icon || state . icon . replace ( "icon.png" , "IconTemplate.png" ) ) ;
@@ -70,6 +73,7 @@ router.post("/create", (req, res) => {
7073 showDockIcon,
7174 showOnAllWorkspaces : false ,
7275 windowPosition : windowPosition !== null && windowPosition !== void 0 ? windowPosition : "trayCenter" ,
76+ activateWithApp : false ,
7377 browserWindow : {
7478 width,
7579 height,
@@ -110,14 +114,14 @@ router.post("/create", (req, res) => {
110114 ]
111115 } ) ;
112116 } ) ;
113- if ( ! onlyShowContextMenu ) {
114- state . activeMenuBar . tray . on ( "right-click" , ( ) => {
115- notifyLaravel ( "events" , {
116- event : "\\Native\\Laravel\\Events\\MenuBar\\MenuBarContextMenuOpened"
117- } ) ;
118- state . activeMenuBar . tray . popUpContextMenu ( buildMenu ( contextMenu ) ) ;
117+ state . activeMenuBar . tray . on ( "right-click" , ( ) => {
118+ notifyLaravel ( "events" , {
119+ event : "\\Native\\Laravel\\Events\\MenuBar\\MenuBarContextMenuOpened"
119120 } ) ;
120- }
121+ if ( ! onlyShowContextMenu ) {
122+ state . activeMenuBar . tray . popUpContextMenu ( buildMenu ( contextMenu ) ) ;
123+ }
124+ } ) ;
121125 } ) ;
122126} ) ;
123127function buildMenu ( contextMenu ) {
0 commit comments