From c18ce14e00746ce9965331c0516aebbdcc730d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Sat, 23 Jun 2018 19:20:17 +0200 Subject: [PATCH] Return early in Scratch.show if there's no scratch windows --- scratch.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scratch.js b/scratch.js index 7b3fd19..524c714 100644 --- a/scratch.js +++ b/scratch.js @@ -57,9 +57,14 @@ function toggleScratch() { function show() { let windows = getScratchWindows(); + if (windows.length === 0) { + return; + } + TopBar.show(); + windows.slice().reverse() - . map(function(meta_window) { + .map(function(meta_window) { meta_window.unminimize(); meta_window.make_above(); meta_window.get_compositor_private().show();