From 624eb624539540595f8341a3bb877a9cf85637c4 Mon Sep 17 00:00:00 2001 From: HarryHeres Date: Wed, 16 Oct 2024 21:19:58 +0200 Subject: [PATCH] Fixed MacOS window buttons hover in compact mode --- src/ZenCompactMode.mjs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ZenCompactMode.mjs b/src/ZenCompactMode.mjs index de14e9a..9a446e4 100644 --- a/src/ZenCompactMode.mjs +++ b/src/ZenCompactMode.mjs @@ -187,6 +187,15 @@ var gZenCompactModeManager = { }); target.addEventListener('mouseleave', (event) => { + // If on Mac, ignore mouseleave in the area of window buttons + if (AppConstants.platform == 'macosx') { + const MAC_WINDOW_BUTTONS_X_BORDER = 75; + const MAC_WINDOW_BUTTONS_Y_BORDER = 40; + if (event.clientX < MAC_WINDOW_BUTTONS_X_BORDER && event.clientY < MAC_WINDOW_BUTTONS_Y_BORDER) { + return; + } + } + if (this.hoverableElements[i].keepHoverDuration) { this.flashElement(target, keepHoverDuration, 'has-hover' + target.id, 'zen-has-hover'); } else {