Pressing any global keyboard shortcut causes temporary loss of focus

Bug #1244090 reported by kolen
448
This bug affects 113 people
Affects Status Importance Assigned to Milestone
Mutter
Expired
Medium
compiz (Ubuntu)
Confirmed
Low
Unassigned
gnome (openSUSE)
Unknown
Unknown
gnome-settings-daemon (ALT Linux)
Unknown
Unknown
gnome-settings-daemon (Ubuntu)
Triaged
Low
Unassigned
gnome-shell (Fedora)
Confirmed
Undecided
gnome-shell (Ubuntu)
Confirmed
Undecided
Unassigned
mutter (Ubuntu)
Confirmed
Undecided
Unassigned
unity-settings-daemon (Ubuntu)
Triaged
Low
Unassigned

Bug Description

When pressing any global keyboard shourtcut (configurable via System settings -> Keyboard -> Shortcuts; i.e. for switching keyboard layout, volume up/down), focus temporary switches from active text input to something else, then restores back shortly. Maybe even active window loses focus, but window frame does not shows this (window header remains to look active).

For example: when I press ctrl+shift here to switch keyboard layout, when writing this description, yellow frame disappears from text input box, text caret disappears too; they appear again when releasing ctrl+shift. The same occurs in all other programs, i.e. terminal.

It causes serious annoyance, for example in Twitter when losing focus in Reply text box, reply rolls up and I have to click it again with mouse and set caret to correct place each time I switch keyboard layouts.

Other key combinations, not only ctrl+shift, also cause this.

It is especially annoying when using keyboard layout switch shortcut handled by the same subsystem (media-keys plugin):

        case SWITCH_INPUT_SOURCE_KEY:
        case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
                do_switch_input_source_action (manager, type);
                break;

(Original gnome-settings-daemon, from which unity-settings-daemon was forked, does not use media-keys plugin to switch keyboard layout).

----------
For other layout switching problems introduced in Ubuntu 13.10 you can see bug 1218322.
----------

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: gnome-session 3.9.90-0ubuntu3
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
ApportVersion: 2.12.5-0ubuntu2
Architecture: amd64
Date: Thu Oct 24 11:42:19 2013
InstallationDate: Installed on 2013-10-23 (0 days ago)
InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: gnome-session
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Federico Mena Quintero (federico-gnome) wrote :

