Keystrokes are hijacked by inactive window

Bug #1234468 reported by Sparhawk
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Unknown
Unknown
thunderbird (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Recently, possibly in the upgrade to Thunderbird 24.0, I've found that the front-most, active window often will not receive keystrokes. Instead they are being sent to the background, inactive window. For example, I attempt to reply to an email, and start typing. I see text in the body as expected, then a second after beginning, the text is sent to the main "mail index" window. The front-most window is shown as selected in the pager, while a non-selected window receives the keystrokes. This means that for long periods, I am unable to send and compose emails. In addition, I'm also often mid-sentence when I realise that the characters aren't appearing, and I've done some weird filing/labelling in the mail index window.

I can alt-tab or click between windows, but cannot seem to type into the compose window. Otherwise, clicking does all you expect it to. You can select menus of the window; you can even select text (although it's the "background window" grey instead of the "foreground window" blue).

I tried to make sure that it was not an issue with X/KDE by testing to see what the reported active window was.

$ xwininfo | grep -i 'window id'
xwininfo: Window id: 0x3c001f6 "Inbox - Uni - Mozilla Thunderbird"
$ xwininfo | grep -i 'window id'
xwininfo: Window id: 0x3c0670c "Write: Re: Foo Bar - Unicode (UTF-8)"
$ sleep 1 && xprop -root | grep -E '^_NET_ACTIVE_WINDOW'
_NET_ACTIVE_WINDOW(WINDOW): window id # 0x3c001f6
$ sleep 1 && xprop -root | grep -E '^_NET_ACTIVE_WINDOW'
_NET_ACTIVE_WINDOW(WINDOW): window id # 0x3c0670c

It seems that even when the active window is reported to be the compose window by X, it will still not receive input. I presume that it's Thunderbird hijacking the active window internally.

I don't see this in any other application, except for Firefox occasionally. It used to be fairly frequent in Firefox six months ago, but appears to have diminished in frequency since then.

Here is a troubleshooting thread for this issue.
https://forum.kde.org/viewtopic.php?f=111&t=117704

Here is the related thread for Firefox.
http://forum.kde.org/viewtopic.php?f=111&t=110202&p=260008#p260008

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: thunderbird 1:24.0+build1-0ubuntu0.13.04.1 [modified: usr/share/applications/thunderbird.desktop]
Uname: Linux 3.9.4-030904-generic x86_64
AddonCompatCheckDisabled: False
ApportVersion: 2.9.2-0ubuntu8.3
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: lee 2493 F.... pulseaudio
BuildID: 20130913150408
Channel: Unavailable
Date: Thu Oct 3 11:02:13 2013
ForcedLayersAccel: False
IfupdownConfig:
 # interfaces(5) file used by ifup(8) and ifdown(8)
 auto lo
 iface lo inet loopback
InstallationDate: Installed on 2012-12-16 (290 days ago)
InstallationMedia: Kubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.1)
IpRoute:
 default via 192.168.2.1 dev wlan0 proto static
 169.254.0.0/16 dev wlan0 scope link metric 1000
 192.168.2.0/24 dev wlan0 proto kernel scope link src 192.168.2.2 metric 9
MarkForUpload: True
MostRecentCrashID: bp-8716a067-8317-4ad0-808a-2254e2120524
PrefSources:
 prefs.js
 [Profile]/extensions/{9533f794-00b4-4354-aa15-c2bbda6989f8}/defaults/preferences/prefs.js
 /usr/lib/mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}/{847b3a00-7ab1-11d4-8f02-006008948af5}/defaults/preferences/enigmail.js
 /usr/lib/mozilla/extensions/{3550f703-e582-4d05-9a08-453d09bdfdc6}/{847b3a00-7ab1-11d4-8f02-006008948af5}/defaults/preferences/000system.js
 [Profile]/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}/defaults/preferences/lightning.js
Profiles: Profile0 (Default) - LastVersion=24.0/20130913150408 (In use)
RelatedPackageVersions:
 google-talkplugin 4.7.0.0-1
 adobe-flashplugin 11.2.202.310-0raring1
 kopete 4:4.10.5+dfsg1-0ubuntu0.1
 rhythmbox-mozilla 2.98-0ubuntu5
