input on children are blocked if an overlay has a label with wrap set
When an overlay have a GtkLabel as an overlay child, the inputs to normal child is blocked if the label has wrap
set to true, and wrap-mode
is word-char
or char
.
How to reproduce:
- compile the following with gtk3 and run
- try to click on the button below the label
Result: The portion of button directly below the label isn't clickable. The code works fine with GTK4
minimal code to reproduce:
#include <gtk/gtk.h>
gchar *str =
"<interface>"
" <object class=\"GtkApplicationWindow\" id=\"window\">"
" <property name=\"visible\">1</property>"
" <property name=\"default-width\">400</property>"
" <property name=\"default-height\">300</property>"
" <child>"
" <object class=\"GtkOverlay\">"
" <property name=\"visible\">1</property>"
" <child type=\"overlay\">"
" <object class=\"GtkLabel\" id=\"notification_label\">"
" <property name=\"halign\">center</property>"
" <property name=\"valign\">start</property>"
" <property name=\"visible\">1</property>"
" <property name=\"label\">Very Long label just for testing purposes</property>"
" <property name=\"wrap\">1</property>"
" <property name=\"wrap-mode\">word-char</property>"
" <style>"
" <class name=\"frame\" />"
" <class name=\"app-notification\" />"
" </style>"
" </object>"
" </child>"
" <child>"
" <object class=\"GtkButton\">"
" <property name=\"margin-top\">40</property>"
" <property name=\"visible\">1</property>"
" <property name=\"valign\">center</property>"
" <property name=\"label\">Very long text</property>"
" </object>"
" </child>"
" </object>"
" </child>"
" </object>"
"</interface>";
static void
app_activate_cb (GApplication *app)
{
GtkBuilder *builder;
GtkWidget *window;
g_application_hold (app);
builder = gtk_builder_new_from_string (str, -1);
window = GTK_WIDGET (gtk_builder_get_object (builder, "window"));
gtk_widget_show (window);
}
int
main (int argc,
char *argv[])
{
GtkApplication *app;
int status;
app = gtk_application_new (NULL, 0);
g_signal_connect (app, "activate", G_CALLBACK (app_activate_cb), NULL);
status = g_application_run (G_APPLICATION (app), argc, argv);
return status;
}
Edited by Mohammed Sadiq