Skip to content

Commit a19b067

Browse files
committed
use thread_execute instead
1 parent 9ea424a commit a19b067

File tree

5 files changed

+4
-15
lines changed

5 files changed

+4
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- animate keypress zoom
1010
- use NN sampling for zoom with gtk 4.10+
1111
- add colour management
12+
- add async infobar updates
1213

1314
## 2.5.1, 23/7/23
1415

meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ configure_file(
3737
configuration: config_h,
3838
)
3939

40-
vips_dep = dependency('vips', version: '>=8.11')
40+
# need vips_thread_execute()
41+
vips_dep = dependency('vips', version: '>=8.15')
4142
gtk_dep = dependency('gtk4')
4243
m_dep = cc.find_library('m')
4344

src/imagewindow.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ struct _ImageWindow
6060
gint64 last_frame_time;
6161

6262
GSettings *settings;
63-
64-
// use for any bg threads we need
65-
VipsThreadset *threadset;
6663
};
6764

6865
G_DEFINE_TYPE( ImageWindow, image_window, GTK_TYPE_APPLICATION_WINDOW );
@@ -86,7 +83,6 @@ image_window_dispose( GObject *object )
8683
printf( "image_window_dispose:\n" );
8784
#endif /*DEBUG*/
8885

89-
VIPS_FREEF( vips_threadset_free, win->threadset );
9086
VIPS_UNREF( win->tile_source );
9187
VIPS_UNREF( win->tile_cache );
9288
VIPS_FREEF( gtk_widget_unparent, win->right_click_menu );
@@ -1368,8 +1364,6 @@ image_window_init( ImageWindow *win )
13681364
win->last_progress_time = -1;
13691365
win->scale_rate = 1.0;
13701366
win->settings = g_settings_new( APPLICATION_ID );
1371-
// only need a couple of threads
1372-
win->threadset = vips_threadset_new( 2 );
13731367

13741368
gtk_widget_init_template( GTK_WIDGET( win ) );
13751369

@@ -1618,8 +1612,3 @@ image_window_get_mouse_position( ImageWindow *win,
16181612
win->last_x_gtk, win->last_y_gtk, x_image, y_image );
16191613
}
16201614

1621-
VipsThreadset *
1622-
image_window_get_threadset( ImageWindow *win )
1623-
{
1624-
return( win->threadset );
1625-
}

src/imagewindow.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ TileSource *image_window_get_tile_source( ImageWindow *win );
1313
void image_window_set_tile_source( ImageWindow *win, TileSource *tile_source );
1414
void image_window_get_mouse_position( ImageWindow *win,
1515
double *image_x, double *image_y );
16-
VipsThreadset *image_window_get_threadset( ImageWindow *win );
1716

1817
#endif /* __IMAGE_WINDOW_H */
1918

src/infobar.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,7 @@ infobar_update_pixel( Infobar *infobar )
215215
g_object_ref( update->infobar );
216216
g_object_ref( update->tile_source );
217217

218-
if( vips_threadset_run(image_window_get_threadset( win ), "pixel",
219-
infobar_get_pixel, update ) )
218+
if( vips_thread_execute( "pixel", infobar_get_pixel, update ) )
220219
// if we can't run a bg task, we must free the update
221220
infobar_update_free( update );
222221
}

0 commit comments

Comments
 (0)