@raydiant/playlist-window-manager 0.0.0-test-4 → 0.0.0-test-5

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.
@@ -102,6 +102,7 @@ var BrowserViewRenderer = /** @class */ (function () {
102
102
  this.offscreenWindow.addBrowserView(window.view);
103
103
  logger.info("playlist-window-manager/src/BrowserViewRenderer.ts createWindow2 ".concat(JSON.stringify(window.bounds)));
104
104
  window.view.setBounds(window.bounds);
105
+ logger.info("playlist-window-manager/src/BrowserViewRenderer.ts createWindow3 ".concat(JSON.stringify(window.view.getBounds())));
105
106
  if (backgroundColor) {
106
107
  window.view.setBackgroundColor(backgroundColor);
107
108
  }
@@ -94,13 +94,21 @@ var BrowserWindowRenderer = /** @class */ (function () {
94
94
  });
95
95
  this.proxySettings = null;
96
96
  opts.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts constructor1 ".concat(JSON.stringify(opts.bounds)));
97
- this.offscreenWindow.setBounds(opts.bounds);
97
+ // TODO zlv commented out
98
+ // this.offscreenWindow.setBounds(opts.bounds);
99
+ // TODO zlv added
100
+ this.offscreenWindow.setContentBounds(opts.bounds);
98
101
  opts.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts constructor2 ".concat(JSON.stringify({
99
102
  bounds: this.offscreenWindow.getBounds(),
100
103
  normalBounds: this.offscreenWindow.getNormalBounds(),
101
104
  contentBounds: this.offscreenWindow.getContentBounds(),
102
105
  })));
103
106
  this.offscreenWindow.maximize(); // TODO zlv added
107
+ opts.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts constructor3 ".concat(JSON.stringify({
108
+ bounds: this.offscreenWindow.getBounds(),
109
+ normalBounds: this.offscreenWindow.getNormalBounds(),
110
+ contentBounds: this.offscreenWindow.getContentBounds(),
111
+ })));
104
112
  if (opts.proxySettings) {
105
113
  this.proxySettings = opts.proxySettings;
106
114
  }
@@ -186,9 +194,15 @@ var BrowserWindowRenderer = /** @class */ (function () {
186
194
  // Electron issue: https://github.com/electron/electron/issues/20357
187
195
  window.view.setBackgroundColor(backgroundColor === 'transparent' ? '#00000000' : backgroundColor);
188
196
  }
189
- this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts createWindow3: ".concat(JSON.stringify(window.bounds)));
190
- window.view.setBounds(window.bounds);
191
- this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts createWindow4: ".concat(JSON.stringify(window.view.getBounds())));
197
+ if (window.view instanceof electron_1.BrowserWindow) {
198
+ this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts createWindow3: ".concat(JSON.stringify(window.bounds)));
199
+ window.view.setContentBounds(window.bounds);
200
+ }
201
+ else {
202
+ this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts createWindow4: ".concat(JSON.stringify(window.bounds)));
203
+ window.view.setBounds(window.bounds);
204
+ }
205
+ this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts createWindow5: ".concat(JSON.stringify(window.view.getBounds())));
192
206
  if (!this.proxySettings) return [3 /*break*/, 2];
193
207
  return [4 /*yield*/, window.view.webContents.session.setProxy(this.proxySettings)];
194
208
  case 1:
@@ -232,11 +246,24 @@ var BrowserWindowRenderer = /** @class */ (function () {
232
246
  this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds2: ".concat(JSON.stringify(__assign(__assign({}, window.bounds), { x: window.bounds.x + this.opts.bounds.x, y: window.bounds.y + this.opts.bounds.y }))));
233
247
  // Child BrowserWindows are absolutely positioned so we need to add the main windows
234
248
  // x/y to when updating the child window's bounds.
235
- window.view.setBounds(__assign(__assign({}, window.bounds), { x: window.bounds.x + this.opts.bounds.x, y: window.bounds.y + this.opts.bounds.y }));
249
+ // TODO zlv commented out
250
+ // window.view.setBounds({
251
+ // ...window.bounds,
252
+ // x: window.bounds.x + this.opts.bounds.x,
253
+ // y: window.bounds.y + this.opts.bounds.y,
254
+ // });
255
+ // TODO zlv added
256
+ window.view.setContentBounds(__assign(__assign({}, window.bounds), { x: window.bounds.x + this.opts.bounds.x, y: window.bounds.y + this.opts.bounds.y }));
257
+ this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds3: ".concat(JSON.stringify({
258
+ bounds: window.view.getBounds(),
259
+ normalBounds: window.view.getNormalBounds(),
260
+ contentBounds: window.view.getContentBounds(),
261
+ })));
236
262
  }
237
263
  else {
238
- this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds3: ".concat(JSON.stringify(window.bounds)));
264
+ this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds4: ".concat(JSON.stringify(window.bounds)));
239
265
  window.view.setBounds(window.bounds);
266
+ this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds5: ".concat(JSON.stringify(window.view.getBounds())));
240
267
  }
