File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -341,8 +341,10 @@ impl App {
341341 NodeGraphExecutionResult :: NotRun => { }
342342 } ,
343343 AppEvent :: UiUpdate ( texture) => {
344+ let width = texture. width ( ) ;
345+ let height = texture. height ( ) ;
344346 if let Some ( graphics_state) = self . graphics_state . as_mut ( ) {
345- graphics_state. resize ( texture . width ( ) , texture . height ( ) ) ;
347+ graphics_state. resize ( width, height) ;
346348 graphics_state. bind_ui_texture ( texture) ;
347349 let elapsed = self . last_ui_update . elapsed ( ) . as_secs_f32 ( ) ;
348350 self . last_ui_update = Instant :: now ( ) ;
@@ -351,6 +353,20 @@ impl App {
351353 }
352354 }
353355 if let Some ( window) = & self . window {
356+ // Workaround for missing resize events on mac
357+ // TODO: Find a cleaner solution
358+ #[ cfg( target_os = "macos" ) ]
359+ {
360+ let surface_size = window. surface_size ( ) ;
361+ if width != surface_size. width || height != surface_size. height {
362+ let _ = self . cef_view_info_sender . send ( cef:: ViewInfoUpdate :: Size {
363+ width : surface_size. width as usize ,
364+ height : surface_size. height as usize ,
365+ } ) ;
366+ self . cef_context . notify_view_info_changed ( ) ;
367+ }
368+ }
369+
354370 window. request_redraw ( ) ;
355371 }
356372 }
You can’t perform that action at this time.
0 commit comments