diff options
Diffstat (limited to 'src/ui/send_file.c')
-rw-r--r-- | src/ui/send_file.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ui/send_file.c b/src/ui/send_file.c index 4b9643c..f6fb6db 100644 --- a/src/ui/send_file.c +++ b/src/ui/send_file.c | |||
@@ -94,7 +94,8 @@ handle_file_redraw_animation(gpointer user_data) | |||
94 | 94 | ||
95 | handle->redraw_animation = 0; | 95 | handle->redraw_animation = 0; |
96 | 96 | ||
97 | if (handle->file_drawing_area) | 97 | if ((handle->file_drawing_area) && |
98 | ((handle->image) || (handle->animation) || (handle->animation_iter))) | ||
98 | gtk_widget_queue_draw(GTK_WIDGET(handle->file_drawing_area)); | 99 | gtk_widget_queue_draw(GTK_WIDGET(handle->file_drawing_area)); |
99 | 100 | ||
100 | return FALSE; | 101 | return FALSE; |
@@ -224,7 +225,8 @@ handle_file_chooser_button_file_set(GtkFileChooserButton *file_chooser_button, | |||
224 | g_free(filename); | 225 | g_free(filename); |
225 | } | 226 | } |
226 | 227 | ||
227 | gtk_widget_queue_draw(GTK_WIDGET(handle->file_drawing_area)); | 228 | if (handle->file_drawing_area) |
229 | gtk_widget_queue_draw(GTK_WIDGET(handle->file_drawing_area)); | ||
228 | } | 230 | } |
229 | 231 | ||
230 | void | 232 | void |
@@ -257,7 +259,7 @@ ui_send_file_dialog_init(MESSENGER_Application *app, | |||
257 | gtk_builder_get_object(handle->builder, "file_chooser_button") | 259 | gtk_builder_get_object(handle->builder, "file_chooser_button") |
258 | ); | 260 | ); |
259 | 261 | ||
260 | g_signal_connect( | 262 | handle->file_draw_signal = g_signal_connect( |
261 | handle->file_drawing_area, | 263 | handle->file_drawing_area, |
262 | "draw", | 264 | "draw", |
263 | G_CALLBACK(handle_file_drawing_area_draw), | 265 | G_CALLBACK(handle_file_drawing_area_draw), |
@@ -330,5 +332,10 @@ ui_send_file_dialog_cleanup(UI_SEND_FILE_Handle *handle) | |||
330 | { | 332 | { |
331 | _clear_file_preview_data(handle); | 333 | _clear_file_preview_data(handle); |
332 | 334 | ||
335 | g_signal_handler_disconnect( | ||
336 | handle->file_drawing_area, | ||
337 | handle->file_draw_signal | ||
338 | ); | ||
339 | |||
333 | g_object_unref(handle->builder); | 340 | g_object_unref(handle->builder); |
334 | } | 341 | } |