241
268
  };
242
269
  BrowserWindowRenderer.prototype.showWindow = function (windowId, isFocused) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydiant/playlist-window-manager",
3
- "version": "0.0.0-test-4",
3
+ "version": "0.0.0-test-5",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -70,8 +70,12 @@ export default class BrowserViewRenderer implements PresentationWindowRenderer {
70
70
  window.bounds
71
71
  )}`
72
72
  );
73
-
74
73
  window.view.setBounds(window.bounds);
74
+ logger.info(
75
+ `playlist-window-manager/src/BrowserViewRenderer.ts createWindow3 ${JSON.stringify(
76
+ window.view.getBounds()
77
+ )}`
78
+ );
75
79
 
76
80
  if (backgroundColor) {
77
81
  window.view.setBackgroundColor(backgroundColor);
@@ -77,7 +77,10 @@ export default class BrowserWindowRenderer
77
77
  opts.bounds
78
78
  )}`
79
79
  );
80
- this.offscreenWindow.setBounds(opts.bounds);
80
+ // TODO zlv commented out
81
+ // this.offscreenWindow.setBounds(opts.bounds);
82
+ // TODO zlv added
83
+ this.offscreenWindow.setContentBounds(opts.bounds);
81
84
  opts.logger.info(
82
85
  `playlist-window-manager/src/BrowserWindowRenderer.ts constructor2 ${JSON.stringify(
83
86
  {
@@ -87,8 +90,16 @@ export default class BrowserWindowRenderer
87
90
  }
88
91
  )}`
89
92
  );
90
-
91
93
  this.offscreenWindow.maximize(); // TODO zlv added
94
+ opts.logger.info(
95
+ `playlist-window-manager/src/BrowserWindowRenderer.ts constructor3 ${JSON.stringify(
96
+ {
97
+ bounds: this.offscreenWindow.getBounds(),
98
+ normalBounds: this.offscreenWindow.getNormalBounds(),
99
+ contentBounds: this.offscreenWindow.getContentBounds(),
100
+ }
101
+ )}`
102
+ );
92
103
  if (opts.proxySettings) {
93
104
  this.proxySettings = opts.proxySettings;
94
105
  }
@@ -227,14 +238,23 @@ export default class BrowserWindowRenderer
227
238
  );
228
239
  }
229
240
 
241
+ if (window.view instanceof BrowserWindow) {
242
+ this.logger.info(
243
+ `playlist-window-manager/src/BrowserWindowRenderer.ts createWindow3: ${JSON.stringify(
244
+ window.bounds
245
+ )}`
246
+ );
247
+ window.view.setContentBounds(window.bounds);
248
+ } else {
249
+ this.logger.info(
250
+ `playlist-window-manager/src/BrowserWindowRenderer.ts createWindow4: ${JSON.stringify(
251
+ window.bounds
252
+ )}`
253
+ );
254
+ window.view.setBounds(window.bounds);
255
+ }
230
256
  this.logger.info(
231
- `playlist-window-manager/src/BrowserWindowRenderer.ts createWindow3: ${JSON.stringify(
232
- window.bounds
233
- )}`
234
- );
235
- window.view.setBounds(window.bounds);
236
- this.logger.info(
237
- `playlist-window-manager/src/BrowserWindowRenderer.ts createWindow4: ${JSON.stringify(
257
+ `playlist-window-manager/src/BrowserWindowRenderer.ts createWindow5: ${JSON.stringify(
238
258
  window.view.getBounds()
239
259
  )}`
240
260
  );
@@ -286,18 +306,40 @@ export default class BrowserWindowRenderer
286
306
 
287
307
  // Child BrowserWindows are absolutely positioned so we need to add the main windows
288
308
  // x/y to when updating the child window's bounds.
289
- window.view.setBounds({
309
+ // TODO zlv commented out
310
+ // window.view.setBounds({
311
+ // ...window.bounds,
312
+ // x: window.bounds.x + this.opts.bounds.x,
313
+ // y: window.bounds.y + this.opts.bounds.y,
314
+ // });
315
+ // TODO zlv added
316
+ window.view.setContentBounds({
290
317
  ...window.bounds,
291
318
  x: window.bounds.x + this.opts.bounds.x,
292
319
  y: window.bounds.y + this.opts.bounds.y,
293
320
  });
294
- } else {
321
+
295
322
  this.logger.info(
296
323
  `playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds3: ${JSON.stringify(
324
+ {
325
+ bounds: window.view.getBounds(),
326
+ normalBounds: window.view.getNormalBounds(),
327
+ contentBounds: window.view.getContentBounds(),
328
+ }
329
+ )}`
330
+ );
331
+ } else {
332
+ this.logger.info(
333
+ `playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds4: ${JSON.stringify(
297
334
  window.bounds
298
335
  )}`
299
336
  );
300
337
  window.view.setBounds(window.bounds);
338
+ this.logger.info(
339
+ `playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds5: ${JSON.stringify(
340
+ window.view.getBounds()
341
+ )}`
342
+ );
301
343
  }
302
344
  }
303
345