From bc582caca1471de75dc8bc58419b49507828a6fe Mon Sep 17 00:00:00 2001 From: James Mason Date: Mon, 27 Nov 2017 18:20:00 -0800 Subject: [PATCH] Fix premature popup dismissal on Ubuntu & ChromeOS Fix for [Issue #1](https://github.com/deanoemcke/spaces/issues/1). Patch due to [Bao Ho](https://plus.google.com/102553037065128878831), who posted it to the [support pages] (post titled "_Solution for the problem of space switch in linux_"). --- js/background.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/background.js b/js/background.js index bc4ab5f..5f80d97 100644 --- a/js/background.js +++ b/js/background.js @@ -74,6 +74,12 @@ var spaces = (function () { //add listeners for tab and window focus changes //when a tab or window is changed, close the move tab popup if it is open chrome.windows.onFocusChanged.addListener(function(windowId) { + // Prevent a click in the popup on Ubunto or ChroneOS from closing the + // popup prematurely. + if (windowId == chrome.windows.WINDOW_ID_NONE || windowId == spacesPopupWindowId) { + return; + } + if (!debug && spacesPopupWindowId) { if (spacesPopupWindowId) { closePopupWindow();