From 7db56e91f4f30a5255d09bfe05e507983c266b73 Mon Sep 17 00:00:00 2001 From: mtsgi Date: Sun, 16 Feb 2020 22:01:30 +0900 Subject: [PATCH] Maximize the window on double click [0.2.1] --- system.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/system.js b/system.js index a98af6e..6bea767 100644 --- a/system.js +++ b/system.js @@ -512,14 +512,12 @@ async function launch( str, args, dir ) { } } -async function appData( data ) { - if( data.support && data.support.multiple == false ){ - for( let p in process ){ - if( process[p].id === data.id ){ - Notification.push('多重起動エラー', `アプリケーション「${data.name}」の多重起動は許可されていません。`, 'system'); - System.launchLock = false; - return; - } +async function appData(data) { + if(data.support && data.support.multiple == false){ + if( Object.values(process).map(p => p.id).includes(data.id) ){ + Notification.push('多重起動エラー', `アプリケーション「${data.name}」の多重起動は許可されていません。`, 'system'); + System.launchLock = false; + return; } } let _pid = pid; @@ -622,9 +620,10 @@ async function appData( data ) { KWS.refreshWindowIndex(); } ).css( "left", windowPos + "px" ).css( "top", windowPos + "px" ).css( "z-index", KWS.windowIndex ); KWS.refreshWindowIndex(); - $( `#wm${_pid}` ).addClass( "wm fa fa-window-minimize" ).on("click", () => KWS.min( _pid ) ); - $( `#wz${_pid}` ).addClass( "wz fas fa-square" ).on("click", () => KWS.max( _pid ) ); - $( `#wx${_pid}` ).addClass( "wx fa fa-times" ).on("click", () => System.close( _pid ) ); + if( data.support && data.support['fullscreen'] == true ) $( `#wt${_pid}` ).on("dblclick", () => KWS.max( _pid )); + $( `#wm${_pid}` ).addClass("wm fa fa-window-minimize").on("click", () => KWS.min( _pid )); + $( `#wz${_pid}` ).addClass("wz fas fa-square").on("click", () => KWS.max( _pid )); + $( `#wx${_pid}` ).addClass("wx fa fa-times").on("click", () => System.close( _pid )); $( "#winc" + _pid ).resizable( { minWidth: "200" } ).load( System.launchpath[_pid] + "/" + data.view, (r, s, x) => { -- 2.11.0