Commit aa66e9bc authored by Benoît Minisini's avatar Benoît Minisini

Windows without any active child control correctly catch keyboard events now.

[GB.GTK]
* BUG: Windows without any active child control correctly catch keyboard events now.

[GB.GTK3]
* BUG: Windows without any active child control correctly catch keyboard events now.
parent b4a8adf2
......@@ -219,6 +219,7 @@ static void gambas_handle_event(GdkEvent *event)
bool cancel;
int type;
bool handle_event = false;
bool send_to_window = false;
if (gApplication::_fix_printer_dialog)
{
......@@ -806,12 +807,14 @@ __FOUND_WIDGET:
if (event->key.keyval)
gKey::_last_key_press = event->key.keyval;
send_to_window = control->isWindow();
goto __HANDLE_EVENT;
case GDK_KEY_RELEASE:
if (event->key.keyval)
gKey::_last_key_release = event->key.keyval;
send_to_window = control->isWindow();
goto __HANDLE_EVENT;
}
......@@ -833,6 +836,9 @@ __RETURN:
if (handle_event)
gtk_main_do_event(event);
if (send_to_window)
gcb_key_event(widget, event, control);
if (!gdk_events_pending()) // && event->type != GDK_ENTER_NOTIFY && event->type != GDK_LEAVE_NOTIFY)
{
......
......@@ -483,7 +483,7 @@ gboolean gcb_key_event(GtkWidget *widget, GdkEvent *event, gControl *control)
bool cancel;
#if DEBUG_IM
fprintf(stderr, "gcb_key_event %s for %p %s\n", event->type == GDK_KEY_PRESS ? "GDK_KEY_PRESS" : "GDK_KEY_RELEASE", control, control->name());
fprintf(stderr, "gcb_key_event %s for %p %s / active = %p\n", event->type == GDK_KEY_PRESS ? "GDK_KEY_PRESS" : "GDK_KEY_RELEASE", control, control->name(), gApplication::activeControl());
#endif
/*if (!control->_grab && gApplication::activeControl())
......
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