@raydiant/playlist-window-manager 0.0.0-test-9 → 0.0.0-test-10

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.
@@ -98,6 +98,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
98
98
  opts.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts constructor1 ".concat(JSON.stringify(opts.bounds)));
99
99
  this.setWindowOrViewBounds(this.offscreenWindow, opts.bounds);
100
100
  opts.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts constructor2 ".concat(JSON.stringify({
101
+ fullscreen: this.offscreenWindow.isFullScreen(),
101
102
  bounds: this.offscreenWindow.getBounds(),
102
103
  normalBounds: this.offscreenWindow.getNormalBounds(),
103
104
  contentBounds: this.offscreenWindow.getContentBounds(),
@@ -133,6 +134,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
133
134
  : this.createOrGetPooledBrowserWindow(windowId, {
134
135
  show: false,
135
136
  frame: this.opts.frame,
137
+ fullscreen: (0, windowUtils_1.isFullscreen)(this.opts.bounds),
136
138
  // NOTE: useWindowPool: true does not work with renderChildWindowsAsBrowserViews: false
137
139
  // because the parent can't be changed after creating the BrowserWindow.
138
140
  parent: parentWindowId
@@ -174,6 +176,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
174
176
  if (window.view instanceof electron_1.BrowserView) {
175
177
  this.moveWindowOffscreen(window);
176
178
  this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts createWindow2: ".concat(JSON.stringify({
179
+ fullscreen: this.offscreenWindow.isFullScreen(),
177
180
  bounds: this.offscreenWindow.getBounds(),
178
181
  normalBounds: this.offscreenWindow.getNormalBounds(),
179
182
  contentBounds: this.offscreenWindow.getContentBounds(),
@@ -236,6 +239,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
236
239
  this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds2: ".concat(JSON.stringify(newBounds)));
237
240
  this.setWindowOrViewBounds(window.view, newBounds);
238
241
  this.logger.info("playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds3: ".concat(JSON.stringify({
242
+ fullscreen: window.view.isFullScreen(),
239
243
  bounds: window.view.getBounds(),
240
244
  normalBounds: window.view.getNormalBounds(),
241
245
  contentBounds: window.view.getContentBounds(),
@@ -355,9 +359,13 @@ var BrowserWindowRenderer = /** @class */ (function () {
355
359
  * 1919x1079.
356
360
  */
357
361
  BrowserWindowRenderer.prototype.setWindowOrViewBounds = function (window, bounds) {
362
+ // setBounds will be ignored if window was in fullscreen mode
363
+ if (window instanceof electron_1.BrowserWindow && !(0, windowUtils_1.isFullscreen)(bounds)) {
364
+ window.setFullScreen(false);
365
+ }
358
366
  window.setBounds(bounds);
359
- if (window instanceof electron_1.BrowserWindow) {
360
- window.setFullScreen((0, windowUtils_1.isFullscreen)(bounds));
367
+ if (window instanceof electron_1.BrowserWindow && (0, windowUtils_1.isFullscreen)(bounds)) {
368
+ window.setFullScreen(true);
361
369
  }
362
370
  };
363
371
  BrowserWindowRenderer.prototype.getWindow = function (windowId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydiant/playlist-window-manager",
3
- "version": "0.0.0-test-9",
3
+ "version": "0.0.0-test-10",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -83,6 +83,7 @@ export default class BrowserWindowRenderer
83
83
  opts.logger.info(
84
84
  `playlist-window-manager/src/BrowserWindowRenderer.ts constructor2 ${JSON.stringify(
85
85
  {
86
+ fullscreen: this.offscreenWindow.isFullScreen(),
86
87
  bounds: this.offscreenWindow.getBounds(),
87
88
  normalBounds: this.offscreenWindow.getNormalBounds(),
88
89
  contentBounds: this.offscreenWindow.getContentBounds(),
@@ -108,7 +109,7 @@ export default class BrowserWindowRenderer
108
109
  backgroundColor,
109
110
  receiveMessageCallback,
110
111
  errorCallback,
111
- }: CreateWindowOptions) {
112
+ }: CreateWindowOptions): Promise<void> {
112
113
  this.logger.info(
113
114
  `playlist-window-manager/src/BrowserWindowRenderer.ts createWindow1: ${JSON.stringify(
114
115
  parentWindowId && !this.opts.renderChildWindowsAsBrowserViews
@@ -134,6 +135,7 @@ export default class BrowserWindowRenderer
134
135
  : this.createOrGetPooledBrowserWindow(windowId, {
135
136
  show: false,
136
137
  frame: this.opts.frame,
138
+ fullscreen: isFullscreen(this.opts.bounds),
137
139
  // NOTE: useWindowPool: true does not work with renderChildWindowsAsBrowserViews: false
138
140
  // because the parent can't be changed after creating the BrowserWindow.
139
141
  parent: parentWindowId
@@ -208,6 +210,7 @@ export default class BrowserWindowRenderer
208
210
  this.logger.info(
209
211
  `playlist-window-manager/src/BrowserWindowRenderer.ts createWindow2: ${JSON.stringify(
210
212
  {
213
+ fullscreen: this.offscreenWindow.isFullScreen(),
211
214
  bounds: this.offscreenWindow.getBounds(),
212
215
  normalBounds: this.offscreenWindow.getNormalBounds(),
213
216
  contentBounds: this.offscreenWindow.getContentBounds(),
@@ -292,6 +295,7 @@ export default class BrowserWindowRenderer
292
295
  this.logger.info(
293
296
  `playlist-window-manager/src/BrowserWindowRenderer.ts updateWindowBounds3: ${JSON.stringify(
294
297
  {
298
+ fullscreen: window.view.isFullScreen(),
295
299
  bounds: window.view.getBounds(),
296
300
  normalBounds: window.view.getNormalBounds(),
297
301
  contentBounds: window.view.getContentBounds(),
@@ -438,9 +442,13 @@ export default class BrowserWindowRenderer
438
442
  window: BrowserWindow | BrowserView,
439
443
  bounds: WindowBounds
440
444
  ) {
445
+ // setBounds will be ignored if window was in fullscreen mode
446
+ if (window instanceof BrowserWindow && !isFullscreen(bounds)) {
447
+ window.setFullScreen(false);
448
+ }
441
449
  window.setBounds(bounds);
442
- if (window instanceof BrowserWindow) {
443
- window.setFullScreen(isFullscreen(bounds));
450
+ if (window instanceof BrowserWindow && isFullscreen(bounds)) {
451
+ window.setFullScreen(true);
444
452
  }
445
453
  }
446
454