File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,12 +245,9 @@ - (void)handleWillClose:(NSNotification *)note
245245 with a now-removed scaler) rather than show ui_error from
246246 scaler_select_id every time Preferences closes. */
247247 int new_scaler = scaler_get_type ( settings_current.start_scaler_mode );
248- if ( new_scaler >= 0 ) {
249- /* scaler_select_scaler is a no-op when the requested scaler is already
250- current; if it isn't supported on the current machine it returns
251- non-zero and current_scaler is left unchanged. When the scaler does
252- change, the hotswap inside picks up the new bilinear setting via
253- createTexture, so no separate hotswap call is needed for that path. */
248+ if ( new_scaler >= 0 && new_scaler != current_scaler ) {
249+ /* Changing the scaler hotswaps graphics; selecting the current scaler
250+ would also hotswap and resize the emulator window when Preferences closes. */
254251 scaler_select_scaler ( new_scaler );
255252 }
256253
Original file line number Diff line number Diff line change 9191static uint16_t bw_values[16 ];
9292
9393static int display_updated = 0 ;
94+ static int window_resize_enabled = 0 ;
9495
9596/* This is a rule of thumb for the maximum number of rects that can be updated
9697 each frame. */
@@ -241,10 +242,10 @@ Callers may be on a worker thread (fuse_init runs on the emulator thread
241242static void
242243cocoadisplay_resize_window ( void )
243244{
244- /* Skip during the very first uidisplay_init so the xib's window size is
245- preserved at launch. Subsequent inits (machine change) and every
246- hotswap will resize. */
247- if ( !display_ui_initialised || settings_current.full_screen ) return ;
245+ /* Startup applies the saved scaler before the first rendered frame; let
246+ AppKit keep the restored window frame until emulation is visibly running. */
247+ if ( !display_ui_initialised || !window_resize_enabled ||
248+ settings_current.full_screen ) return ;
248249
249250 float factor = scaler_get_scaling_factor ( current_scaler );
250251 NSSize size = NSMakeSize ( image_width * factor, image_height * factor );
@@ -532,6 +533,8 @@ pixels is NULL on the very first hotswap (before uidisplay_init has run
532533{
533534 int i;
534535
536+ window_resize_enabled = 1 ;
537+
535538 if ( display_updated ) {
536539 /* obtain lock for buffered screen */
537540 [buffered_screen_lock lock ];
You can’t perform that action at this time.
0 commit comments