From 94dbefda1c5da3d8b8265593c686f5deee24e71c Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 27 Mar 2012 20:29:56 -0400 Subject: [PATCH] Fix for bug 672961 - Custom theme can crash apps with GtkEntryCompletion --- gtk/gtkentrycompletion.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index bfaaa1ca15..8367ed9957 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -1513,7 +1513,9 @@ _gtk_entry_completion_resize_popup (GtkEntryCompletion *completion) monitor_num = gdk_screen_get_monitor_at_window (screen, window); gdk_screen_get_monitor_workarea (screen, monitor_num, &monitor); - if (y > monitor.height / 2) + if (height == 0) + items = 0; + else if (y > monitor.height / 2) items = MIN (matches, (((monitor.y + y) - (actions * action_height)) / height) - 1); else items = MIN (matches, (((monitor.height - y) - (actions * action_height)) / height) - 1);