@jitsi/electron-sdk
Advanced tools
Comparing version 3.0.9 to 3.0.10
const setupAlwaysOnTopRender = require('./render'); | ||
const setupAlwaysOnTopMain = require('./main'); | ||
const { attachAlwaysOnTopToWindow, setupAlwaysOnTopMain } = require('./main'); | ||
const { popupsConfigRegistry } = require('../popupsconfig'); | ||
@@ -13,4 +13,5 @@ | ||
module.exports = { | ||
setupAlwaysOnTopRender, | ||
setupAlwaysOnTopMain | ||
attachAlwaysOnTopToWindow, | ||
setupAlwaysOnTopMain, | ||
setupAlwaysOnTopRender | ||
}; |
@@ -31,2 +31,7 @@ const electron = require('electron'); | ||
/** | ||
* The undocked window instance | ||
*/ | ||
let undockedWindow; | ||
/** | ||
* Whether the meeting is currently in view. | ||
@@ -118,4 +123,4 @@ */ | ||
logInfo('hide aot handler'); | ||
if (isIntersecting) { | ||
logInfo('is intersecting. hiding'); | ||
if (undockedWindow || isIntersecting) { | ||
hideWindow(); | ||
@@ -126,5 +131,15 @@ } | ||
/** | ||
* Attaches event handlers on the undocked window | ||
*/ | ||
const addUndockedWindowHandlers = () => { | ||
logInfo(`adding undocked window event handlers`); | ||
undockedWindow.on('minimize', showAot); | ||
undockedWindow.on('restore', hideAot); | ||
}; | ||
/** | ||
* Attaches event handlers on the main window | ||
*/ | ||
const addWindowHandlers = () => { | ||
const addMainWindowHandlers = () => { | ||
logInfo(`adding main window event handlers`); | ||
@@ -139,3 +154,3 @@ | ||
*/ | ||
const removeWindowHandlers = () => { | ||
const removeMainWindowHandlers = () => { | ||
logInfo(`removing main window event handlers`); | ||
@@ -147,3 +162,2 @@ | ||
/** | ||
@@ -183,3 +197,3 @@ * Hides the aot window | ||
case STATES.CLOSE: | ||
removeWindowHandlers(); | ||
removeMainWindowHandlers(); | ||
savePosition(aotWindow); | ||
@@ -190,15 +204,25 @@ resetSize(); | ||
case STATES.CONFERENCE_JOINED: | ||
addWindowHandlers(); | ||
if (!undockedWindow) { | ||
addMainWindowHandlers(); | ||
} | ||
break; | ||
case STATES.SHOW_MAIN_WINDOW: | ||
// this will switch focus to main window, which in turns triggers hide on aot | ||
mainWindow.show(); | ||
(undockedWindow || mainWindow).show(); | ||
break; | ||
case STATES.IS_NOT_INTERSECTING: | ||
isIntersecting = false; | ||
showAot(); | ||
if (!undockedWindow) { | ||
isIntersecting = false; | ||
showAot(); | ||
} | ||
break; | ||
case STATES.IS_INTERSECTING: | ||
isIntersecting = true; | ||
hideAot(); | ||
if (!undockedWindow) { | ||
isIntersecting = true; | ||
hideAot(); | ||
} | ||
break; | ||
@@ -238,3 +262,5 @@ default: | ||
*/ | ||
module.exports = (jitsiMeetWindow, loggerTransports) => { | ||
const setupAlwaysOnTopMain = (jitsiMeetWindow, loggerTransports) => { | ||
logInfo('setting up aot for main window'); | ||
setLogger(loggerTransports); | ||
@@ -248,1 +274,20 @@ | ||
}; | ||
/** | ||
* Attaches the aot window to another window than the main one | ||
* @param {BrowserWindow} meetWindow | ||
*/ | ||
const attachAlwaysOnTopToWindow = meetWindow => { | ||
logInfo('setting up aot for undocked window'); | ||
undockedWindow = meetWindow; | ||
// just in case STATES.CONFERENCE_JOINED was fired earlier for main window | ||
removeMainWindowHandlers(); | ||
addUndockedWindowHandlers(); | ||
}; | ||
module.exports = { | ||
attachAlwaysOnTopToWindow, | ||
setupAlwaysOnTopMain | ||
}; |
const { RemoteControl, RemoteControlMain } = require('./remotecontrol'); | ||
const { setupScreenSharingRender, setupScreenSharingMain } = require('./screensharing'); | ||
const { | ||
attachAlwaysOnTopToWindow, | ||
setupAlwaysOnTopRender, | ||
@@ -17,2 +18,3 @@ setupAlwaysOnTopMain | ||
module.exports = { | ||
attachAlwaysOnTopToWindow, | ||
getWiFiStats, | ||
@@ -19,0 +21,0 @@ RemoteControl, |
{ | ||
"name": "@jitsi/electron-sdk", | ||
"version": "3.0.9", | ||
"version": "3.0.10", | ||
"description": "Utilities for jitsi-meet-electron project", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
352542
2877