Commit c6ed9848 authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Fix propagation of keyboard events when the focused widget is not realized.

[GB.GTK]
* BUG: Fix propagation of keyboard events when the focused widget is not realized.

[GB.GTK3]
* BUG: Fix propagation of keyboard events when the focused widget is not realized.
parent bfbc55e4
Pipeline #333366097 passed with stage
in 24 minutes and 29 seconds
......@@ -375,7 +375,7 @@ void gKey::setActiveControl(gControl *control)
#if DEBUG_IM
fprintf(stderr,"\n------------------------\n");
fprintf(stderr, "gtk_im_context_focus_in: _im_has_input_method = %d\n", _im_has_input_method);
fprintf(stderr, "gtk_im_context_focus_in: %s _im_has_input_method = %d\n", control ? control->name() : "-", _im_has_input_method);
#endif
}
}
......
......@@ -319,11 +319,8 @@ static gboolean my_key_press_event(GtkWidget *widget, GdkEventKey *event)
GtkWidget *focus;
focus = gtk_window_get_focus(window);
if (focus)
if (focus && gtk_widget_get_realized(focus))
{
if (!gtk_widget_get_realized(focus))
return handled;
if (GTK_IS_ENTRY(focus) || GTK_IS_TEXT_VIEW(focus))
{
propagated = TRUE;
......@@ -338,7 +335,7 @@ static gboolean my_key_press_event(GtkWidget *widget, GdkEventKey *event)
if (handled)
return TRUE;
if (!propagated)
if (!propagated && gtk_widget_get_realized(focus))
{
handled = gtk_window_propagate_key_event(window, event);
if (handled)
......
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