GNOME Bugzilla – Bug 442297
Submenu placement uses stale requisition for calculations
Last modified: 2011-06-01 04:28:38 UTC
gtk_menu_item_position_menu() bases its submenu placement calculations on widget->requisition values which may not be correct as it's bypassing the size-request signal. For example I have an application which implements maximum width for menus by hooking up to the size-request signal and limiting the width of the requisition.
Created attachment 89051 [details] [review] [PATCH] Ensure proper requisition when positioning submenus * gtk/gtkmenuitem.c (gtk_menu_item_position_menu): Ensure proper requisition by calling gtk_widget_size_request() instead of relying on widget->requisition. (#442297) --- gtk/gtkmenuitem.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
Created attachment 89055 [details] testcase
On second thought, is calling gtk_widget_set_size_request() in "size-request" signal callback legal?
Created attachment 89418 [details] [review] [PATCH] Handle gtk_widget_set_size_request() during ::size-request Tim asked me to submit this patch for review. It doesn't fix my original bug, though.
Rotting patches... gtk+ guys, can this please get a review?
Created attachment 121865 [details] [review] Handle gtk_widget_set_size_request() during ::size-request Updated patch to trunk for ease of testing.
Sounds scary, like infinite loop territory. Has this been well-tested ?
I believe this has recently been fixed.