@@ -512,26 +512,6 @@ function ensureInitialBackendWindowOpen(): void {
512512 backendInitialWindowOpenInFlight = nextOpen ;
513513}
514514
515- function getDesktopWindowBackgroundColor ( ) : string {
516- return nativeTheme . shouldUseDarkColors
517- ? DESKTOP_WINDOW_BACKGROUND_DARK
518- : DESKTOP_WINDOW_BACKGROUND_LIGHT ;
519- }
520-
521- function applyDesktopWindowBackground ( window : BrowserWindow ) : void {
522- if ( window . isDestroyed ( ) ) {
523- return ;
524- }
525-
526- window . setBackgroundColor ( getDesktopWindowBackgroundColor ( ) ) ;
527- }
528-
529- function syncAllDesktopWindowBackgrounds ( ) : void {
530- for ( const window of BrowserWindow . getAllWindows ( ) ) {
531- applyDesktopWindowBackground ( window ) ;
532- }
533- }
534-
535515
536516function writeDesktopStreamChunk (
537517 streamName : "stdout" | "stderr" ,
@@ -1722,7 +1702,7 @@ function registerIpcHandlers(): void {
17221702 }
17231703
17241704 nativeTheme . themeSource = theme ;
1725- syncAllDesktopWindowBackgrounds ( ) ;
1705+ syncAllWindowAppearance ( ) ;
17261706 } ) ;
17271707
17281708 ipcMain . removeHandler ( CONTEXT_MENU_CHANNEL ) ;
@@ -1893,7 +1873,9 @@ function getIconOption(): { icon: string } | Record<string, never> {
18931873}
18941874
18951875function getInitialWindowBackgroundColor ( ) : string {
1896- return nativeTheme . shouldUseDarkColors ? "#0a0a0a" : "#ffffff" ;
1876+ return nativeTheme . shouldUseDarkColors
1877+ ? DESKTOP_WINDOW_BACKGROUND_DARK
1878+ : DESKTOP_WINDOW_BACKGROUND_LIGHT ;
18971879}
18981880
18991881function getWindowTitleBarOptions ( ) : WindowTitleBarOptions {
@@ -1934,7 +1916,6 @@ function syncAllWindowAppearance(): void {
19341916 }
19351917}
19361918
1937- nativeTheme . on ( "updated" , syncAllWindowAppearance ) ;
19381919
19391920function createWindow ( ) : BrowserWindow {
19401921 const window = new BrowserWindow ( {
@@ -1944,9 +1925,8 @@ function createWindow(): BrowserWindow {
19441925 minHeight : 620 ,
19451926 show : false ,
19461927 autoHideMenuBar : true ,
1947- backgroundColor : getInitialWindowBackgroundColor ( ) ,
19481928 ...getIconOption ( ) ,
1949- backgroundColor : getDesktopWindowBackgroundColor ( ) ,
1929+ backgroundColor : getInitialWindowBackgroundColor ( ) ,
19501930 title : APP_DISPLAY_NAME ,
19511931 ...getWindowTitleBarOptions ( ) ,
19521932 webPreferences : {
@@ -2139,7 +2119,7 @@ app
21392119 configureAppIdentity ( ) ;
21402120 configureApplicationMenu ( ) ;
21412121 registerDesktopProtocol ( ) ;
2142- nativeTheme . on ( "updated" , syncAllDesktopWindowBackgrounds ) ;
2122+ nativeTheme . on ( "updated" , syncAllWindowAppearance ) ;
21432123 configureAutoUpdater ( ) ;
21442124 void bootstrap ( ) . catch ( ( error ) => {
21452125 if ( isBackendReadinessAborted ( error ) && isQuitting ) {
0 commit comments