Pressing any global keyboard shortcut causes temporary loss of focus

Bug #1244090 reported by kolen on 2013-10-24
410
This bug affects 104 people
Affects Status Importance Assigned to Milestone
GNOME Settings Daemon
Confirmed
Medium
compiz (Ubuntu)
Low
Unassigned
gnome (openSUSE)
Unknown
Unknown
gnome-settings-daemon (ALT Linux)
Unknown
Unknown
gnome-settings-daemon (Ubuntu)
Low
Unassigned
gnome-shell (Fedora)
Confirmed
Undecided
gnome-shell (Ubuntu)
Undecided
Unassigned
unity-settings-daemon (Ubuntu)
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)

kolen (incredible-angst) wrote :
kolen (incredible-angst) on 2013-10-25
no longer affects: gnome-session (Ubuntu)
affects: ubuntu → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon:
importance: Unknown → Medium
status: Unknown → New
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-settings-daemon (Ubuntu):
status: New → Confirmed
Changed in gnome-settings-daemon (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
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.

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.

CONSTantius (constantius9) wrote :

I also experience this and support both kolen and Suor.

Ivan Denisov (blackbox-oberon) wrote :

it is extremelly annoying bug!!!

windblow (onestory-studio) wrote :

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

metka193 (metka506) on 2014-03-18
Changed in gnome-settings-daemon (Ubuntu):
status: Triaged → Confirmed
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) on 2014-04-21
tags: added: trusty trusty-desktop
removed: amd64
description: updated
Norbert (nrbrtx) on 2014-04-21
tags: added: keyboard-layout-switching-related
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
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 ();

kolen (incredible-angst) on 2014-04-25
summary: - Pressing keyboard shortcut to switch keyboard layout causes temporary
- loss of focus
+ Pressing any global keyboard shortcut causes temporary loss of focus
description: updated
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).

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.

Description of problem:
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.

Version-Release number of selected component (if applicable):
Bug exists in Red Hat ____Enterprise___ Linux Workstation 7.0 (Maipo).
gnome-settings-daemon-3.8.6.1-8.el7.x86_64

How 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.

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

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

Bug exists in Fedora 20 too.

gnome-shell is responsible for capturing the media keys.

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).

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
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.

Sergey (sergeyzsg) wrote :

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

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.

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?

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.

Marking the bug 'UPSTREAM'

Changed in gnome-settings-daemon (openSUSE):
status: Confirmed → Won't Fix
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

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...

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...

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.

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...

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

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.

Fedora 20 with all installed updates. Bug is still here. Please fix it.

Norbert (nrbrtx) wrote :

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

tags: added: utopic
Alexander (aheihachi) wrote :

Ubuntu 14.04 LTS all updates. Please fix this bug.

Norbert (nrbrtx) wrote :

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

no longer affects: unity-settings-daemon
Norbert (nrbrtx) wrote :

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

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?

Shahar Or (mightyiam) wrote :

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

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.

Norbert (nrbrtx) wrote :

Bug exists in Ubuntu Utopic 14.10 final.

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...

tags: added: amd64 keyboard-layout-switching-hotkeys
removed: keyboard-layout-switching-related trusty-desktop
Till (plutakhin) wrote :

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

Norbert (nrbrtx) on 2015-01-17
tags: removed: amd64
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

Norbert (nrbrtx) wrote :

Bug exists in Ubuntu 15.04 alpha2.

tags: added: vivid

Fedora 21 with all installed updates. Bug is still present in GNOME.

Changed in gnome-settings-daemon:
status: New → Confirmed
Norbert (nrbrtx) wrote :

Bug exists in Ubuntu 15.04 beta2.

Norbert (nrbrtx) wrote :

Bug exists in Ubuntu 15.04 final.

Still an issue in GNOME-3.14.

lioncub (lioncub) wrote :

Exists in 14.04

Norbert (nrbrtx) wrote :

Bug exists in 15.10 alpha

tags: added: wily
Vadim Nevorotin (malamut) wrote :

Should be hight priority bug. A lot of input fields have some behaviour for loosing focus. E.g. search field in gedit disappear when changing keyboard layout, guake with autohide is unusable because of this bug, a lot of web applications have problems etc. In fact, now there are a lot of annoying problems with using two or more layouts in Ubuntu, so comfortable work in system is impossible. If such bugs in desktop components haven't hight priority, which should have it?

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
Launchpad Janitor (janitor) wrote :

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

Changed in ubuntu:
status: New → Confirmed
affects: hamster-applet → ubuntu
no longer affects: ubuntu
Norbert (nrbrtx) wrote :

Bug exists in 15.10 beta2.

Norbert (nrbrtx) wrote :

Bug exists in 15.10 final.

Alinaki (mr-alinaki) wrote :

Confirm. Bug still exists in 15.10.

Bug celebrate two years of existence. Awesome.

Evseev Evgeny (pelid80) wrote :

Bug still exists in 15.10. It is extremelly annoying.

Possible workaround:

* Install autokey, add to Startup applications. It handles shortcuts using X Window System instead of Gnome.
* Add custom scripts to autokey and set shortcuts for them

Keyboard First Layout:
       from subprocess import check_output
       check_output(['gsettings', 'set', 'org.gnome.desktop.input-sources', 'current', '0'])

Keyboard Second Layout:
      from subprocess import check_output
      check_output(['gsettings', 'set', 'org.gnome.desktop.input-sources', 'current', '1'])

Works well with XMind. Gedit search input still lose focus on layout switch.

Norbert (nrbrtx) wrote :

Bug exists in 16.04.

tags: added: xenial
Alinaki (mr-alinaki) wrote :

Still exists in Ubuntu 16.04 release.

kurtisnet (naastonn) wrote :

Will this bug ever fixed? It still exists in Ubuntu Gnome 16.10. And it extremely annoying. Possible workaround: use MS Windows.

Andrey D. (andrewdanilov) wrote :

Still exists in Ubuntu 16.04. Perhaps, MS Windows is good workaround for it.

Norbert (nrbrtx) wrote :

Bug exists in 16.04 LTS.

Martin Měřinský (mermar) wrote :

Still exists in Gnomebuntu 17.04.

Tony K (glowman) wrote :

This annoying bug still present in Ubuntu 16.04 LTS, 16.10 and 17.04.
It spreads everywhere through OS, only fresh Chrome is working fine and Windows, sure

Norbert (nrbrtx) wrote :

It seems that Ubuntu 16.04 LTS with MATE Desktop Environment does not have this bug.
So MATE rocks!

Martin Měřinský (mermar) wrote :

Still present in Ubuntu 17.10 using Wayland.

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.

Changed in gnome-shell (Fedora):
importance: Unknown → Undecided
status: Unknown → Confirmed
Norbert (nrbrtx) on 2017-11-04
tags: added: artful bionic zesty
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-shell (Ubuntu):
status: New → Confirmed

Does it seem like this line could be the problem? https://github.com/GNOME/gnome-shell/blob/3b1330880fbaa1c1f98c912d6d41fe14af18e3eb/js/ui/status/keyboard.js#L382

From here (https://github.com/GNOME/gnome-shell/blob/2997e4950ba31747b5e3260c306456b0de413421/js/misc/keyboardManager.js#L30) it seems like this will ungrab the keyboard under some circumstances. BTW this is still an issue in bionic as of today.

I have never read the ubuntu/gnome sources before, so please forgive if I have misinterpreted something. Also, thanks to incredible-angst for pointing out the DBUS method, which is how I found these lines.

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)

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.

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

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
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
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
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.

tags: removed: trusty utopic
spacediver (pavel-sutyrin) wrote :

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

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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