@raydiant/playlist-window-manager 0.0.0-test31 → 0.0.0-test33
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,17 +69,6 @@ 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
|
-
};
|
|
83
72
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
84
73
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
85
74
|
};
|
|
@@ -98,7 +87,6 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
98
87
|
this.offscreenWindow = new electron_1.BrowserWindow({
|
|
99
88
|
show: false,
|
|
100
89
|
frame: this.opts.frame,
|
|
101
|
-
fullscreen: this.opts.fullscreen,
|
|
102
90
|
hasShadow: this.opts.hasShadow,
|
|
103
91
|
webPreferences: {
|
|
104
92
|
preload: path.join(__dirname, 'preload.js'),
|
|
@@ -106,15 +94,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
106
94
|
},
|
|
107
95
|
});
|
|
108
96
|
this.proxySettings = null;
|
|
109
|
-
|
|
110
|
-
show: false,
|
|
111
|
-
frame: this.opts.frame,
|
|
112
|
-
fullscreen: this.opts.fullscreen,
|
|
113
|
-
hasShadow: this.opts.hasShadow,
|
|
114
|
-
}), ")"));
|
|
115
|
-
if (!opts.fullscreen) {
|
|
116
|
-
this.offscreenWindow.setBounds(opts.bounds);
|
|
117
|
-
}
|
|
97
|
+
this.offscreenWindow.setBounds(opts.bounds);
|
|
118
98
|
if (opts.proxySettings) {
|
|
119
99
|
this.proxySettings = opts.proxySettings;
|
|
120
100
|
}
|
|
@@ -131,13 +111,6 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
131
111
|
return __generator(this, function (_c) {
|
|
132
112
|
switch (_c.label) {
|
|
133
113
|
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 "));
|
|
141
114
|
window = {
|
|
142
115
|
parentWindowId: parentWindowId,
|
|
143
116
|
// If we are creating a child window and renderChildWindowsAsBrowserViews is true,
|
|
@@ -152,7 +125,6 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
152
125
|
: this.createOrGetPooledBrowserWindow(windowId, {
|
|
153
126
|
show: false,
|
|
154
127
|
frame: this.opts.frame,
|
|
155
|
-
fullscreen: this.opts.fullscreen,
|
|
156
128
|
// NOTE: useWindowPool: true does not work with renderChildWindowsAsBrowserViews: false
|
|
157
129
|
// because the parent can't be changed after creating the BrowserWindow.
|
|
158
130
|
parent: parentWindowId
|
|
@@ -203,9 +175,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
203
175
|
// Electron issue: https://github.com/electron/electron/issues/20357
|
|
204
176
|
window.view.setBackgroundColor(backgroundColor === 'transparent' ? '#00000000' : backgroundColor);
|
|
205
177
|
}
|
|
206
|
-
|
|
207
|
-
window.view.setBounds(window.bounds);
|
|
208
|
-
}
|
|
178
|
+
window.view.setBounds(window.bounds);
|
|
209
179
|
if (!this.proxySettings) return [3 /*break*/, 2];
|
|
210
180
|
return [4 /*yield*/, window.view.webContents.session.setProxy(this.proxySettings)];
|
|
211
181
|
case 1:
|
|
@@ -425,10 +395,6 @@ var BrowserWindowRenderer = /** @class */ (function () {
|
|
|
425
395
|
}
|
|
426
396
|
}
|
|
427
397
|
if (!browserWindow) {
|
|
428
|
-
// TODO remove
|
|
429
|
-
var parent_1 = options.parent, webPreferences = options.webPreferences, rest = __rest(options, ["parent", "webPreferences"]);
|
|
430
|
-
var newOptions = __assign(__assign({}, rest), { parentId: parent_1 === null || parent_1 === void 0 ? void 0 : parent_1.id });
|
|
431
|
-
this.logger.info("BrowserWindowRenderer.createOrGetPooledBrowserWindow, new BrowserWindow(".concat(JSON.stringify(newOptions), ")"));
|
|
432
398
|
browserWindow = new electron_1.BrowserWindow(options);
|
|
433
399
|
if (this.opts.useWindowPool) {
|
|
434
400
|
this.browserWindowPool.add(browserWindow);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raydiant/playlist-window-manager",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-test33",
|
|
4
4
|
"description": "Window manager for playlist playback.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@types/jschannel": "^1.0.1",
|
|
23
23
|
"@types/jest": "^24.0.15",
|
|
24
24
|
"@types/uuid": "8.3.0",
|
|
25
|
-
"electron": "28.1.
|
|
25
|
+
"electron": "28.1.4",
|
|
26
26
|
"jest": "^24.8.0",
|
|
27
27
|
"ts-jest": "^24.0.2",
|
|
28
28
|
"typescript": "^4.1.2"
|
|
@@ -45,7 +45,6 @@ interface BrowserWindowRendererOptions {
|
|
|
45
45
|
renderChildWindowsAsBrowserViews: boolean;
|
|
46
46
|
useWindowPool: boolean;
|
|
47
47
|
logger: Logger;
|
|
48
|
-
fullscreen?: boolean;
|
|
49
48
|
proxySettings?: ProxySettings;
|
|
50
49
|
windowCrashHandler?: () => void;
|
|
51
50
|
}
|
|
@@ -65,7 +64,6 @@ export default class BrowserWindowRenderer
|
|
|
65
64
|
private offscreenWindow = new BrowserWindow({
|
|
66
65
|
show: false,
|
|
67
66
|
frame: this.opts.frame,
|
|
68
|
-
fullscreen: this.opts.fullscreen,
|
|
69
67
|
hasShadow: this.opts.hasShadow,
|
|
70
68
|
webPreferences: {
|
|
71
69
|
preload: path.join(__dirname, 'preload.js'),
|
|
@@ -78,17 +76,7 @@ export default class BrowserWindowRenderer
|
|
|
78
76
|
private logger: Logger;
|
|
79
77
|
|
|
80
78
|
constructor(private opts: BrowserWindowRendererOptions) {
|
|
81
|
-
|
|
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
|
-
);
|
|
89
|
-
if (!opts.fullscreen) {
|
|
90
|
-
this.offscreenWindow.setBounds(opts.bounds);
|
|
91
|
-
}
|
|
79
|
+
this.offscreenWindow.setBounds(opts.bounds);
|
|
92
80
|
if (opts.proxySettings) {
|
|
93
81
|
this.proxySettings = opts.proxySettings;
|
|
94
82
|
}
|
|
@@ -108,28 +96,6 @@ export default class BrowserWindowRenderer
|
|
|
108
96
|
receiveMessageCallback,
|
|
109
97
|
errorCallback,
|
|
110
98
|
}: 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
|
-
|
|
133
99
|
const window: BrowserWindowRendererWindow = {
|
|
134
100
|
parentWindowId,
|
|
135
101
|
// If we are creating a child window and renderChildWindowsAsBrowserViews is true,
|
|
@@ -145,7 +111,6 @@ export default class BrowserWindowRenderer
|
|
|
145
111
|
: this.createOrGetPooledBrowserWindow(windowId, {
|
|
146
112
|
show: false,
|
|
147
113
|
frame: this.opts.frame,
|
|
148
|
-
fullscreen: this.opts.fullscreen,
|
|
149
114
|
// NOTE: useWindowPool: true does not work with renderChildWindowsAsBrowserViews: false
|
|
150
115
|
// because the parent can't be changed after creating the BrowserWindow.
|
|
151
116
|
parent: parentWindowId
|
|
@@ -235,9 +200,7 @@ export default class BrowserWindowRenderer
|
|
|
235
200
|
);
|
|
236
201
|
}
|
|
237
202
|
|
|
238
|
-
|
|
239
|
-
window.view.setBounds(window.bounds);
|
|
240
|
-
}
|
|
203
|
+
window.view.setBounds(window.bounds);
|
|
241
204
|
|
|
242
205
|
if (this.proxySettings) {
|
|
243
206
|
await window.view.webContents.session.setProxy(this.proxySettings);
|
|
@@ -500,15 +463,6 @@ export default class BrowserWindowRenderer
|
|
|
500
463
|
}
|
|
501
464
|
|
|
502
465
|
if (!browserWindow) {
|
|
503
|
-
// TODO remove
|
|
504
|
-
const { parent, webPreferences, ...rest } = options;
|
|
505
|
-
const newOptions = { ...rest, parentId: parent?.id };
|
|
506
|
-
this.logger.info(
|
|
507
|
-
`BrowserWindowRenderer.createOrGetPooledBrowserWindow, new BrowserWindow(${JSON.stringify(
|
|
508
|
-
newOptions
|
|
509
|
-
)})`
|
|
510
|
-
);
|
|
511
|
-
|
|
512
466
|
browserWindow = new BrowserWindow(options);
|
|
513
467
|
if (this.opts.useWindowPool) {
|
|
514
468
|
this.browserWindowPool.add(browserWindow);
|