|
|
DescriptionFix to lose a focus when move the focus from the delayed focus-in/out.
Some applications likes google-chrome URL entry could have the delayed
focus-in and focus-out events and ibus fails to get the new focus.
BUG=rhbz#919863, rhbz#1136623
Patch Set 1 #
Total comments: 6
Patch Set 2 : Updated with message #6. #
Total comments: 4
Patch Set 3 : Updated with message #8. #Patch Set 4 : Updated from rhbz#1136623 #Patch Set 5 : Updated with the latest master. #MessagesTotal messages: 11
https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c File bus/inputcontext.c (right): https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c#newcode694 bus/inputcontext.c:694: */ Sorry. I can not understand below code.
Sign in to reply to this message.
https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c File bus/inputcontext.c (right): https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c#newcode694 bus/inputcontext.c:694: */ On 2013/03/12 18:12:21, Peng wrote: > Sorry. I can not understand below code. 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 1) It seems XI2 Alt+Tab causes focus-out event at first. 2) focused_context is changed from gedit to thunderbird. 3) It seems Alt+Tab causes focus-in event when Alt+Tab UI is closed and focused_context is changed from thunderbird to gedit. 4) It seems Alt+Tab causes focus-out event finally and focused_context is changed from gedit to faked_context in ibus global mode. Then when _ic_process_key_event() is called, the context in thunderbird does not have the focus and the proxy engine because the faked_context has those. This patch applies the proxy engine from faked_context to the context if the context->engine is NULL.
Sign in to reply to this message.
https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c File bus/inputcontext.c (right): https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c#newcode694 bus/inputcontext.c:694: */ On 2013/03/14 07:00:53, fujiwara wrote: > On 2013/03/12 18:12:21, Peng wrote: > > Sorry. I can not understand below code. > > 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 > > 1) It seems XI2 Alt+Tab causes focus-out event at first. > 2) focused_context is changed from gedit to thunderbird. > 3) It seems Alt+Tab causes focus-in event when Alt+Tab UI is closed and > focused_context is changed from thunderbird to gedit. > 4) It seems Alt+Tab causes focus-out event finally and focused_context is > changed from gedit to faked_context in ibus global mode. > > Then when _ic_process_key_event() is called, the context in thunderbird does not > have the focus and the proxy engine because the faked_context has those. > > This patch applies the proxy engine from faked_context to the context if the > context->engine is NULL. Seems 3) should not happen. Could you please check do more research? It is better to find out why it happens. I am wondering it is caused by ibus im module or key snooper.
Sign in to reply to this message.
On 2013/03/14 21:42:44, Peng wrote: > https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c > File bus/inputcontext.c (right): > > https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c#newcode694 > bus/inputcontext.c:694: */ > On 2013/03/14 07:00:53, fujiwara wrote: > > On 2013/03/12 18:12:21, Peng wrote: > > > Sorry. I can not understand below code. > > > > 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 > > > > 1) It seems XI2 Alt+Tab causes focus-out event at first. > > 2) focused_context is changed from gedit to thunderbird. > > 3) It seems Alt+Tab causes focus-in event when Alt+Tab UI is closed and > > focused_context is changed from thunderbird to gedit. > > 4) It seems Alt+Tab causes focus-out event finally and focused_context is > > changed from gedit to faked_context in ibus global mode. > > > > Then when _ic_process_key_event() is called, the context in thunderbird does > not > > have the focus and the proxy engine because the faked_context has those. > > > > This patch applies the proxy engine from faked_context to the context if the > > context->engine is NULL. > > Seems 3) should not happen. Could you please check do more research? It is > better to find out why it happens. I am wondering it is caused by ibus im module > or key snooper. Probably I think the global keybinding could causes focus in/out and ibus Ctrl+space also could causes focus in/out. https://bugzilla.redhat.com/show_bug.cgi?id=909069 This is not caused by ibus im module: #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 ()
Sign in to reply to this message.
https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c File bus/inputcontext.c (right): https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c#newcode694 bus/inputcontext.c:694: */ On 2013/03/14 07:00:53, fujiwara wrote: > On 2013/03/12 18:12:21, Peng wrote: > > Sorry. I can not understand below code. > > 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 > > 1) It seems XI2 Alt+Tab causes focus-out event at first. > 2) focused_context is changed from gedit to thunderbird. > 3) It seems Alt+Tab causes focus-in event when Alt+Tab UI is closed and > focused_context is changed from thunderbird to gedit. > 4) It seems Alt+Tab causes focus-out event finally and focused_context is > changed from gedit to faked_context in ibus global mode. > > Then when _ic_process_key_event() is called, the context in thunderbird does not > have the focus and the proxy engine because the faked_context has those. > > This patch applies the proxy engine from faked_context to the context if the > context->engine is NULL. I think this comment does not give enough information about this issue. Could you please add more detail of this issue as comments here? https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c#newcode695 bus/inputcontext.c:695: if (context->has_focus && context->engine == NULL && Could you please merge this if statement with below if statement? Like: if (context->has_focus && context->fake == FALSE) { if (context->engine == NULL) { ... } bus_engine_proxy_process_key_event (context->engine, ...); }
Sign in to reply to this message.
https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c File bus/inputcontext.c (right): https://codereview.appspot.com/7725045/diff/1/bus/inputcontext.c#newcode695 bus/inputcontext.c:695: if (context->has_focus && context->engine == NULL && On 2013/03/17 20:03:38, Peng wrote: > Could you please merge this if statement with below if statement? > Like: > > if (context->has_focus && context->fake == FALSE) { > if (context->engine == NULL) { > ... > } > bus_engine_proxy_process_key_event (context->engine, ...); > } I updated comments. I think there is a case that focused_context->engine is null. if (context->engine) { bus_engine_proxy_process_key_event (context->engine, ...); } else { } I think the if statement is still needed.
Sign in to reply to this message.
lgtm with several comments https://codereview.appspot.com/7725045/diff/8001/bus/inputcontext.c File bus/inputcontext.c (right): https://codereview.appspot.com/7725045/diff/8001/bus/inputcontext.c#newcode692 bus/inputcontext.c:692: * the following focus events are happened in ibusimcontext: events are recevied or events happen https://codereview.appspot.com/7725045/diff/8001/bus/inputcontext.c#newcode700 bus/inputcontext.c:700: * The problem can be happened without snooper and the focus in/out happen https://codereview.appspot.com/7725045/diff/8001/bus/inputcontext.c#newcode704 bus/inputcontext.c:704: * focused_context here. Seems it could be put in one line?
Sign in to reply to this message.
https://codereview.appspot.com/7725045/diff/8001/bus/inputcontext.c File bus/inputcontext.c (right): https://codereview.appspot.com/7725045/diff/8001/bus/inputcontext.c#newcode692 bus/inputcontext.c:692: * the following focus events are happened in ibusimcontext: On 2013/03/18 14:37:55, Peng wrote: > events are recevied or events happen Done.
Sign in to reply to this message.
On 2013/03/18 14:37:55, Peng wrote: > lgtm with several comments GNOME-Shell side fixed focus issue in Alt+Tab: https://bugzilla.gnome.org/show_bug.cgi?id=696259 Probably I will close this CL and leave this until we will need this patch for other issues.
Sign in to reply to this message.
Finally I decide to integrated this patch to fix a new bug https://bugzilla.redhat.com/show_bug.cgi?id=1136623 .
Sign in to reply to this message.
|