File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -59,17 +59,22 @@ export function createWindow(
59
59
...configs ,
60
60
} )
61
61
62
- window . on ( "enter-html-full-screen" , ( ) => {
63
- window . setBackgroundColor ( "" )
64
- window . webContents . invalidate ( )
65
- } )
66
- window . on ( "leave-html-full-screen" , ( ) => {
67
- window . setBackgroundColor ( "" )
68
-
69
- window . webContents . invalidate ( )
62
+ function refreshBound ( timeout = 0 ) {
70
63
setTimeout ( ( ) => {
71
- window . setBackgroundColor ( "#00000000" )
72
- } , 10_000 )
64
+ const mainWindow = getMainWindow ( )
65
+ if ( ! mainWindow ) return
66
+ // FIXME: workaround for theme bug in full screen mode
67
+ const size = mainWindow . getSize ( )
68
+ mainWindow . setSize ( size [ 0 ] + 1 , size [ 1 ] + 1 )
69
+ mainWindow . setSize ( size [ 0 ] , size [ 1 ] )
70
+ } , timeout )
71
+ }
72
+
73
+ window . on ( "leave-html-full-screen" , ( ) => {
74
+ // To solve the vibrancy losing issue when leaving full screen mode
75
+ // @see https://github.com/toeverything/AFFiNE/blob/280e24934a27557529479a70ab38c4f5fc65cb00/packages/frontend/electron/src/main/windows-manager/main-window.ts:L157
76
+ refreshBound ( )
77
+ refreshBound ( 1000 )
73
78
} )
74
79
75
80
window . on ( "ready-to-show" , ( ) => {
You can’t perform that action at this time.
0 commit comments