@raydiant/playlist-window-manager 0.0.0-test30 → 0.0.0-test32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -69,6 +69,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
73
|
+
var t = {};
|
|
74
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
75
|
+
t[p] = s[p];
|
|
76
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
77
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
78
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
79
|
+
t[p[i]] = s[p[i]];
|
|
80
|
+
}
|
|
81
|
+
return t;
|
|
82
|
+
};
|
|
72
83
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
73
84
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
74
85
|
};
|
|
@@ -95,6 +106,12 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
95
106
|
},
|
|
96
107
|
});
|
|
97
108
|
this.proxySettings = null;
|
|
109
|
+
opts.logger.info("offscreenWindow = new BrowserWindow(".concat(JSON.stringify({
|
|
110
|
+
show: false,
|
|
111
|
+
frame: this.opts.frame,
|
|
112
|
+
fullscreen: this.opts.fullscreen,
|
|
113
|
+
hasShadow: this.opts.hasShadow,
|
|
114
|
+
}), ")"));
|
|
98
115
|
if (!opts.fullscreen) {
|
|
99
116
|
this.offscreenWindow.setBounds(opts.bounds);
|
|
100
117
|
}
|
|
@@ -114,6 +131,13 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
114
131
|
return __generator(this, function (_c) {
|
|
115
132
|
switch (_c.label) {
|
|
116
133
|
case 0:
|
|
134
|
+
this.logger.info("BrowserWindowRenderer.createWindow(".concat(JSON.stringify({
|
|
135
|
+
windowId: windowId,
|
|
136
|
+
parentWindowId: parentWindowId,
|
|
137
|
+
bounds: bounds,
|
|
138
|
+
}), ")"));
|
|
139
|
+
this.logger.info("BrowserWindowRenderer.createWindow adjust bounds: ".concat(parentWindowId && !this.opts.renderChildWindowsAsBrowserViews, ". New Bounds ").concat(JSON.stringify(parentWindowId && !this.opts.renderChildWindowsAsBrowserViews
|
|
140
|
+
? __assign(__assign({}, bounds), { x: bounds.x + this.opts.bounds.x, y: bounds.y + this.opts.bounds.y }) : bounds), "\n "));
|
|
117
141
|
window = {
|
|
118
142
|
parentWindowId: parentWindowId,
|
|
119
143
|
// If we are creating a child window and renderChildWindowsAsBrowserViews is true,
|
|
@@ -125,22 +149,17 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
125
149
|
contextIsolation: false,
|
|
126
150
|
},
|
|
127
151
|
})
|
|
128
|
-
: this.createOrGetPooledBrowserWindow(windowId, {
|
|
129
|
-
show: false,
|
|
130
|
-
frame: this.opts.frame,
|
|
131
|
-
fullscreen: this.opts.fullscreen,
|
|
152
|
+
: this.createOrGetPooledBrowserWindow(windowId, __assign({ show: false, frame: this.opts.frame, fullscreen: this.opts.fullscreen,
|
|
132
153
|
// NOTE: useWindowPool: true does not work with renderChildWindowsAsBrowserViews: false
|
|
133
154
|
// because the parent can't be changed after creating the BrowserWindow.
|
|
134
155
|
parent: parentWindowId
|
|
135
156
|
? this.getParentBrowserView(parentWindowId)
|
|
136
|
-
: undefined,
|
|
137
|
-
transparent: backgroundColor === 'transparent',
|
|
138
|
-
hasShadow: this.opts.hasShadow,
|
|
139
|
-
webPreferences: {
|
|
157
|
+
: undefined, transparent: backgroundColor === 'transparent', hasShadow: this.opts.hasShadow, webPreferences: {
|
|
140
158
|
preload: path.join(__dirname, 'preload.js'),
|
|
141
159
|
contextIsolation: false,
|
|
142
|
-
},
|
|
143
|
-
|
|
160
|
+
} }, (this.opts.fullscreen
|
|
161
|
+
? { width: bounds.width, height: bounds.height }
|
|
162
|
+
: {}))),
|
|
144
163
|
// If we are creating a child window and renderChildWindowsAsBrowserViews is false that means
|
|
145
164
|
// we are rendering child windows with BrowserWindow. BrowserWindows are positioned absolutely so
|
|
146
165
|
// to place them in the correct spot relative to their parent we need to add the main window's x / y.
|
|
@@ -401,6 +420,10 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
401
420
|
}
|
|
402
421
|
}
|
|
403
422
|
if (!browserWindow) {
|
|
423
|
+
// TODO remove
|
|
424
|
+
var parent_1 = options.parent, webPreferences = options.webPreferences, rest = __rest(options, ["parent", "webPreferences"]);
|
|
425
|
+
var newOptions = __assign(__assign({}, rest), { parentId: parent_1 === null || parent_1 === void 0 ? void 0 : parent_1.id });
|
|
426
|
+
this.logger.info("BrowserWindowRenderer.createOrGetPooledBrowserWindow, new BrowserWindow(".concat(JSON.stringify(newOptions), ")"));
|
|
404
427
|
browserWindow = new electron_1.BrowserWindow(options);
|
|
405
428
|
if (this.opts.useWindowPool) {
|
|
406
429
|
this.browserWindowPool.add(browserWindow);
|
package/package.json
CHANGED
|
@@ -78,6 +78,14 @@ export default class BrowserWindowRenderer
|
|
|
78
78
|
private logger: Logger;
|
|
79
79
|
|
|
80
80
|
constructor(private opts: BrowserWindowRendererOptions) {
|
|
81
|
+
opts.logger.info(
|
|
82
|
+
`offscreenWindow = new BrowserWindow(${JSON.stringify({
|
|
83
|
+
show: false,
|
|
84
|
+
frame: this.opts.frame,
|
|
85
|
+
fullscreen: this.opts.fullscreen,
|
|
86
|
+
hasShadow: this.opts.hasShadow,
|
|
87
|
+
})})`
|
|
88
|
+
);
|
|
81
89
|
if (!opts.fullscreen) {
|
|
82
90
|
this.offscreenWindow.setBounds(opts.bounds);
|
|
83
91
|
}
|
|
@@ -100,6 +108,28 @@ export default class BrowserWindowRenderer
|
|
|
100
108
|
receiveMessageCallback,
|
|
101
109
|
errorCallback,
|
|
102
110
|
}: CreateWindowOptions) {
|
|
111
|
+
this.logger.info(
|
|
112
|
+
`BrowserWindowRenderer.createWindow(${JSON.stringify({
|
|
113
|
+
windowId,
|
|
114
|
+
parentWindowId,
|
|
115
|
+
bounds,
|
|
116
|
+
})})`
|
|
117
|
+
);
|
|
118
|
+
this.logger.info(
|
|
119
|
+
`BrowserWindowRenderer.createWindow adjust bounds: ${
|
|
120
|
+
parentWindowId && !this.opts.renderChildWindowsAsBrowserViews
|
|
121
|
+
}. New Bounds ${JSON.stringify(
|
|
122
|
+
parentWindowId && !this.opts.renderChildWindowsAsBrowserViews
|
|
123
|
+
? {
|
|
124
|
+
...bounds,
|
|
125
|
+
x: bounds.x + this.opts.bounds.x,
|
|
126
|
+
y: bounds.y + this.opts.bounds.y,
|
|
127
|
+
}
|
|
128
|
+
: bounds
|
|
129
|
+
)}
|
|
130
|
+
`
|
|
131
|
+
);
|
|
132
|
+
|
|
103
133
|
const window: BrowserWindowRendererWindow = {
|
|
104
134
|
parentWindowId,
|
|
105
135
|
// If we are creating a child window and renderChildWindowsAsBrowserViews is true,
|
|
@@ -127,6 +157,9 @@ export default class BrowserWindowRenderer
|
|
|
127
157
|
preload: path.join(__dirname, 'preload.js'),
|
|
128
158
|
contextIsolation: false,
|
|
129
159
|
},
|
|
160
|
+
...(this.opts.fullscreen
|
|
161
|
+
? { width: bounds.width, height: bounds.height }
|
|
162
|
+
: {}),
|
|
130
163
|
}),
|
|
131
164
|
// If we are creating a child window and renderChildWindowsAsBrowserViews is false that means
|
|
132
165
|
// we are rendering child windows with BrowserWindow. BrowserWindows are positioned absolutely so
|
|
@@ -470,6 +503,15 @@ export default class BrowserWindowRenderer
|
|
|
470
503
|
}
|
|
471
504
|
|
|
472
505
|
if (!browserWindow) {
|
|
506
|
+
// TODO remove
|
|
507
|
+
const { parent, webPreferences, ...rest } = options;
|
|
508
|
+
const newOptions = { ...rest, parentId: parent?.id };
|
|
509
|
+
this.logger.info(
|
|
510
|
+
`BrowserWindowRenderer.createOrGetPooledBrowserWindow, new BrowserWindow(${JSON.stringify(
|
|
511
|
+
newOptions
|
|
512
|
+
)})`
|
|
513
|
+
);
|
|
514
|
+
|
|
473
515
|
browserWindow = new BrowserWindow(options);
|
|
474
516
|
if (this.opts.useWindowPool) {
|
|
475
517
|
this.browserWindowPool.add(browserWindow);
|