Bug 919863
| Summary: | IBus doesn't pass key events to the engines after alt-tab | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Mathieu Bridon <bochecha> |
| Component: | gnome-shell | Assignee: | Owen Taylor <otaylor> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 19 | CC: | admiller, fmuellner, i18n-bugs, lijli, mfabian, otaylor, rmatos, samkraju, shawn.p.huang, tfujiwar, walters |
| Target Milestone: | --- | Keywords: | i18n |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-06-14 07:01:27 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Mathieu Bridon
2013-03-10 14:36:53 UTC
Also, switch between windows **with alt-tab**. I found that switching between windows just by clicking on them doesn't trigger the bug. In case this matters, I'm running GNOME Shell 3.7.90 on Rawhide. Thanks for the report.
I confirmed Alt+Tab could move the focus to another input context.
The tentative suggested fix is here:
--- ibus-1.5.1/bus/inputcontext.c.orig
+++ ibus-1.5.1/bus/inputcontext.c
@@ -688,6 +688,22 @@ _ic_process_key_event (BusInputContext
}
}
+ /* If focus is changed by Alt+Tab, focus could be moved to
+ * non input context. Change the focused context again
+ * and set an engine from focused_context here.
+ */
+ if (context->has_focus && context->engine == NULL &&
+ context->fake == FALSE) {
+ BusInputContext *focused_context =
+ bus_ibus_impl_get_focused_input_context (BUS_DEFAULT_IBUS);
+
+ if (focused_context != NULL && context != focused_context &&
+ (context->capabilities & IBUS_CAP_FOCUS) != 0) {
+ context->has_focus = FALSE;
+ bus_input_context_focus_in (context);
+ }
+ }
+
/* ignore key events, if it is a fake input context */
if (context->has_focus && context->engine && context->fake == FALSE) {
bus_engine_proxy_process_key_event (context->engine,
Scratch build is available: http://koji.fedoraproject.org/koji/taskinfo?taskID=5111447 I'm running the package from this scratch build now, and so far I haven't been able to reproduce the bug any more. Looks like we've got a fix. :) Thanks for the test. If I press Alt+Tab and move the focus from gedit to thunderbird, the following focus events are happened: 1) (gedit:445): IBUS-WARNING **: 15:32:36:717 focus_out 2) (thunderbird:495): IBUS-WARNING **: 15:32:36:866 focus_in 3) (gedit:445): IBUS-WARNING **: 15:32:36:875 focus_in 4) (gedit:445): IBUS-WARNING **: 15:32:36:890 focus_out I will try to investigate why the focus_in event is happened. This didn't happen at all in gnome 3.6, am I right? Right. I don't see the same problem in 3.6. Transferring to mutter for the furthermore investigation. If I press Alt+Tab and move the focus from gedit to thunderbird,
the following focus events are happened in ibusimcontext:
1) (gedit:445): IBUS-WARNING **: 15:32:36:717 focus_out
2) (thunderbird:495): IBUS-WARNING **: 15:32:36:866 focus_in
3) (gedit:445): IBUS-WARNING **: 15:32:36:875 focus_in
4) (gedit:445): IBUS-WARNING **: 15:32:36:890 focus_out
Probably the focus_in event is caused by gnome-shell:
#0 ibus_input_context_focus_in (context=0x22ad3c0) at
ibusinputcontext.c:1177
#1 0x00007f7e2addd406 in ibus_im_context_focus_in (context=0x260a170)
at ibusimcontext.c:825
#2 0x00007f7e3a03bc8d in gtk_im_context_focus_in (context=0x260a170)
at gtkimcontext.c:539
#3 0x00007f7e3a0400dc in gtk_im_multicontext_focus_in
(context=0x25ca990)
at gtkimmulticontext.c:410
#4 0x00007f7e3a03bc8d in gtk_im_context_focus_in (context=0x25ca990)
at gtkimcontext.c:539
#5 0x00007f7e3a176c2d in gtk_text_view_focus_in_event
(widget=0x25e8020,
event=0x20c62f0) at gtktextview.c:5018
#6 0x00007f7e3a0620e4 in _gtk_marshal_BOOLEAN__BOXED
(closure=0x2026340,
return_value=0x7fff10e8ba30, n_param_values=2,
param_values=0x7fff10e8bae0, invocation_hint=0x7fff10e8ba80,
marshal_data=0x7f7e3a176b1e <gtk_text_view_focus_in_event>)
at gtkmarshalers.c:85
#7 0x0000003a78e0fa72 in g_closure_invoke () from
/lib64/libgobject-2.0.so.0
#8 0x0000003a78e2119f in signal_emit_unlocked_R ()
from /lib64/libgobject-2.0.so.0
#9 0x0000003a78e28c34 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
#10 0x0000003a78e29702 in g_signal_emit () from
/lib64/libgobject-2.0.so.0
#11 0x00007f7e3a20f2f5 in gtk_widget_event_internal (widget=0x25e8020,
event=0x20c62f0) at gtkwidget.c:6703
#12 0x00007f7e3a20e944 in gtk_widget_event (widget=0x25e8020,
event=0x20c62f0)
at gtkwidget.c:6360
#13 0x00007f7e3a21f1d3 in gtk_widget_send_focus_change
(widget=0x25e8020,
event=0x20c62f0) at gtkwidget.c:14451
#14 0x00007f7e3a22d8dd in do_focus_change (widget=0x25e8020, in=1)
at gtkwindow.c:6154
#15 0x00007f7e3a232fed in window_update_has_focus (window=0x22400c0)
at gtkwindow.c:9420
#16 0x00007f7e3a233127 in _gtk_window_set_is_active (window=0x22400c0,
is_active=1) at gtkwindow.c:9456
#17 0x00007f7e3a22da77 in gtk_window_focus_in_event (widget=0x22400c0,
event=0x20c6530) at gtkwindow.c:6208
#18 0x00007f7e3a0620e4 in _gtk_marshal_BOOLEAN__BOXED
(closure=0x2026340,
return_value=0x7fff10e8c060, n_param_values=2,
param_values=0x7fff10e8c110, invocation_hint=0x7fff10e8c0b0,
marshal_data=0x7f7e3a22da1a <gtk_window_focus_in_event>)
at gtkmarshalers.c:85
#19 0x0000003a78e0faf8 in g_closure_invoke () from
/lib64/libgobject-2.0.so.0
#20 0x0000003a78e2119f in signal_emit_unlocked_R ()
from /lib64/libgobject-2.0.so.0
#21 0x0000003a78e28c34 in g_signal_emit_valist ()
from /lib64/libgobject-2.0.so.0
#22 0x0000003a78e29702 in g_signal_emit () from
/lib64/libgobject-2.0.so.0
#23 0x00007f7e3a20f2f5 in gtk_widget_event_internal (widget=0x22400c0,
event=0x20c6530) at gtkwidget.c:6703
#24 0x00007f7e3a20e944 in gtk_widget_event (widget=0x22400c0,
event=0x20c6530)
at gtkwidget.c:6360
#25 0x00007f7e3a060776 in gtk_main_do_event (event=0x20c6530) at
gtkmain.c:1649
#26 0x0000003a87c52102 in gdk_event_source_dispatch ()
from /lib64/libgdk-3.so.0
#27 0x0000003a78247e96 in g_main_context_dispatch ()
from /lib64/libglib-2.0.so.0
#28 0x0000003a782481e8 in g_main_context_iterate.isra.22 ()
from /lib64/libglib-2.0.so.0
#29 0x0000003a7824828c in g_main_context_iteration ()
from /lib64/libglib-2.0.so.0
#30 0x0000003a7969bf34 in g_application_run () from
/lib64/libgio-2.0.so.0
#31 0x0000000000422ab0 in main ()
I filed a bug for mutter about focus events: https://bugzilla.gnome.org/show_bug.cgi?id=696259 If there is no reply, I will integrate the patch in Comment #2 in ibus. This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle. Changing version to '19'. (As we did not run this process for some time, it could affect also pre-Fedora 19 development cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.) More information and reason for this action is here: https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19 Fixed in upstream. |