diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2022-01-03 21:57:31 +0100 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2022-01-03 21:57:31 +0100 |
commit | 116950a5b6e91309281696aa4f7aa0857185a6d2 (patch) | |
tree | 90ce92898e00e4e35db46bfd926e98cc71d91080 | |
parent | a33950ee5629586f631e63dceb984346d8702b85 (diff) | |
download | messenger-gtk-116950a5b6e91309281696aa4f7aa0857185a6d2.tar.gz messenger-gtk-116950a5b6e91309281696aa4f7aa0857185a6d2.zip |
Fixed some warnings of invalidly queued draw signals
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
-rw-r--r-- | src/ui/new_contact.c | 7 | ||||
-rw-r--r-- | src/ui/new_contact.h | 2 | ||||
-rw-r--r-- | src/ui/send_file.c | 13 | ||||
-rw-r--r-- | src/ui/send_file.h | 2 |
4 files changed, 20 insertions, 4 deletions
diff --git a/src/ui/new_contact.c b/src/ui/new_contact.c index 147f591..7ed3710 100644 --- a/src/ui/new_contact.c +++ b/src/ui/new_contact.c | |||
@@ -324,7 +324,7 @@ ui_new_contact_dialog_init(MESSENGER_Application *app, | |||
324 | handle | 324 | handle |
325 | ); | 325 | ); |
326 | 326 | ||
327 | g_signal_connect( | 327 | handle->id_draw_signal = g_signal_connect( |
328 | handle->id_drawing_area, | 328 | handle->id_drawing_area, |
329 | "draw", | 329 | "draw", |
330 | G_CALLBACK(handle_id_drawing_area_draw), | 330 | G_CALLBACK(handle_id_drawing_area_draw), |
@@ -377,6 +377,11 @@ ui_new_contact_dialog_cleanup(UI_NEW_CONTACT_Handle *handle) | |||
377 | 377 | ||
378 | handle->idle_processing = 0; | 378 | handle->idle_processing = 0; |
379 | 379 | ||
380 | g_signal_handler_disconnect( | ||
381 | handle->id_drawing_area, | ||
382 | handle->id_draw_signal | ||
383 | ); | ||
384 | |||
380 | g_object_unref(handle->builder); | 385 | g_object_unref(handle->builder); |
381 | 386 | ||
382 | if (handle->image) | 387 | if (handle->image) |
diff --git a/src/ui/new_contact.h b/src/ui/new_contact.h index 4ab397a..6eb2642 100644 --- a/src/ui/new_contact.h +++ b/src/ui/new_contact.h | |||
@@ -47,6 +47,8 @@ typedef struct UI_NEW_CONTACT_Handle | |||
47 | GtkDrawingArea *id_drawing_area; | 47 | GtkDrawingArea *id_drawing_area; |
48 | GtkEntry *id_entry; | 48 | GtkEntry *id_entry; |
49 | 49 | ||
50 | gulong id_draw_signal; | ||
51 | |||
50 | GtkButton *cancel_button; | 52 | GtkButton *cancel_button; |
51 | GtkButton *confirm_button; | 53 | GtkButton *confirm_button; |
52 | 54 | ||
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 | } |
diff --git a/src/ui/send_file.h b/src/ui/send_file.h index 1a68681..cdcfb28 100644 --- a/src/ui/send_file.h +++ b/src/ui/send_file.h | |||
@@ -37,6 +37,8 @@ typedef struct UI_SEND_FILE_Handle | |||
37 | GtkDrawingArea *file_drawing_area; | 37 | GtkDrawingArea *file_drawing_area; |
38 | GtkFileChooserButton *file_chooser_button; | 38 | GtkFileChooserButton *file_chooser_button; |
39 | 39 | ||
40 | gulong file_draw_signal; | ||
41 | |||
40 | GtkButton *cancel_button; | 42 | GtkButton *cancel_button; |
41 | GtkButton *send_button; | 43 | GtkButton *send_button; |
42 | 44 | ||