-
Bug
-
Resolution: Won't Do
-
Normal
-
None
-
rhel-7.9.z
-
None
-
Moderate
-
5
-
rhel-display-desktop-foundation
-
ssg_display
-
8
-
False
-
False
-
-
None
-
DESKTOP Cycle #1 10.beta phase, DESKTOP Cycle #3 10.beta phase, DESKTOP Cycle #4 10.beta phase, DESKTOP Cycle #5 10.beta phase, DESKTOP Cycle #2 10.beta phase
-
None
-
None
-
If docs needed, set a value
-
-
x86_64
-
None
-
57,005
Description of problem:
See Eclipse bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=564910
Version-Release number of selected component (if applicable):
GTK 3.22.30-5 (gtk3-3.22.30-5.el7.x86_64)
How reproducible:
In Eclipse, reproducible with steps listed here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=564910#c1
See video attached to the Eclipse bug: https://bugs.eclipse.org/bugs/attachment.cgi?id=287854
So far we have no GTK+ snippet (or Eclipse SWT only snippet) to reproduce the problem with.
Actual results:
Context menu shows ever-growing blank area when scrolling down.
Expected results:
Context menu has no blank area when scrolling down.
Additional info:
After adding prints, it seems that scroll_offset has very high values while this method runs (when the bug occurs):
static void
gtk_menu_scroll_by (GtkMenu *menu,
gint step)
{
GtkMenuPrivate *priv = menu->priv;
GtkBorder arrow_border;
GtkWidget *widget;
gint offset;
gint view_height;
widget = GTK_WIDGET (menu);
offset = priv->scroll_offset + step;
get_arrows_border (menu, &arrow_border);
/* Don't scroll over the top if we weren't before: */
if ((priv->scroll_offset >= 0) && (offset < 0))
offset = 0;
view_height = gdk_window_get_height (gtk_widget_get_window (widget));
if (priv->scroll_offset == 0 &&
view_height >= priv->requested_height)
return;
/* Don't scroll past the bottom if we weren't before: */
if (priv->scroll_offset > 0)
view_height -= arrow_border.top;
/* Since arrows are shown, reduce view height even more */
view_height -= arrow_border.bottom;
if ((priv->scroll_offset + view_height <= priv->requested_height) &&
(offset + view_height > priv->requested_height))
offset = priv->requested_height - view_height;
if (offset != priv->scroll_offset)
gtk_menu_scroll_to (menu, offset);
}
While checking the GTK+ code in gtkmenu.c, I noticed this bug and patch:
https://bugzilla.gnome.org/show_bug.cgi?id=678113
https://github.com/GNOME/gtk/commit/bd3ca2b30efc534f8b7c18dfd8a9f072592044c7
After adding clamping to the method above, the blank area of the menu was reduced to only 1 blank item at most (while not ideal, still a lot better than before, see attached video "bug564910_gtkmenu_offset_clamp.mp4"):
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 8f7715022f..09cbec26ab 100644
— a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -4175,7 +4175,12 @@ gtk_menu_scroll_by (GtkMenu *menu,
offset = priv->requested_height - view_height;
if (offset != priv->scroll_offset)
+
}
static gboolean