From ef1b1d57383c90b8a192828857b43615e1fad7bf Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Mon, 27 Jul 2020 11:33:25 -0700 Subject: [PATCH] Fix popup/notification when browser is in fullscreen, primarily on macOS. (#9075) * Fix popup/notification when browser is in fullscreen, primarily on OSX. The issue was reported internally via Slack. User was running Mac OSX Chrome in fullscreen mode where Chrome is created in a new Desktop workspace. The issue reproduced on OSX Chrome in fullscreen/maximized view overrides the explicitly set width and height for `windows.create()`. Possibly not overrides, but creates a window based off of the window that it was created from. Found a related [Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=263092&q=window%20create%20width%20os%3DMac&can=2). The fullscreen `popup.left` pixel will calculate the window position incorrectly since we set and assume the width of the created window. The incorrect `left` position the window and transition the focus Desktop/Workspace incorrectly and make is seem to lose focus of the new window/workspace. Incidentally this will make the popup full width/height, and create a new workspace for the view, which we have no control over until Chrome fixes it. This will check if the popup is 'fullscreen', which it gets passed from the origin window, if so then don't reposition the window. If Chrome fixes the issue we can revert this change. * Feedback commit Co-authored-by: Mark Stacey Co-authored-by: Mark Stacey --- app/scripts/lib/notification-manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scripts/lib/notification-manager.js b/app/scripts/lib/notification-manager.js index 497100354..631ae3290 100644 --- a/app/scripts/lib/notification-manager.js +++ b/app/scripts/lib/notification-manager.js @@ -56,7 +56,7 @@ export default class NotificationManager { }) // Firefox currently ignores left/top for create, but it works for update - if (popupWindow.left !== left) { + if (popupWindow.left !== left && popupWindow.state !== 'fullscreen') { await this.platform.updateWindowPosition(popupWindow.id, left, top) } this._popupId = popupWindow.id