RunningIncompatibleAddons: False
SourcePackage: thunderbird
SubmittedCrashIDs:
 bp-8716a067-8317-4ad0-808a-2254e2120524
 bp-8c247ae3-5982-4262-b65d-57a252120307
 bp-1ab81b2c-1607-4919-868d-380852120205
UpgradeStatus: Upgraded to raring on 2013-04-26 (159 days ago)
dmi.bios.date: 09/07/2012
dmi.bios.vendor: Dell Inc.
dmi.bios.version: A19
dmi.board.asset.tag: Base Board Asset Tag
dmi.board.name: 0XN71K
dmi.board.vendor: Dell Inc.
dmi.board.version: FAB1
dmi.chassis.type: 8
dmi.chassis.vendor: Dell Inc.
dmi.chassis.version: 0.1
dmi.modalias: dmi:bvnDellInc.:bvrA19:bd09/07/2012:svnDellInc.:pnDellSystemXPSL702X:pvr:rvnDellInc.:rn0XN71K:rvrFAB1:cvnDellInc.:ct8:cvr0.1:
dmi.product.name: Dell System XPS L702X
dmi.sys.vendor: Dell Inc.

Revision history for this message
Sparhawk (sparhawkthesecond) wrote :
Revision history for this message
Sparhawk (sparhawkthesecond) wrote :
Revision history for this message
Sparhawk (sparhawkthesecond) wrote :

Attempted running in safe mode, and I still see the bug.

Revision history for this message
Sparhawk (sparhawkthesecond) wrote :

As per https://wiki.ubuntu.com/MozillaTeam/Bugs , I downloaded and ran the Thunderbird build from the Mozilla website. (Note the link is incorrect, and I had to dig for the 64-bit version.) I still encountered this bug even in this version..

summary: - Active window cannot receive keystrokes
+ Keystrokes are hijacked by inactive window
Revision history for this message
In , Bugzilla-g (bugzilla-g) wrote :
Download full text (3.6 KiB)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130911155223

Steps to reproduce:

Recently, probably in the upgrade to Thunderbird 24.0, I've found that the front-most, active window often will not receive keystrokes. Instead they are being sent to the background, inactive window. For example, I attempt to reply to an email, and start typing. I see text in the body as expected, then a second after beginning, the text is sent to the main "mail index" window. The front-most window is shown as selected in the pager, while a non-selected window receives the keystrokes. This means that for long periods, I am unable to send and compose emails. In addition, I'm also often mid-sentence when I realise that the characters aren't appearing, and I've done some weird filing/labelling in the mail index window.

