parent
6afb4dc634
commit
8128100cef
|
@ -73,6 +73,20 @@ addAPI(/** @namespace API */ {
|
|||
const wndPos = wnd && prefs.get('windowPosition');
|
||||
const wndBase = wnd && prefs.get('openEditInWindow.popup') ? {type: 'popup'} : {};
|
||||
const ffBug = wnd && FIREFOX; // https://bugzil.la/1271047
|
||||
if (wndPos) {
|
||||
const {left, top, width, height} = wndPos;
|
||||
const r = left + width;
|
||||
const b = top + height;
|
||||
const peek = 32;
|
||||
if (isNaN(r) || r < peek || left > screen.availWidth - peek || width < 100) {
|
||||
delete wndPos.left;
|
||||
delete wndPos.width;
|
||||
}
|
||||
if (isNaN(b) || b < peek || top > screen.availHeight - peek || height < 100) {
|
||||
delete wndPos.top;
|
||||
delete wndPos.height;
|
||||
}
|
||||
}
|
||||
const tab = await openURL({
|
||||
url: `${u}`,
|
||||
currentWindow: null,
|
||||
|
|
|
@ -96,6 +96,7 @@ window.on('beforeunload', e => {
|
|||
if (editor.isWindowed &&
|
||||
document.visibilityState === 'visible' &&
|
||||
prefs.get('openEditInWindow') &&
|
||||
screenX !== -32000 && // Chrome uses this value for minimized windows
|
||||
( // only if not maximized
|
||||
screenX > 0 || outerWidth < screen.availWidth ||
|
||||
screenY > 0 || outerHeight < screen.availHeight ||
|
||||
|
|
Loading…
Reference in New Issue
Block a user