From b0c06b8a73b4644698a6c0baa9d352fbe368cc85 Mon Sep 17 00:00:00 2001 From: abakkk Date: Wed, 24 Jun 2020 23:16:22 +0200 Subject: [PATCH] Fix modal toggling criterion Use `Main._findModal` instead of `Main.actionMode` as the criterion of the toggle direction. Main.actionMode is not a safe criterion to know if the area is modal. For example, `Main.actionMode` is modified when toggling overview while drawing. --- extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extension.js b/extension.js index d690b11..6cb2616 100644 --- a/extension.js +++ b/extension.js @@ -337,7 +337,7 @@ var AreaManager = new Lang.Class({ // The menu changes Main.actionMode. this.activeArea.closeMenu(); - if (Main.actionMode & DRAWING_ACTION_MODE) { + if (Main._findModal(this.activeArea) != -1) { Main.popModal(this.activeArea); setCursor('DEFAULT'); this.activeArea.reactive = false; @@ -364,7 +364,7 @@ var AreaManager = new Lang.Class({ if (this.hiddenList) this.togglePanelAndDockOpacity(); - if (Main.actionMode & DRAWING_ACTION_MODE) + if (Main._findModal(this.activeArea) != -1) this.toggleModal(); this.toggleContainer(); this.activeArea = null;