Fix for bug 672961 - Custom theme can crash apps with GtkEntryCompletion

This commit is contained in:
Benjamin Otte 2012-03-27 20:29:56 -04:00 committed by Joanmarie Diggs
parent 52bd5f2f1f
commit 94dbefda1c

View File

@ -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);