I can alt-tab or click between windows, but cannot seem to type into the compose window. Otherwise, clicking does all you expect it to. You can select menus of the window; you can even select text (although it's the "background window" grey instead of the "foreground window" blue).

I tried to make sure that it was not an issue with X/KDE by testing to see what the reported active window was.

$ xwininfo | grep -i 'window id'
xwininfo: Window id: 0x3c001f6 "Inbox - Uni - Mozilla Thunderbird"
$ xwininfo | grep -i 'window id'
xwininfo: Window id: 0x3c0670c "Write: Re: Foo Bar - Unicode (UTF-8)"
$ sleep 1 && xprop -root | grep -E '^_NET_ACTIVE_WINDOW'
_NET_ACTIVE_WINDOW(WINDOW): window id # 0x3c001f6
$ sleep 1 && xprop -root | grep -E '^_NET_ACTIVE_WINDOW'
_NET_ACTIVE_WINDOW(WINDOW): window id # 0x3c0670c

It seems that even when the active window is reported to be the compose window by X, it will still not receive input. I presume that it's Thunderbird hijacking the active window internally.

I've tried starting in safe mode and manually downloading and running Thunderbird from the website (64-bit version), instead of using the version in the repositories. In both cases, I still hit this bug.

I don't see this in any other application, except for Firefox occasionally. It used to be fairly frequent in Firefox starting in a release around February, but appears to have diminished in frequency since then.

I did similar troubleshooting in Firefox for active window using xev, but this is now buggy and doesn't work. First I found window IDs with

    xwininfo | grep -i 'window id'

Then, when the bug occurred, I attempted to see if keystrokes were being passed to the active (but non-responsive) window with

    xev -id 0x123456 | grep Key

I also did the same for the background window that was actually responding to the keystrokes. It seems that the active (but non-responsive) window was indeed receiving keystrokes, and the other one was not, although it was responding to them. I presume that again, it's Firefox hijacking the active window internally. It's probably easier for me to do more troubleshooting in Thunderbird, since it's more frequent.

I checked bugzilla to see this had already been filed, but found nothing. However, I'm unsure if this is related: https://bugzilla.mozilla.org/s...

Read more...

Revision history for this message
Sparhawk (sparhawkthesecond) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in thunderbird (Ubuntu):
status: New → Confirmed
Revision history for this message
In , Andeew (andeew) wrote :

I have the same issue on 64-bit Kubuntu 12.04

Changed in thunderbird:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
In , Bugzilla-g (bugzilla-g) wrote :

Andrew, do you see this bug in both Firefox and Thunderbird?

If, like me, you see it more frequently in Thunderbird, the following might help. I was also hit by this (unrelated?) bug in the upgrade. https://bugzilla.mozilla.org/show_bug.cgi?id=917027

Applying the fix for that bug seems to mitigate this bug a little, although it doesn't totally fix it. I still get this bug intermittently, but it *seems* to be less frequent.

The fix is: Edit > Preferences > Advanced > General > Config Editor. Search for mail.compose.max_recycled_windows, double click it, and change the '1' to '0' in the 'Enter integer value' window that pops up.

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

This is also apparently seen in Unity as well.
https://forum.kde.org/viewtopic.php?f=111&t=117704#p294488

As stated previously, I also tried manually downloading Thunderbird from the Mozilla website, so it's unlikely to be a problem introduced in the Ubuntu packages.

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

Andrew, do you by any chance have unclutter running?

https://forum.kde.org/viewtopic.php?f=111&t=117704&p=294916#p294912

Revision history for this message
In , Andeew (andeew) wrote :

(In reply to Sparhawk from comment #4)
> Andrew, do you by any chance have unclutter running?

Indeed I do, because it's a dependency of kubuntu-desktop.

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

I'm not sure if you followed my link, but killing unclutter and stopping it from running at startup fixes this for me.

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

As per the link above, I've been running unclutter with `-noevents`, and that appears to have fixed this bug for the last 5 days, at least.

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

BTW: I had the same problem with SeaMonkey when using multiple windows and it looks like using unclutter with "-noevents" worked. Is this now a bug in all Mozilla applications or a problem with the way unclutter works?

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

For reference what this means:
-noevents
              stops unclutter sending a pseudo EnterNotify event to the X client whose cursor has been stolen. Sending the event helps programs like emacs think that they
              have not lost the pointer focus. This option is provided for backwards compatibility in case some clients get upset.

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

I think this bug belongs here, maybe GTK devs know a bit more about this?

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

I suspect it *is* Mozilla, but I'm not sure. It'd be great to hear from some devs here.

I did do some troubleshooting in the following threads that might be useful:
https://forum.kde.org/viewtopic.php?f=111&t=110202
https://forum.kde.org/viewtopic.php?f=111&t=117704

I was told "Firefox has quite a lot issues with X as they more or less have their own toolkit instead of going with default ones." Indeed I have only come across this problem with FF/TB and unclutter, and nothing else.

Revision history for this message
In , Karlt (karlt) wrote :

Yes, unclutter tries to be clever, but is not quite clever enough.

*** This bug has been marked as a duplicate of bug 625149 ***

Changed in thunderbird:
status: New → Invalid
Revision history for this message
In , Bugzilla-g (bugzilla-g) wrote :
Mathew Hodson (mhodson)
Changed in thunderbird:
importance: Medium → Undecided
status: Invalid → New
importance: Undecided → Unknown
status: New → Unknown
To post a comment you must log in.
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.