After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 442297 - Submenu placement uses stale requisition for calculations
Submenu placement uses stale requisition for calculations
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2007-05-30 12:05 UTC by Tommi Komulainen
Modified: 2011-06-01 04:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] Ensure proper requisition when positioning submenus (877 bytes, patch)
2007-05-30 12:05 UTC, Tommi Komulainen
none Details | Review
testcase (1.61 KB, text/plain)
2007-05-30 13:19 UTC, Tommi Komulainen
  Details
[PATCH] Handle gtk_widget_set_size_request() during ::size-request (1.10 KB, patch)
2007-06-05 15:50 UTC, Tommi Komulainen
none Details | Review
Handle gtk_widget_set_size_request() during ::size-request (782 bytes, patch)
2008-11-03 13:52 UTC, Christian Dywan
none Details | Review

Description Tommi Komulainen 2007-05-30 12:05:02 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.
Comment 1 Tommi Komulainen 2007-05-30 12:05:56 UTC
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(-)
Comment 2 Tommi Komulainen 2007-05-30 13:19:24 UTC
Created attachment 89055 [details]
testcase
Comment 3 Tommi Komulainen 2007-06-01 17:24:47 UTC
On second thought, is calling gtk_widget_set_size_request() in "size-request" signal callback legal?
Comment 4 Tommi Komulainen 2007-06-05 15:50:25 UTC
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.
Comment 5 André Klapper 2008-11-03 12:57:30 UTC
Rotting patches...

gtk+ guys, can this please get a review?
Comment 6 Christian Dywan 2008-11-03 13:52:24 UTC
Created attachment 121865 [details] [review]
Handle gtk_widget_set_size_request() during ::size-request

Updated patch to trunk for ease of testing.
Comment 7 Matthias Clasen 2008-11-04 02:25:34 UTC
Sounds scary, like infinite loop territory. 

Has this been well-tested ?
Comment 8 Matthias Clasen 2011-06-01 04:28:38 UTC
I believe this has recently been fixed.