@@ -575,7 +575,8 @@ image_window_imageui_set_visible(ImageWindow *win,
575575 Imageui * imageui , GtkStackTransitionType transition )
576576{
577577 TileSource * old_tile_source = image_window_get_tile_source (win );
578- TileSource * new_tile_source = imageui ? imageui_get_tile_source (imageui ) : NULL ;
578+ TileSource * new_tile_source =
579+ imageui ? imageui_get_tile_source (imageui ) : NULL ;
579580
580581 VipsImage * image ;
581582 char * title ;
@@ -597,7 +598,8 @@ image_window_imageui_set_visible(ImageWindow *win,
597598
598599 /* Update title and subtitle.
599600 */
600- title = new_tile_source ? (char * ) tile_source_get_path (new_tile_source ) : NULL ;
601+ title = new_tile_source ?
602+ (char * ) tile_source_get_path (new_tile_source ) : NULL ;
601603 title = (char * ) tile_source_get_path (new_tile_source );
602604 gtk_label_set_text (GTK_LABEL (win -> title ), title ? title : "Untitled" );
603605
@@ -636,17 +638,18 @@ image_window_imageui_set_visible(ImageWindow *win,
636638 */
637639 g_autoptr (GVariant ) control =
638640 g_settings_get_value (win -> settings , "control" );
641+
639642 g_object_set (new_tile_source ,
640643 "active" , g_variant_get_boolean (control ),
641644 "visible" , TRUE,
642645 NULL );
646+
647+ //tile_source_changed(new_tile_source);
643648 }
644649
645650 // not a ref, so we can just overwrite it
646651 win -> imageui = imageui ;
647652
648- image_window_reset_view (win );
649-
650653 image_window_changed (win );
651654}
652655
@@ -972,19 +975,18 @@ image_window_duplicate_action(GSimpleAction *action,
972975 GVariant * parameter , gpointer user_data )
973976{
974977 ImageWindow * win = IMAGE_WINDOW (user_data );
978+ GtkStackTransitionType transition = GTK_STACK_TRANSITION_TYPE_NONE ;
975979
976980 VipsdispApp * app ;
977981 ImageWindow * new_win ;
978982 int width , height ;
979983
980984 g_object_get (win , "application" , & app , NULL );
981985 new_win = image_window_new (app );
982- gtk_window_present (GTK_WINDOW (new_win ));
983986
984987 new_win -> n_files = win -> n_files ;
985988 new_win -> files = g_strdupv (win -> files );
986989 new_win -> current_file = win -> current_file ;
987- image_window_open_current_file (new_win , GTK_STACK_TRANSITION_TYPE_NONE );
988990
989991 gtk_window_get_default_size (GTK_WINDOW (win ), & width , & height );
990992 gtk_window_set_default_size (GTK_WINDOW (new_win ), width , height );
@@ -994,7 +996,16 @@ image_window_duplicate_action(GSimpleAction *action,
994996 copy_state (GTK_WIDGET (new_win ), GTK_WIDGET (win ), "properties" );
995997 copy_state (GTK_WIDGET (new_win ), GTK_WIDGET (win ), "background" );
996998
997- // FIXME copy other stuff over eg scale, position etc
999+ if (win -> imageui ) {
1000+ TileSource * tile_source = imageui_get_tile_source (win -> imageui );
1001+ TileSource * new_tile_source = tile_source_duplicate (tile_source );
1002+ Imageui * imageui = imageui_new (new_tile_source );
1003+
1004+ image_window_imageui_add (new_win , imageui );
1005+ image_window_imageui_set_visible (new_win , imageui , transition );
1006+ }
1007+
1008+ gtk_window_present (GTK_WINDOW (new_win ));
9981009}
9991010
10001011static GFile *
0 commit comments