@@ -262,6 +262,14 @@ image_window_bestfit( ImageWindow *win )
262262 }
263263}
264264
265+ static void
266+ image_window_preeval ( VipsImage * image ,
267+ VipsProgress * progress , ImageWindow * win )
268+ {
269+ gtk_action_bar_set_revealed ( GTK_ACTION_BAR ( win -> progress_bar ),
270+ TRUE );
271+ }
272+
265273typedef struct _EvalUpdate {
266274 ImageWindow * win ;
267275 int eta ;
@@ -277,11 +285,6 @@ image_window_eval_idle( void *user_data )
277285 char str [256 ];
278286 VipsBuf buf = VIPS_BUF_STATIC ( str );
279287
280- // you'd think we could do this in preeval, but it doesn't always seem to
281- // fire for some reason
282- gtk_action_bar_set_revealed ( GTK_ACTION_BAR ( win -> progress_bar ),
283- TRUE );
284-
285288 vips_buf_appendf ( & buf , "%d%% complete, %d seconds to go" ,
286289 update -> percent , update -> eta );
287290 gtk_progress_bar_set_text ( GTK_PROGRESS_BAR ( win -> progress ),
@@ -1462,6 +1465,8 @@ image_window_set_tile_source( ImageWindow *win, TileSource *tile_source )
14621465 "tile-cache" , win -> tile_cache ,
14631466 NULL );
14641467
1468+ g_signal_connect_object ( win -> tile_source , "preeval" ,
1469+ G_CALLBACK ( image_window_preeval ), win , 0 );
14651470 g_signal_connect_object ( win -> tile_source , "eval" ,
14661471 G_CALLBACK ( image_window_eval ), win , 0 );
14671472 g_signal_connect_object ( win -> tile_source , "posteval" ,
@@ -1509,6 +1514,10 @@ image_window_set_tile_source( ImageWindow *win, TileSource *tile_source )
15091514 tile_source -> active =
15101515 g_settings_get_boolean ( win -> settings , "control" );
15111516
1517+ /* Everything is set up ... start loading the image.
1518+ */
1519+ tile_source_background_load ( tile_source );
1520+
15121521 image_window_changed ( win );
15131522}
15141523
0 commit comments