@raydiant/playlist-window-manager 0.0.0-test30 → 0.0.0-test31

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,
@@ -401,6 +425,10 @@ var BrowserWindowRenderer = /** @class */ (function () {
401
425
  }
402
426
  }
403
427
  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), ")"));
404
432
  browserWindow = new electron_1.BrowserWindow(options);
405
433
  if (this.opts.useWindowPool) {
406
434
  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-test30",
3
+ "version": "0.0.0-test31",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -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,
@@ -470,6 +500,15 @@ export default class BrowserWindowRenderer
470
500
  }
471
501
 
472
502
  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
+
473
512
  browserWindow = new BrowserWindow(options);
474
513
  if (this.opts.useWindowPool) {
475
514
  this.browserWindowPool.add(browserWindow);