@raydiant/playlist-window-manager 0.0.0-test-11 → 0.0.0-test-12

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.
@@ -385,6 +385,14 @@ var BrowserWindowRenderer = /** @class */ (function () {
385
385
  * 1919x1079.
386
386
  */
387
387
  BrowserWindowRenderer.prototype.setWindowOrViewBounds = function (window, bounds) {
388
+ var currentBounds = window.getBounds();
389
+ // calling setBounds may introduce -1px bug
390
+ if (currentBounds.x === bounds.x ||
391
+ currentBounds.y === bounds.y ||
392
+ currentBounds.width === bounds.width ||
393
+ currentBounds.height === bounds.height) {
394
+ return;
395
+ }
388
396
  // setBounds will be ignored if window was in fullscreen mode
389
397
  if (window instanceof electron_1.BrowserWindow && !(0, windowUtils_1.isFullscreen)(bounds)) {
390
398
  window.setFullScreen(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raydiant/playlist-window-manager",
3
- "version": "0.0.0-test-11",
3
+ "version": "0.0.0-test-12",
4
4
  "description": "Window manager for playlist playback.",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -475,11 +475,24 @@ export default class BrowserWindowRenderer
475
475
  window: BrowserWindow | BrowserView,
476
476
  bounds: WindowBounds
477
477
  ) {
478
+ const currentBounds = window.getBounds();
479
+ // calling setBounds may introduce -1px bug
480
+ if (
481
+ currentBounds.x === bounds.x ||
482
+ currentBounds.y === bounds.y ||
483
+ currentBounds.width === bounds.width ||
484
+ currentBounds.height === bounds.height
485
+ ) {
486
+ return;
487
+ }
488
+
478
489
  // setBounds will be ignored if window was in fullscreen mode
479
490
  if (window instanceof BrowserWindow && !isFullscreen(bounds)) {
480
491
  window.setFullScreen(false);
481
492
  }
493
+
482
494
  window.setBounds(bounds);
495
+
483
496
  if (window instanceof BrowserWindow && isFullscreen(bounds)) {
484
497
  window.setFullScreen(true);
485
498
  }