(I'm not sure if gnome-settings-daemon is the right product for this bug, but anyway.)

I have things so that pressing ShiftL+ShiftR together will change my keyboard layout.

This works fine. However, when I press that key combination, the current window appears to lose focus and regain it instantly. This is a problem with buggy toolkits (cough) that do things like committing or canceling text entries when they lose/gain focus. For example, GtkTreeView will cancel editing, and Firefox will do funny things depending on which web page has entry widgets in it.

This didn't seem to happen a few Gnome versions ago (maybe it was caused by the switch to ibus?).

Here is the xev log for what it's worth. After the initial ShiftL KeyPress, there is a FocusOut/FocusIn/KeymapNotify.

KeyPress event, serial 44, synthetic NO, window 0x4800001,
    root 0xc1, subw 0x0, time 257173342, (412,453), root:(413,530),
    state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

FocusOut event, serial 44, synthetic NO, window 0x4800001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 44, synthetic NO, window 0x4800001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 44, synthetic NO, window 0x0,
    keys: 2 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0
           0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

MappingNotify event, serial 44, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

MappingNotify event, serial 44, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

MappingNotify event, serial 44, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

MappingNotify event, serial 44, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

MappingNotify event, serial 44, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

MappingNotify event, serial 44, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

MappingNotify event, serial 44, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

MappingNotify event, serial 44, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyRelease event, serial 44, synthetic NO, window 0x4800001,
    root 0xc1, subw 0x0, time 257173533, (412,453), root:(413,530),
    state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

Revision history for this message
In , Rui Matos (tiagomatos) wrote :

Well, yes because it's a shortcut like any other now which means we use X passive grabs which causes FocusOut/In events indeed. I don't know what to say other than fix the clients.

Revision history for this message
In , Bugzilla-x (bugzilla-x) wrote :

(In reply to comment #1)
> Well, yes because it's a shortcut like any other now which means we use X
> passive grabs which causes FocusOut/In events indeed. I don't know what to say
> other than fix the clients.

Isn't that fixed already in GNOME 3.8?

Revision history for this message
In , Rui Matos (tiagomatos) wrote :

(In reply to comment #2)
> (In reply to comment #1)
> > Well, yes because it's a shortcut like any other now which means we use X
> > passive grabs which causes FocusOut/In events indeed. I don't know what to say
> > other than fix the clients.
>
> Isn't that fixed already in GNOME 3.8?

No it can't be "fixed" unfortunately, it's how X grabs work.

81 comments hidden view all 108 comments
Revision history for this message
kolen (incredible-angst) wrote :
kolen (incredible-angst)
no longer affects: gnome-session (Ubuntu)
affects: ubuntu → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gnome-settings-daemon (Ubuntu):
status: New → Confirmed
81 comments hidden view all 108 comments
Revision history for this message
In , Suor (suor-web) wrote :

Can confirm that.

And that should be fixed, it's useful for window or widget to do something on focus loss and it's very common to type a message in several languages.

Revision history for this message
In , Suor (suor-web) wrote :

And overall taking a focus from window on every shortcut causes problems. For example, you can't screenshot a drop-down list or pop-up cause they hide on focus loss.

Changed in gnome-settings-daemon (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
81 comments hidden view all 108 comments
Revision history for this message
kolen (incredible-angst) wrote :

Why importance is set to low? For me, it is extremelly annoying bug: I cannot use major websites (twitter, vk.com) without frustration, both in Firefox and Chromium. Sometimes cursor moves to the start or to the end of text input field when I switch focus, some websites has behavior attached to losing focus (saving data and finishing editing, closing popups).

Also seems that it induces bug 1245473: applications cannot handle shortcuts when they lose focus, and pressing ctrl+shift and so on causes loss of focus immediately.

Revision history for this message
Suor (suor-web) wrote :

Agree with kolen. I can't switch layout on guake because it autohides and some important shortcuts in sublime text are blocked.

81 comments hidden view all 108 comments
Revision history for this message
In , kolen (incredible-angst) wrote :

Also (possibly) application shortcuts using keys bound to switch keyboard (i.e. ctrl+shift) are not working because of this.

For example, if ctrl+shift is set as layout switch shortcut, "copy" shortcut ctrl+shift+c will not work in gnome-terminal. Gnome-terminal not receives keyboard event because when ctrl+shift are pressed, it becomes out of focus.

80 comments hidden view all 108 comments
Revision history for this message
CONSTantius (constantius9) wrote :

I also experience this and support both kolen and Suor.

Revision history for this message
Ivan Denisov (blackbox-oberon) wrote :

it is extremelly annoying bug!!!

Revision history for this message
windblow (onestory-studio) wrote :

And if app can't lose focus ("synapse" for example) keyboard layout will not switch.

metka193 (metka506)
Changed in gnome-settings-daemon (Ubuntu):
status: Triaged → Confirmed
Revision history for this message
kolen (incredible-angst) wrote :

Still in 10.04 (gnome-settings-daemon 3.8.6.1-0ubuntu11), but slightly less noticeable ("reply" pane in Twitter still closes when pressing keyboard switch key, and sometimes I notice blink of border that indicates focus of input field; defocused time has decreased).

Norbert (nrbrtx)
tags: added: trusty trusty-desktop
removed: amd64
description: updated
Norbert (nrbrtx)
tags: added: keyboard-layout-switching-related
Revision history for this message
kolen (incredible-angst) wrote :

Seems that Ubuntu (at least 14.04) does not use gnome-settings-daemon, instead it uses unity-settings-daemon.

Changed in unity-settings-daemon (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Changed in gnome-settings-daemon (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
kolen (incredible-angst) wrote :

Discovered that it's not related solely to keyboard switching: focus loss occurs when pressing any bound shortcut, for example volume up/down. So, it is in 'media-keys' unity-settings-daemon plugin, not in 'keyboard' plugin.

Also, 'media-keys' controls keyboard layouts only in unity-settings-daemon, upstream gnome-settings-daemon doesn't have code for doing this.

                  break;
          case BATTERY_KEY:
                  do_battery_action (manager);
                  break;
+ case SWITCH_INPUT_SOURCE_KEY:
+ case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
+ do_switch_input_source_action (manager, type);
+ break;
          /* Note, no default so compiler catches missing keys */
          case CUSTOM_KEY:
                  g_assert_not_reached ();

76 comments hidden view all 108 comments
Revision history for this message
In , kolen (incredible-angst) wrote :

Maybe report confused with unity-settings-daemon (fork of gnome-settings-daemon in Ubuntu)? Original gnome-settings-daemon does not have code (in media-keys plugin) to switch keyboard layouts:

                  break;
          case BATTERY_KEY:
                  do_battery_action (manager);
                  break;
+ case SWITCH_INPUT_SOURCE_KEY:
+ case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
+ do_switch_input_source_action (manager, type);
+ break;
          /* Note, no default so compiler catches missing keys */
          case CUSTOM_KEY:
                  g_assert_not_reached ();

summary: - Pressing keyboard shortcut to switch keyboard layout causes temporary
- loss of focus
+ Pressing any global keyboard shortcut causes temporary loss of focus
75 comments hidden view all 108 comments
Revision history for this message
kolen (incredible-angst) wrote :

Some details: in Ubuntu 13.10, when reported, focus went back when releasing shortcut key/keys, in recent version (Ubuntu 14.04) focus go back shortly after pressing key(s), while keys are still in pressed position; still triggering annoying behavior in some apps (i.e. twitter reply box).

description: updated
Revision history for this message
Jan Vlnas (jnv) wrote :

This has gotten even more annoying in 14.04, though my problem is a tad specific.
I have set the keyboard shortcut “Switch to next source:” to Left Shift+Right Shift (used to be X server's default). However this have an interesting side effect in some cases: now just pressing (one) Shift key to write an upcase letter also causes a temporary lose of focus, effectively breaking some text fields – like a Twitter's compose and reply boxes mentioned by kolen. Reverting back to the default Super+Space solves this issue, even switching the keyboard on Twitter doesn't lose the focus.
So apparently some shortcuts may have an unintended side effects.

Revision history for this message
In , Norko (norko-solko) wrote :

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0

When pressing any global keyboard shourtcut (configurable via System settings -> Keyboard -> Shortcuts; i.e. for switching keyboard layout, volume up/down), focus temporary switches from active text input to something else, then restores back shortly. Maybe even active window loses focus, but window frame does not shows this (window header remains to look active).

For example: when I press ctrl+shift here to switch keyboard layout, when writing this description, yellow frame disappears from text input box, text caret disappears too; they appear again when releasing ctrl+shift. The same occurs in all other programs, i.e. terminal.

It causes serious annoyance, for example in Twitter when losing focus in Reply text box, reply rolls up and I have to click it again with mouse and set caret to correct place each time I switch keyboard layouts.

Other key combinations, not only ctrl+shift, also cause this.

Reproducible: Always

Steps to Reproduce:
1. Open for example gedit
2. Press Ctrl+S
3. Press Create Folder button
4. Try to change keyboard layout or volume up/down
5. Focus will be removed from new folder, folder will not be created
Actual Results:
Focus is removed from new folder, folder will not be created.

Expected Results:
Layout changed, folder name is on desired layout, folder is created and named as user wants.

This bug exists at least in Ubuntu (see https://bugs.launchpad.net/gnome-settings-daemon/+bug/1244090 for more reproduce scenarios ), RedHat 7 (https://bugzilla.redhat.com/show_bug.cgi?id=1091628). The bug is reported to upstream too (https://bugzilla.gnome.org/show_bug.cgi?id=700316) with no luck.

Changed in gnome-settings-daemon (openSUSE):
importance: Unknown → Medium
status: Unknown → Confirmed
74 comments hidden view all 108 comments
Revision history for this message
In , kolen (incredible-angst) wrote :

Some clarification:

1. It is unrelated to keyboard layout switching. Any global keyboard shortcuts handled by media-keys plugin of gnome-settings-daemon, such as volume up, volume down, etc., cause focus to switch.

2. As far as I know, vanilla gnome-settings-daemon does not handle switching of keyboard layout, see diff in previous comment. Ubuntu's fork called unity-settings-daemon uses media-keys plugin to switch keyboard and it has code changes to do that.

3. media-keys plugin is not designed to switch keyboard layout, there's a sort of hack in Ubuntu to utilize it for such purpose.

4. Losing focus when pressing volume up/volume down is a minor annoyance. Losing focus when switching keyboard layout is very major annoyance. But AFAIK vanilla gnome does not use 'media-keys' to switch layouts, it uses builtin xkbmap functionality.

Someone who has access to vanilla Gnome, can try following:
 - Bind a key or key combination to volume up/down and something like that
 - Put text caret into input box with visible focus. Good examples are: gnome terminal (cursor will blink), twitter in Firefox (reply box will roll up when losing focus)
 - Press this key multiple times and see focus loses and moves back

73 comments hidden view all 108 comments
Revision history for this message
kolen (incredible-angst) wrote :

Discovered that loss of focus is caused by GrabAccelerator dbus method, handled by compiz. Gnome/unity-settings-daemon does not make focus go away by itself. You can try following script:

#!/usr/bin/python
import dbus
bus = dbus.SessionBus()
o = bus.get_object('org.gnome.Shell', '/org/gnome/Shell')
code = o.GrabAccelerator('1', 0, dbus_interface='org.gnome.Shell')
try:
  raw_input("Grab set to key '1', press Enter to continue and ungrab")
finally:
  print o.UngrabAccelerator(code, dbus_interface='org.gnome.Shell')

It sets grab to '1' key, then pressing '1' causes the same effects of losing focus (blink of cursor in terminal; cancel of rename in Nautilus, etc).

I didn't remove unity-settings-daemon from this bug because maybe it uses this dbus method for wrong purpose (maybe it's not suited for binding keys for switching keyboard).

74 comments hidden view all 108 comments
Revision history for this message
In , kolen (incredible-angst) wrote :

Discovered that it is unrelated to gnome-settings-daemon, you can try the following script. It binds '1' key and pressing it causes the same behavior:

#!/usr/bin/python
import dbus
bus = dbus.SessionBus()
o = bus.get_object('org.gnome.Shell', '/org/gnome/Shell')
code = o.GrabAccelerator('1', 0, dbus_interface='org.gnome.Shell')
try:
  raw_input("Grab set to key '1', press Enter to continue and ungrab")
finally:
  print o.UngrabAccelerator(code, dbus_interface='org.gnome.Shell')

(at least in Ubuntu, someone with vanilla Gnome can try it too. Ubuntu uses compiz to implement org/gnome/Shell/GrabAccelerator.)

73 comments hidden view all 108 comments
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in compiz (Ubuntu):
status: New → Confirmed
Changed in compiz (Ubuntu):
importance: Undecided → Low
Revision history for this message
kolen (incredible-angst) wrote :

Pressing ctrl+backspace also causes this behaviour, although not defined in "Shortcuts" in "System settings". This makes text input fields on several webpages to glitch (instead of deleting last word, it moves cursor to the start of text, deletes at other point, etc). This is extremely annoying.

Revision history for this message
Sergey (sergeyzsg) wrote :

Ubuntu 14.04. Hamster applet. Preferences -> Categories and Tags. Can't mixin en and ru characters in tag name.

Revision history for this message
kolen (incredible-angst) wrote :

Also, if right ctrl is bound as layout switch button, pressing ctrl+c, ctrl+v, etc makes focus go away too, either when pressing left ctrl or right ctrl with c, v, etc.

Revision history for this message
Alinaki (mr-alinaki) wrote :

One more way to reproduce:
Open any website or web-application, where text input fields reacts on focus change (Twitter, Chromium or Firefox page inspector) and try to change layout in there (post on Twitter or CSS-rules edit in inspectors). Input field lost his focus and just disappears.

Expected results:
1. Keyboard layout changed
2. You can enter text on any language without lost focus.

Will it ever be fixed?

Revision history for this message
digitalsatori(Shine IT) (digitalsatori) wrote :

The same problem cause guake not working properly.

I set guake to auto hide when lossing focus. Now, whenever I press Ctrl-Space to switch input method, the guake terminal will be hided. This is very annoying.

Revision history for this message
In , Dominique Leuenberger aka DimStar (dimstar) wrote :

Marking the bug 'UPSTREAM'

Changed in gnome-settings-daemon (openSUSE):
status: Confirmed → Won't Fix
Revision history for this message
Andrey (andrey2004) wrote :

Working with XMind now is very difficult if you want to change keyboard layout while edit node

http://www.youtube.com/watch?v=-0Je1Ej9VV4

Revision history for this message
Alinaki (mr-alinaki) wrote : Re: [Bug 1244090] Re: Pressing any global keyboard shortcut causes temporary loss of focus
Download full text (3.2 KiB)

Why did you mark that as won't fix without any comment?
25.07.2014 2:50 пользователь "Bug Watch Updater" <email address hidden>
написал:

> ** Changed in: gnome-settings-daemon (openSUSE)
> Status: Confirmed => Won't Fix
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1244090
>
> Title:
> Pressing any global keyboard shortcut causes temporary loss of focus
>
> Status in Gnome Settings Daemon:
> New
> Status in Project Hamster:
> New
> Status in Unity Settings Daemon:
> New
> Status in “compiz” package in Ubuntu:
> Confirmed
> Status in “gnome-settings-daemon” package in Ubuntu:
> Triaged
> Status in “unity-settings-daemon” package in Ubuntu:
> Triaged
> Status in “gnome-settings-daemon” package in ALT Linux:
> Unknown
> Status in “gnome-settings-daemon” package in Fedora:
> Unknown
> Status in “gnome-settings-daemon” package in openSUSE:
> Won't Fix
>
> Bug description:
> When pressing any global keyboard shourtcut (configurable via System
> settings -> Keyboard -> Shortcuts; i.e. for switching keyboard layout,
> volume up/down), focus temporary switches from active text input to
> something else, then restores back shortly. Maybe even active window
> loses focus, but window frame does not shows this (window header
> remains to look active).
>
> For example: when I press ctrl+shift here to switch keyboard layout,
> when writing this description, yellow frame disappears from text input
> box, text caret disappears too; they appear again when releasing
> ctrl+shift. The same occurs in all other programs, i.e. terminal.
>
> It causes serious annoyance, for example in Twitter when losing focus
> in Reply text box, reply rolls up and I have to click it again with
> mouse and set caret to correct place each time I switch keyboard
> layouts.
>
> Other key combinations, not only ctrl+shift, also cause this.
>
> It is especially annoying when using keyboard layout switch shortcut
> handled by the same subsystem (media-keys plugin):
>
> case SWITCH_INPUT_SOURCE_KEY:
> case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
> do_switch_input_source_action (manager, type);
> break;
>
> (Original gnome-settings-daemon, from which unity-settings-daemon was
> forked, does not use media-keys plugin to switch keyboard layout).
>
> ----------
> For other layout switching problems introduced in Ubuntu 13.10 you can
> see bug 1218322.
> ----------
>
> ProblemType: Bug
> DistroRelease: Ubuntu 13.10
> Package: gnome-session 3.9.90-0ubuntu3
> ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
> Uname: Linux 3.11.0-12-generic x86_64
> ApportVersion: 2.12.5-0ubuntu2
> Architecture: amd64
> Date: Thu Oct 24 11:42:19 2013
> InstallationDate: Installed on 2013-10-23 (0 days ago)
> InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64
> (20131016.1)
> MarkForUpload: True
> PackageArchitecture: all
> SourcePackage: gnome-session
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug ...

Read more...

1 comments hidden view all 108 comments
Revision history for this message
Norbert (nrbrtx) wrote :
Download full text (7.2 KiB)

@Alinaki, дело тут вот в чем.
Я прорепортил этот баг еще и в OpenSuSe (
https://bugzilla.novell.com/show_bug.cgi?id=875352 ). Изначальный баг
1299519 обнаруженный тобой влился в этот здесь как в более общий.

Комментарий 21 создан роботом ланчпада после посещения им багзиллы OpenSuSe.
Они пометили этот баг как upstream со статусом WONTFIX (другими
словами - не хотят разбираться сами, а ждут решения от GNOME). Это
нормальная ситуация.
Робот ланчпада собирает комментарии и статусы из прикрепленных
багрепортов других дистрибутивов или проектов, но написанные на
ланчпаде комментарии в другие багзиллы не направляются.
Надеюсь, мое объяснение помогло :)

@all
I'm sorry for native language above.
The brief idea of text above is: comment 21 was auto-generated by
launchpad' bug watch updater and it describes bug status in OpenSuSe
distro.

On Fri, Jul 25, 2014 at 2:17 PM, Alinaki <email address hidden> wrote:
> Why did you mark that as won't fix without any comment?
> 25.07.2014 2:50 пользователь "Bug Watch Updater" <email address hidden>
> написал:
>
>> ** Changed in: gnome-settings-daemon (openSUSE)
>> Status: Confirmed => Won't Fix
>>
>> --
>> You received this bug notification because you are subscribed to the bug
>> report.
>> https://bugs.launchpad.net/bugs/1244090
>>
>> Title:
>> Pressing any global keyboard shortcut causes temporary loss of focus
>>
>> Status in Gnome Settings Daemon:
>> New
>> Status in Project Hamster:
>> New
>> Status in Unity Settings Daemon:
>> New
>> Status in “compiz” package in Ubuntu:
>> Confirmed
>> Status in “gnome-settings-daemon” package in Ubuntu:
>> Triaged
>> Status in “unity-settings-daemon” package in Ubuntu:
>> Triaged
>> Status in “gnome-settings-daemon” package in ALT Linux:
>> Unknown
>> Status in “gnome-settings-daemon” package in Fedora:
>> Unknown
>> Status in “gnome-settings-daemon” package in openSUSE:
>> Won't Fix
>>
>> Bug description:
>> When pressing any global keyboard shourtcut (configurable via System
>> settings -> Keyboard -> Shortcuts; i.e. for switching keyboard layout,
>> volume up/down), focus temporary switches from active text input to
>> something else, then restores back shortly. Maybe even active window
>> loses focus, but window frame does not shows this (window header
>> remains to look active).
>>
>> For example: when I press ctrl+shift here to switch keyboard layout,
>> when writing this description, yellow frame disappears from text input
>> box, text caret disappears too; they appear again when releasing
>> ctrl+shift. The same occurs in all other programs, i.e. terminal.
>>
>> It causes serious annoyance, for example in Twitter when losing focus
>> in Reply text box, reply rolls up and I have to click it again with
>> mouse and set caret to correct place each time I switch keyboard
>> layouts.
>>
>> Other key combinations, not only ctrl+shift, also cause this.
>>
>> It is especially annoying when using keyboard layout switch shortcut
>> handled by the same subsystem (media-keys plugin):
>>
>> case SWITCH_INPUT_SOURCE_KEY:
>> case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
>> ...

Read more...

Revision history for this message
Norbert (nrbrtx) wrote :

@Alinaki, дело тут вот в чем.
Я прорепортил этот баг еще и в OpenSuSe (
https://bugzilla.novell.com/show_bug.cgi?id=875352 ). Изначальный баг
1299519 обнаруженный тобой влился в этот здесь как в более общий.

Комментарий 21 создан роботом ланчпада после посещения им багзиллы OpenSuSe.
Они пометили этот баг как upstream со статусом WONTFIX (другими
словами - не хотят разбираться сами, а ждут решения от GNOME). Это
нормальная ситуация.
Робот ланчпада собирает комментарии и статусы из прикрепленных
багрепортов других дистрибутивов или проектов, но написанные на
ланчпаде комментарии в другие багзиллы не направляются.
Надеюсь, мое объяснение помогло :)

@all
I'm sorry for native language above.
The brief idea of text above is: comment 21 was auto-generated by
launchpad' bug watch updater and it describes bug status in OpenSuSe
distro.

1 comments hidden view all 108 comments
Revision history for this message
Alinaki (mr-alinaki) wrote :
Download full text (4.1 KiB)

Все, понял. Thank you, that describes everything.
25.07.2014 15:06 пользователь "Norbert" <email address hidden>
написал:

> @Alinaki, дело тут вот в чем.
> Я прорепортил этот баг еще и в OpenSuSe (
> https://bugzilla.novell.com/show_bug.cgi?id=875352 ). Изначальный баг
> 1299519 обнаруженный тобой влился в этот здесь как в более общий.
>
> Комментарий 21 создан роботом ланчпада после посещения им багзиллы
> OpenSuSe.
> Они пометили этот баг как upstream со статусом WONTFIX (другими
> словами - не хотят разбираться сами, а ждут решения от GNOME). Это
> нормальная ситуация.
> Робот ланчпада собирает комментарии и статусы из прикрепленных
> багрепортов других дистрибутивов или проектов, но написанные на
> ланчпаде комментарии в другие багзиллы не направляются.
> Надеюсь, мое объяснение помогло :)
>
>
> @all
> I'm sorry for native language above.
> The brief idea of text above is: comment 21 was auto-generated by
> launchpad' bug watch updater and it describes bug status in OpenSuSe
> distro.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1244090
>
> Title:
> Pressing any global keyboard shortcut causes temporary loss of focus
>
> Status in Gnome Settings Daemon:
> New
> Status in Project Hamster:
> New
> Status in Unity Settings Daemon:
> New
> Status in “compiz” package in Ubuntu:
> Confirmed
> Status in “gnome-settings-daemon” package in Ubuntu:
> Triaged
> Status in “unity-settings-daemon” package in Ubuntu:
> Triaged
> Status in “gnome-settings-daemon” package in ALT Linux:
> Unknown
> Status in “gnome-settings-daemon” package in Fedora:
> Unknown
> Status in “gnome-settings-daemon” package in openSUSE:
> Won't Fix
>
> Bug description:
> When pressing any global keyboard shourtcut (configurable via System
> settings -> Keyboard -> Shortcuts; i.e. for switching keyboard layout,
> volume up/down), focus temporary switches from active text input to
> something else, then restores back shortly. Maybe even active window
> loses focus, but window frame does not shows this (window header
> remains to look active).
>
> For example: when I press ctrl+shift here to switch keyboard layout,
> when writing this description, yellow frame disappears from text input
> box, text caret disappears too; they appear again when releasing
> ctrl+shift. The same occurs in all other programs, i.e. terminal.
>
> It causes serious annoyance, for example in Twitter when losing focus
> in Reply text box, reply rolls up and I have to click it again with
> mouse and set caret to correct place each time I switch keyboard
> layouts.
>
> Other key combinations, not only ctrl+shift, also cause this.
>
> It is especially annoying when using keyboard layout switch shortcut
> handled by the same subsystem (media-keys plugin):
>
> case SWITCH_INPUT_SOURCE_KEY:
> case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
> do_switch_input_source_action (manager, type);
> break;
>
> (Original gnome-settings-daemon, from which u...

Read more...

Revision history for this message
Scott Kostyshak (scott-kostyshak) wrote :

I wonder if another symptom of this bug is #1360036.

Revision history for this message
Norbert (nrbrtx) wrote :

Ubuntu 14.04.1 LTS with all updates. Bug is still here on Unity and GNOME Sessions.
Please fix it as soon as possible.

Revision history for this message
Norbert (nrbrtx) wrote :

Bug exists in Ubuntu 14.10 (installed from Ubuntu 14.10 _Utopic Unicorn_ - Alpha i386 (20140902)).

tags: added: utopic
Revision history for this message
Alexander (aheihachi) wrote :

Ubuntu 14.04 LTS all updates. Please fix this bug.

Revision history for this message
Norbert (nrbrtx) wrote :

It's great that Ubuntu 14.10 MATE beta is not affected by this bug.

no longer affects: unity-settings-daemon
Revision history for this message
Norbert (nrbrtx) wrote :

Reinstalled Utopic from official beta2 , the bug is still here.

Revision history for this message
Shahar Or (mightyiam) wrote :

Is the loss of focus really temporary? For me, it seems permanent. For example, in Firefox's, tab groups feature, if I am focused on the title of a tab group (with the purpose of renaming it) and I switch layout with <meta>+<space>, the focus is lost from that field. And it isn't temporary. It is permanent. I must refocus there. Is it this bug that I'm describing?

Revision history for this message
Shahar Or (mightyiam) wrote :

Excuse me, I meant <Super>+<Space>.

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

It's the same issue – the whole app (Firefox) loses the focus temporarily, whch in turn might cause a permanent focus loss of one particular component inside Firefox. The core problem is that Firefox itself shouldn't lose the focus at the first place.

Revision history for this message
Norbert (nrbrtx) wrote :

Bug exists in Ubuntu Utopic 14.10 final.

Revision history for this message
Alinaki (mr-alinaki) wrote :
Download full text (3.1 KiB)

It's funny, but this bug just disappear in Google Chrome Web Inspector.
02.11.2014 13:01 пользователь "Norbert" <email address hidden>
написал:

> Bug exists in Ubuntu Utopic 14.10 final.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1244090
>
> Title:
> Pressing any global keyboard shortcut causes temporary loss of focus
>
> Status in Gnome Settings Daemon:
> New
> Status in Project Hamster:
> New
> Status in “compiz” package in Ubuntu:
> Confirmed
> Status in “gnome-settings-daemon” package in Ubuntu:
> Triaged
> Status in “unity-settings-daemon” package in Ubuntu:
> Triaged
> Status in “gnome-settings-daemon” package in ALT Linux:
> Unknown
> Status in “gnome-settings-daemon” package in Fedora:
> Unknown
> Status in “gnome-settings-daemon” package in openSUSE:
> Won't Fix
>
> Bug description:
> When pressing any global keyboard shourtcut (configurable via System
> settings -> Keyboard -> Shortcuts; i.e. for switching keyboard layout,
> volume up/down), focus temporary switches from active text input to
> something else, then restores back shortly. Maybe even active window
> loses focus, but window frame does not shows this (window header
> remains to look active).
>
> For example: when I press ctrl+shift here to switch keyboard layout,
> when writing this description, yellow frame disappears from text input
> box, text caret disappears too; they appear again when releasing
> ctrl+shift. The same occurs in all other programs, i.e. terminal.
>
> It causes serious annoyance, for example in Twitter when losing focus
> in Reply text box, reply rolls up and I have to click it again with
> mouse and set caret to correct place each time I switch keyboard
> layouts.
>
> Other key combinations, not only ctrl+shift, also cause this.
>
> It is especially annoying when using keyboard layout switch shortcut
> handled by the same subsystem (media-keys plugin):
>
> case SWITCH_INPUT_SOURCE_KEY:
> case SWITCH_INPUT_SOURCE_BACKWARD_KEY:
> do_switch_input_source_action (manager, type);
> break;
>
> (Original gnome-settings-daemon, from which unity-settings-daemon was
> forked, does not use media-keys plugin to switch keyboard layout).
>
> ----------
> For other layout switching problems introduced in Ubuntu 13.10 you can
> see bug 1218322.
> ----------
>
> ProblemType: Bug
> DistroRelease: Ubuntu 13.10
> Package: gnome-session 3.9.90-0ubuntu3
> ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
> Uname: Linux 3.11.0-12-generic x86_64
> ApportVersion: 2.12.5-0ubuntu2
> Architecture: amd64
> Date: Thu Oct 24 11:42:19 2013
> InstallationDate: Installed on 2013-10-23 (0 days ago)
> InstallationMedia: Ubuntu 13.10 "Saucy Salamander" - Release amd64
> (20131016.1)
> MarkForUpload: True
> PackageArchitecture: all
> SourcePackage: gnome-session
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/gnome-settings-daemon/+bug/1244090/+subscript...

Read more...

Mathew Hodson (mhodson)
tags: added: amd64 keyboard-layout-switching-hotkeys
removed: keyboard-layout-switching-related trusty-desktop
Revision history for this message
Till (plutakhin) wrote :

Affects me on wunderlist.com site and in xmind application.

Norbert (nrbrtx)
tags: removed: amd64
Revision history for this message
vof (v0f) wrote :

this workaround worked for ubuntu 14.10:

- in Settings->Text entry remove all input sources, leave only english
- install gxkb (layout switcher): sudo apt-get install gxkb
- add gxkb to startup applications via gnome-tweak-tool
- setup gxkb hotkeys in ~/.config/gxkb (default is alt_shift, but in 14.10 it doesn't work. ctrl_shift works ok)

p.s. new version of gxkb has appindicator for ubuntu. can be installed via ppa:zen-root/gxkb-stable

Revision history for this message
Norbert (nrbrtx) wrote :

Bug exists in Ubuntu 15.04 alpha2.

tags: added: vivid
Changed in gnome-settings-daemon:
status: New → Confirmed
Norbert (nrbrtx)
tags: added: wily
Mathew Hodson (mhodson)
affects: gnome-settings-daemon (ALT Linux) → ubuntu
Changed in ubuntu:
importance: Unknown → Undecided
status: Unknown → New
no longer affects: ubuntu
affects: gnome-settings-daemon (Fedora) → ubuntu
Changed in ubuntu:
importance: Unknown → Undecided
status: Unknown → New
no longer affects: ubuntu
affects: gnome-settings-daemon (openSUSE) → ubuntu
Changed in ubuntu:
importance: Medium → Undecided
status: Won't Fix → New
no longer affects: ubuntu
Changed in ubuntu:
status: New → Confirmed
Mathew Hodson (mhodson)
affects: hamster-applet → ubuntu
no longer affects: ubuntu
49 comments hidden view all 108 comments
Revision history for this message
In , Serge Gavrilov (serge-pdmi) wrote :

Still reproducible in 3.16

Ping!

Revision history for this message
In , Maksim Kachur (mcdebugger) wrote :

Similar to this bug (and maybe the same) for me on Gentoo Linux. GNOME 3.16.

In nautilus when trying to rename file and switching the keyboard layout it looses focus, changes name to original and I must start from scratch.
In firefox on some websites there are fields critical to focus loss. Some unpredictable things occur.
Geany/Gedit/other text editors - unpredictable behaviour.
Bitwig Studio: I can't use some shortcuts, can't switch keyboard layout in text fields normally, can't type lower/upper letters without using Caps Lock.
Lightworks: various problems with shortcuts related to this.

Revision history for this message
In , Maksim Kachur (mcdebugger) wrote :

Debian Jessie, GNOME 3.14. The same as in my previous post about this bug on Gentoo.

Revision history for this message
In , Nexfwall (nexfwall) wrote :

(In reply to Maksim Kachur from comment #11)
> Similar to this bug (and maybe the same) for me on Gentoo Linux. GNOME 3.16.
>
> In nautilus when trying to rename file and switching the keyboard layout it
> looses focus, changes name to original and I must start from scratch.
> In firefox on some websites there are fields critical to focus loss. Some
> unpredictable things occur.
> Geany/Gedit/other text editors - unpredictable behaviour.
> Bitwig Studio: I can't use some shortcuts, can't switch keyboard layout in
> text fields normally, can't type lower/upper letters without using Caps Lock.
> Lightworks: various problems with shortcuts related to this.

As mentioned in comment #3, this can not be fixed in X. This is how X grabs work.

So, the only hope is what Wayland will be by default someday. Because this bug can not be reproduced in GNOME Wayland session.

Norbert (nrbrtx)
tags: added: xenial
Revision history for this message
In , Martin Měřinský (mermar) wrote :

This bug exists alo in Gnome Wayland (Ubuntu 17.10 with vanilla Gnome).

Reproduce this bug in three simple steps:
1. Start Gedit.
2. Start searching Ctrl+f.
3. Change keyboard layout Win+Space.
BUG: Search widget is gone, focus is nowhere(?).
Step 3. should change keyboard layout, nothing else.

This bug makes it very difficult to use Gnome desktop for non-English speakers :-(

Revision history for this message
In , Suor (suor-web) wrote :

This should get more attention. Really annoying bug lurking there for years. My pain is guake being closed.

Changed in gnome-shell (Fedora):
importance: Unknown → Undecided
status: Unknown → Confirmed
Revision history for this message
In , Bugzilla-x (bugzilla-x) wrote :

This problem is fixed in GNOME Wayland sessions, and unfixable in Xorg sessions at all, so closing.

Revision history for this message
In , Martin Měřinský (mermar) wrote :

No, it is not fixed, at least not in GNOME Shell 3.26.1.
I'm running GNOME Wayland sessions and have this problem!

Revision history for this message
In , Bugzilla-x (bugzilla-x) wrote :

You're right, I tested this with volume keys which had this problem in X11, but not in Wayland.

The problem doesn't lie in gnome-settings-daemon anymore in any case, it's all implemented directly in mutter and gnome-shell now.

Norbert (nrbrtx)
tags: added: artful bionic zesty
Changed in gnome-shell (Ubuntu):
status: New → Confirmed
28 comments hidden view all 108 comments
Revision history for this message
Hackintosh Five (hackintosh5) wrote :

No, the problem is in the grabbing code:
https://github.com/GNOME/gnome-shell/blob/2997e4950ba31747b5e3260c306456b0de413421/js/misc/keyboardManager.js#L37
https://github.com/GNOME/mutter/blob/49f029571cc425a878e520310a8db616fa5c4b70/src/core/keybindings.c#L1803
This grabs the keyboard.
From https://www.x.org/wiki/Development/Documentation/GrabProcessing :
'There can only be one grab on a device ...'
See the xev output below, of me pressing META+SPACE to change layout:

FocusOut event, serial 34, synthetic NO, window 0x3200001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 34, synthetic NO, window 0x3200001,
    mode NotifyUngrab, detail NotifyNonlinear

KeymapNotify event, serial 34, synthetic NO, window 0x0,
    keys: 70 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
           0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

FocusOut event, serial 34, synthetic NO, window 0x3200001,
    mode NotifyGrab, detail NotifyNonlinear

FocusIn event, serial 34, synthetic NO, window 0x3200001,
    mode NotifyUngrab, detail NotifyNonlinear

KeymapNotify event, serial 34, synthetic NO, window 0x0,
    keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
           0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

The issue is that it is losing grab, as the FocusOut event shows the mode is notifyGrab. Or at least that is my interpretation. I don't know why the grab and ungrab events are the wrong way round.

Changed in gnome-shell (Ubuntu):
assignee: nobody → Penn Mackintosh (penn-mackintosh)
Revision history for this message
Hackintosh Five (hackintosh5) wrote :

I have a patch, taken from SO.

Patch is attached for package xorg-server.
After building with it, you need to install xserver-xorg-core-*.deb package generated.
I have attached the .deb too.

Revision history for this message
Hackintosh Five (hackintosh5) wrote :

I have confirmed that the above patch works by applying it and running xev. I then pressed META+SPACE and the keyboard layout changed without any output from xev.

Changed in gnome-shell (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "AMD64 .deb included, with .patch file" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Ivan Ivanov (suricactus) wrote :

It is strange this is a known issue for 4 years and there is still not resolved. It is highly annoying as end user to lose window focus all the time I switch languages, which is common for bilingual environments. Do I really need to recompile X to remove an issue, which I observed only on Gnome Shell? There are two Ubuntu LTS releases with this annoyance and now Gnome Shell is the main DE.

Changed in gnome-shell (Ubuntu):
assignee: Penn Mackintosh (penn-mackintosh) → nobody
status: In Progress → Confirmed
1 comments hidden view all 108 comments
Revision history for this message
Dmitry Gusev (decumos) wrote :

The bug is still there. Working with data in two languages is almost unbearable. Each time I search for info within sheets and change the layout I have to grab a mouse and click on the search window again.

tags: removed: saucy vivid wily zesty
tags: removed: artful
Revision history for this message
kkivi (kkivi) wrote :

The bug is still there
Ubuntu 18.10

Specific scenarios in firefox

1) open duckduckgo search page, start typing and switch layout - focus loss
2) register wonderlist account, create task, add a note to it, start typing and switch layout - focus lost and textbox collapses.

Revision history for this message
kkivi (kkivi) wrote :
tags: removed: trusty utopic
Revision history for this message
spacediver (pavel-sutyrin) wrote :

Solution from Penn works perfectly! Installed attached binary at Ubuntu 18.04.2.

Revision history for this message
John Doe (eugenyshcheglov-deactivatedaccount) wrote :

It also breaks games from Steam in full-screen mode. For example, Counter-Strike 1.6 fullscreen window become minimized after layout change. Ridiculous.

Changed in gnome-settings-daemon:
importance: Medium → Unknown
status: Confirmed → Unknown
affects: gnome-settings-daemon → mutter
Changed in mutter (Ubuntu):
status: New → Confirmed
Changed in mutter:
importance: Unknown → Medium
status: Unknown → Confirmed
19 comments hidden view all 108 comments
Revision history for this message
Lyubomir (mystiquewolf) wrote :

Ubuntu 19.10, I want to delete words with Ctrl + backspace from Trello board name, but it loses focus. - trello.com.

Revision history for this message
Lyubomir (mystiquewolf) wrote :

Also loses focus on Microsoft To-Do app. Hope that is enough to change the status from Undecided to actual real bug.

Revision history for this message
Hackintosh Five (hackintosh5) wrote :

There's a patch in #71. Unfortunately, I don't know how to properly submit the patch.

Revision history for this message
Lyubomir (mystiquewolf) wrote :

I also don't have time to learn C++ and implement this myself, but it seems to be a really bad situation. In Trello if you delete everything somehow from a tile title and try to use Ctrl + Z to restore it... well good luck, but you can't. It's gone forever.

Revision history for this message
Hackintosh Five (hackintosh5) wrote :

You don't need C to apply & build a patch. Just use `apt source` and `patch`

Revision history for this message
Norbert (nrbrtx) wrote :

It is really great that Ubuntu MATE 20.04 LTS is not affected by this bug!

With all GNOME Shell "desktop" new "features" the usage of MATE DE may be great alternative for all kinds of users.

Revision history for this message
Martin Měřinský (mermar) wrote :

Ubuntu 20.04 LTS still contains this bug.

tags: added: focal
Revision history for this message
inkvizitor68sl (inkvizitor68sl) wrote :

Ubuntu 20.04 LTS still contains this bug AND affected even if alt-shift is not layout-switch hotkey.
Any window losts focus on alt-shift pressed (for example - alt-shift-6 for alt-# in terminal - no action), however i have only capslock layout switch.

gnome-session-flashback.

tags: removed: xenial
Revision history for this message
In , Aleksey (antlord92) wrote :

Any update on that? I've been encountering the issue on different distros with X11 as well as Wayland for I don't remember how long. I'm happy to provide any technical information to fix the issue.

Revision history for this message
In , Gnome-sysadmin (gnome-sysadmin) wrote :

GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.

Changed in mutter:
status: Confirmed → Expired
tags: removed: bionic
Displaying first 40 and last 40 comments. View all 108 comments or add a comment.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.