After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 696259 - Unexpected focus events happen with Alt+Tab
Unexpected focus events happen with Alt+Tab
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
3.8.1
: 696365 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-03-21 09:54 UTC by Takao Fujiwara
Modified: 2013-03-28 15:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
altTab: Move input focus to target window before dropping the grab (1.44 KB, patch)
2013-03-22 15:42 UTC, Rui Matos
committed Details | Review

Description Takao Fujiwara 2013-03-21 09:54:46 UTC
If I press Alt+Tab and move the focus from gedit to thunderbird in gnome-shell, GtkIMContext receives the following focus events:

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 understand 1) and 2) but I don't understand why 3) and 4) can happen and I guess it might be a bug in mutter.

I tried to get the stack in 3):

  • #0 ibus_input_context_focus_in
    at ibusinputcontext.c line 1177
  • #1 ibus_im_context_focus_in
    at ibusimcontext.c line 825
  • #2 gtk_im_context_focus_in
    at gtkimcontext.c line 539
  • #3 gtk_im_multicontext_focus_in
    at gtkimmulticontext.c line 410
  • #4 gtk_im_context_focus_in
    at gtkimcontext.c line 539
  • #5 gtk_text_view_focus_in_event
    at gtktextview.c line 5018
  • #6 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #7 g_closure_invoke
    from /lib64/libgobject-2.0.so.0
  • #8 signal_emit_unlocked_R
    from /lib64/libgobject-2.0.so.0
  • #9 g_signal_emit_valist
    from /lib64/libgobject-2.0.so.0
  • #10 g_signal_emit
    from /lib64/libgobject-2.0.so.0
  • #11 gtk_widget_event_internal
    at gtkwidget.c line 6703
  • #12 gtk_widget_event
    at gtkwidget.c line 6360
  • #13 gtk_widget_send_focus_change
    at gtkwidget.c line 14451
  • #14 do_focus_change
    at gtkwindow.c line 6154
  • #15 window_update_has_focus
    at gtkwindow.c line 9420
  • #16 _gtk_window_set_is_active
    at gtkwindow.c line 9456
  • #17 gtk_window_focus_in_event
    at gtkwindow.c line 6208
  • #18 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #19 g_closure_invoke
    from /lib64/libgobject-2.0.so.0
  • #20 signal_emit_unlocked_R
    from /lib64/libgobject-2.0.so.0
  • #21 g_signal_emit_valist
    from /lib64/libgobject-2.0.so.0
  • #22 g_signal_emit
    from /lib64/libgobject-2.0.so.0
  • #23 gtk_widget_event_internal
    at gtkwidget.c line 6703
  • #24 gtk_widget_event
    at gtkwidget.c line 6360
  • #25 gtk_main_do_event
    at gtkmain.c line 1649
  • #26 gdk_event_source_dispatch
    from /lib64/libgdk-3.so.0
  • #27 g_main_context_dispatch
    from /lib64/libglib-2.0.so.0
  • #28 g_main_context_iterate.isra.22
    from /lib64/libglib-2.0.so.0
  • #29 g_main_context_iteration
    from /lib64/libglib-2.0.so.0
  • #30 g_application_run
    from /lib64/libgio-2.0.so.0
  • #31 main

Comment 1 Rui Matos 2013-03-22 15:40:35 UTC
*** Bug 696365 has been marked as a duplicate of this bug. ***
Comment 2 Rui Matos 2013-03-22 15:42:06 UTC
Actually my fault on the swicherPopup work. Fix coming.
Comment 3 Rui Matos 2013-03-22 15:42:39 UTC
Created attachment 239555 [details] [review]
altTab: Move input focus to target window before dropping the grab

We chain up on _finish() to drop the grab and destroy the switcher
popup but we should activate the target window first because dropping
the grab results in the previously focused windows getting a focus in
event immediately followed by the focus out event from the target
window activation which we can easily avoid.
Comment 4 Florian Müllner 2013-03-22 16:52:38 UTC
Review of attachment 239555 [details] [review]:

Yes.
Comment 5 Matthias Clasen 2013-03-28 02:25:18 UTC
Review of attachment 239555 [details] [review]:

thats now
Comment 6 Rui Matos 2013-03-28 15:33:27 UTC
Attachment 239555 [details] pushed as bf02cde - altTab: Move input focus to target window before dropping the grab