[Github-comments] [geany/geany] ui-utils: Fix ui_path_box_new with GTK+ >= 3.20 (#995)

Colomban Wendling notifications at xxxxx
Tue Apr 12 15:56:00 UTC 2016


> @@ -1919,7 +1919,9 @@ GtkWidget *ui_path_box_new(const gchar *title, GtkFileChooserAction action, GtkE
>  	vbox = gtk_vbox_new(FALSE, 0);
>  	if (gtk_widget_get_parent(path_entry))	/* entry->parent may be a GtkComboBoxEntry */
>  	{
> -		GtkWidget *parent = gtk_widget_get_parent(path_entry);
> +		GtkWidget *parent = path_entry, *next_parent;
> +		while ((next_parent = gtk_widget_get_parent(parent)) != NULL)
> +			parent = next_parent;

while at it doing something like that, we could simplify the code by always resolving the parent and using that, dropping the conditional here -- e.g. doing what this block does, but unconditionally.  If the first `get_parent()` returns NULL, it's the same as the else block anyway.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/995/files/8539388b6e51dc932fafa21f4c4395355c5d64ee#r59401942
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160412/ad4102c5/attachment.html>


More information about the Github-comments mailing list