[MM-59252] Fix resizing app when welcome screen is open on macOS, force button to always appear on welcome screen (#3112)

This commit is contained in:
Devin Binnie 2024-07-29 13:23:57 -04:00 committed by GitHub
parent e68d97e578
commit b2cd2dc60d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 1 deletions

View file

@ -93,6 +93,7 @@ import {
OPEN_WINDOWS_CAMERA_PREFERENCES,
OPEN_WINDOWS_MICROPHONE_PREFERENCES,
GET_MEDIA_ACCESS_STATUS,
VIEW_FINISHED_RESIZING,
} from 'common/communication';
console.log('Preload initialized');
@ -178,6 +179,7 @@ contextBridge.exposeInMainWorld('desktop', {
openWindowsCameraPreferences: () => ipcRenderer.send(OPEN_WINDOWS_CAMERA_PREFERENCES),
openWindowsMicrophonePreferences: () => ipcRenderer.send(OPEN_WINDOWS_MICROPHONE_PREFERENCES),
getMediaAccessStatus: (mediaType) => ipcRenderer.invoke(GET_MEDIA_ACCESS_STATUS, mediaType),
viewFinishedResizing: () => ipcRenderer.send(VIEW_FINISHED_RESIZING),
downloadsDropdown: {
toggleDownloadsDropdownMenu: (payload) => ipcRenderer.send(TOGGLE_DOWNLOADS_DROPDOWN_MENU, payload),

View file

@ -36,6 +36,12 @@ function WelcomeScreen({
useEffect(() => {
setShowContent(true);
// Let the main process know when the window has finished resizing
// This is to reduce the amount of white box that happens when expand the BrowserView
window.addEventListener('resize', () => {
window.desktop.viewFinishedResizing();
});
}, []);
const slides = useMemo(() => [

View file

@ -9,7 +9,7 @@ body {
--stipple-opacity: 0.08;
display: flex;
justify-content: center;
justify-content: flex-end;
align-items: center;
position: absolute;
top: 0px;

View file

@ -97,6 +97,7 @@ declare global {
openWindowsCameraPreferences: () => void;
openWindowsMicrophonePreferences: () => void;
getMediaAccessStatus: (mediaType: 'microphone' | 'camera' | 'screen') => Promise<'not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown'>;
viewFinishedResizing: () => void;
modals: {
cancelModal: <T>(data?: T) => void;