Improve reliability of click events for IncomingCallBar

This commit is contained in:
trevor-signal 2023-08-22 10:22:04 -04:00 committed by GitHub
parent 3a32afd045
commit 6e36aa7a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View file

@ -33,6 +33,15 @@
}
-webkit-app-region: var(--draggable-app-region);
// In Electron v23+, clicking on a `drag` region in an unfocused window may not
// propagate clicks to no-drag elements that have a higher CSS order; this avoids that
// scenario for interactive elements (e.g. IncomingCallBar) which overlap the
// conversation header.
@at-root body:not(.window-focused) & {
-webkit-app-region: no-drag;
}
padding-top: var(--title-bar-drag-area-height);
display: flex;
flex-direction: row;

View file

@ -837,6 +837,14 @@ export async function startApp(): Promise<void> {
);
});
window.document.body.classList.add('window-focused');
window.addEventListener('focus', () => {
window.document.body.classList.add('window-focused');
});
window.addEventListener('blur', () =>
window.document.body.classList.remove('window-focused')
);
// How long since we were last running?
const lastHeartbeat = toDayMillis(window.storage.get('lastHeartbeat', 0));
const previousLastStartup = window.storage.get('lastStartup');