Merge pull request #55 from HarryHeres/fix/macos-window-buttons-hover

Fixed MacOS window buttons hover in compact mode
This commit is contained in:
mr. m 🤙 2024-10-17 20:31:06 +03:00 committed by GitHub
commit a7eecc0d9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {