diff options
author | Kristian Monsen <kristianm@google.com> | 2010-06-28 16:42:48 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2010-07-02 10:29:56 +0100 |
commit | 06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch) | |
tree | 20c1428cd05c76f32394ab354ea35ed99acd86d8 /WebCore/platform/gtk/PopupMenuGtk.cpp | |
parent | 72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff) | |
download | external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2 |
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
Diffstat (limited to 'WebCore/platform/gtk/PopupMenuGtk.cpp')
-rw-r--r-- | WebCore/platform/gtk/PopupMenuGtk.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/WebCore/platform/gtk/PopupMenuGtk.cpp b/WebCore/platform/gtk/PopupMenuGtk.cpp index f29d51b..bf8cfb4 100644 --- a/WebCore/platform/gtk/PopupMenuGtk.cpp +++ b/WebCore/platform/gtk/PopupMenuGtk.cpp @@ -89,22 +89,24 @@ void PopupMenu::show(const IntRect& rect, FrameView* view, int index) gtk_widget_size_request(GTK_WIDGET(m_popup.get()), &requisition); gtk_widget_set_size_request(GTK_WIDGET(m_popup.get()), std::max(rect.width(), requisition.width), -1); - GList* children = GTK_MENU_SHELL(m_popup.get())->children; + GList* children = gtk_container_get_children(GTK_CONTAINER(m_popup.get())); + GList* p = children; if (size) for (int i = 0; i < size; i++) { if (i > index) break; - GtkWidget* item = reinterpret_cast<GtkWidget*>(children->data); + GtkWidget* item = reinterpret_cast<GtkWidget*>(p->data); GtkRequisition itemRequisition; gtk_widget_get_child_requisition(item, &itemRequisition); m_menuPosition.setY(m_menuPosition.y() - itemRequisition.height); - children = g_list_next(children); + p = g_list_next(p); } else // Center vertically the empty popup in the combo box area m_menuPosition.setY(m_menuPosition.y() - rect.height() / 2); + g_list_free(children); gtk_menu_popup(m_popup.get(), 0, 0, reinterpret_cast<GtkMenuPositionFunc>(menuPositionFunction), this, 0, gtk_get_current_event_time()); } |