/pidgin/main: 911fe254c4fe: Prevent sending NULL to gtk_containe...
Jakub Adam <[email protected]>
| Newsgroups | gmane.comp.gnome.gaim.cvs |
|---|---|
| Message-ID | <[email protected]> |
Changeset: 911fe254c4fec7bbb27fa393bb75127d1fb00ce2 Author: Jakub Adam <[email protected]> Date: 2016-04-07 08:31 +0200 Branch: default URL: https://hg.pidgin.im/pidgin/main/rev/911fe254c4fe Description: Prevent sending NULL to gtk_container_propagate_draw() diffstat: pidgin/gtkstatusbox.c | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diffs (34 lines): diff --git a/pidgin/gtkstatusbox.c b/pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c +++ b/pidgin/gtkstatusbox.c @@ -1992,17 +1992,21 @@ pidgin_status_box_draw(GtkWidget *widget PidginStatusBox *status_box = PIDGIN_STATUS_BOX(widget); gtk_widget_draw(status_box->toggle_button, cr); - gtk_container_propagate_draw(GTK_CONTAINER(widget), status_box->icon_box, cr); gtk_container_propagate_draw(GTK_CONTAINER(widget), status_box->vbox, cr); - if (status_box->icon_box && status_box->icon_opaque) { - GtkAllocation allocation; - GtkStyleContext *context; - - gtk_widget_get_allocation(status_box->icon_box, &allocation); - context = gtk_widget_get_style_context(widget); - gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON); - gtk_render_frame(context, cr, allocation.x-1, allocation.y-1, 34, 34); + if (status_box->icon_box) { + gtk_container_propagate_draw(GTK_CONTAINER(widget), + status_box->icon_box, cr); + + if (status_box->icon_opaque) { + GtkAllocation allocation; + GtkStyleContext *context; + + gtk_widget_get_allocation(status_box->icon_box, &allocation); + context = gtk_widget_get_style_context(widget); + gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON); + gtk_render_frame(context, cr, allocation.x-1, allocation.y-1, 34, 34); + } } return FALSE; } _______________________________________________ Commits mailing list [email protected] https://pidgin.im/cgi-bin/mailman/listinfo/commits