Commit 9bb145a6 authored by Benjamin Otte's avatar Benjamin Otte

widget: Add hack to make label mnemonics work again

Mnemonics for characters that go beyond the baseline (q, y, g) were not
being shown, because they are drawn outside of the label's allocated
This patch just disables the clip-to-size for labels, so that the label
can draw outsize of its allocation. In most cases, that works around
this bug.
parent 7ae4a06d
......@@ -5660,6 +5660,20 @@ gtk_cairo_should_draw_window (cairo_t *cr,
event->window == window;
static gboolean
gtk_widget_get_clip_draw (GtkWidget *widget)
/* labels are not clipped, because clipping them would cause
* mnemonics to not appear on characters that go beyond the
* baseline.
if (GTK_IS_LABEL (widget))
return FALSE;
return TRUE;
/* code shared by gtk_container_propagate_draw() and
* gtk_widget_draw()
......@@ -5673,6 +5687,8 @@ _gtk_widget_draw_internal (GtkWidget *widget,
if (!gtk_widget_is_drawable (widget))
clip_to_size &= gtk_widget_get_clip_draw (widget);
if (clip_to_size)
cairo_rectangle (cr,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment