Bug 704893 - Sometimes windows don't get focus at all and only Overview mode works
Summary: Sometimes windows don't get focus at all and only Overview mode works
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-shell
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-15 20:18 UTC by Hedayat Vatankhah
Modified: 2011-10-20 11:50 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-20 11:49:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 651783 0 None None None Never

Description Hedayat Vatankhah 2011-05-15 20:18:50 UTC
Description of problem:
Working on the shell, sometime after an Alt+Tab, no window will receive focus and windows no longer receive your keyboard and mouse events. Overview mode works fine, but you can't focus on any windows or move them in non-overview mode. I should either logout and login again, or go to a virtual terminal and kill gnome-shell and run a new instance.

When it happens, I get the following error repeatedly when I use Alt-Tab in normal mode:


    JS ERROR: !!!     message = 'this._appIcons is undefined'
    JS ERROR: !!!   Exception was: TypeError: this._appIcons is undefined
    JS ERROR: !!!     lineNumber = '189'
    JS ERROR: !!!     fileName = '/usr/share/gnome-shell/js/ui/altTab.js'
    JS ERROR: !!!     stack = '()@/usr/share/gnome-shell/js/ui/altTab.js:189
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gnome-shell/js/ui/altTab.js:243
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gjs-1.0/lang.js:110
'
    JS ERROR: !!!     message = 'this._appIcons is undefined'
    JS ERROR: !!!   Exception was: TypeError: this._appIcons is undefined
    JS ERROR: !!!     lineNumber = '352'
    JS ERROR: !!!     fileName = '/usr/share/gnome-shell/js/ui/altTab.js'
    JS ERROR: !!!     stack = '()@/usr/share/gnome-shell/js/ui/altTab.js:352
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gnome-shell/js/ui/altTab.js:260
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gjs-1.0/lang.js:110
'
    JS ERROR: !!!     message = 'this._appIcons is undefined'
    JS ERROR: !!!   Exception was: TypeError: this._appIcons is undefined
    JS ERROR: !!!     lineNumber = '189'
    JS ERROR: !!!     fileName = '/usr/share/gnome-shell/js/ui/altTab.js'
    JS ERROR: !!!     stack = '()@/usr/share/gnome-shell/js/ui/altTab.js:189
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gnome-shell/js/ui/altTab.js:243
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gjs-1.0/lang.js:110
'
    JS ERROR: !!!     message = 'this._appIcons is undefined'
    JS ERROR: !!!   Exception was: TypeError: this._appIcons is undefined
    JS ERROR: !!!     lineNumber = '352'
    JS ERROR: !!!     fileName = '/usr/share/gnome-shell/js/ui/altTab.js'
    JS ERROR: !!!     stack = '()@/usr/share/gnome-shell/js/ui/altTab.js:352
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gnome-shell/js/ui/altTab.js:260
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gjs-1.0/lang.js:110
'
    JS ERROR: !!!     message = 'this._appIcons is undefined'



Version-Release number of selected component (if applicable):
gnome-shell-3.0.1-4.fc15.x86_64

How reproducible:
I have experienced this issue almost every time I use gnome shell for more than a few minutes. 

Steps to Reproduce:
Still unable to find a specific problematic sequence. But when it starts to happen, it happens regularly even when I kill and start a new instance of gnome-shell. I'm eventually forced to logout and login again.

Comment 1 Hedayat Vatankhah 2011-05-16 20:17:46 UTC
This might depend on the active locale. Still not sure, but looks like that this bug doesn't happen in en_US locale. I'm testing shell in en_US locale to see if it happens again.

BTW, the following errors might be related to this  problem too:


    JS ERROR: !!!   Exception was: Error: Failed to convert UTF-8 string to JS string: دنبالهٔ بایتی نامعتبر در ورودی تبدیل
    JS ERROR: !!!     lineNumber = '0'
    JS ERROR: !!!     fileName = 'gjs_throw'
    JS ERROR: !!!     stack = '("Failed to convert UTF-8 string to JS string: \u062F\u0646\u0628\u0627\u0644\u0647\u0654 \u0628\u0627\u06CC\u062A\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 \u0648\u0631\u0648\u062F\u06CC \u062A\u0628\u062F\u06CC\u0644")@gjs_throw:0
([object _private_Shell_WindowTracker],[object _private_GLib_ParamSpec])@/usr/share/gnome-shell/js/ui/panel.js:531
([object _private_Shell_WindowTracker],[object _private_GLib_ParamSpec])@/usr/share/gjs-1.0/lang.js:110
'
    JS ERROR: !!!     message = 'Failed to convert UTF-8 string to JS string: /F('DGT ('�*� F'E9*(1 /1 H1H/� *(/�D'
    JS ERROR: !!!   Exception was: Error: Failed to convert UTF-8 string to JS string: دنبالهٔ بایتی نامعتبر در ورودی تبدیل
    JS ERROR: !!!     lineNumber = '0'
    JS ERROR: !!!     fileName = 'gjs_throw'
    JS ERROR: !!!     stack = '("Failed to convert UTF-8 string to JS string: \u062F\u0646\u0628\u0627\u0644\u0647\u0654 \u0628\u0627\u06CC\u062A\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 \u0648\u0631\u0648\u062F\u06CC \u062A\u0628\u062F\u06CC\u0644")@gjs_throw:0
([object _private_Shell_App])@/usr/share/gnome-shell/js/ui/altTab.js:815
AppIcon([object _private_Shell_App])@/usr/share/gnome-shell/js/ui/altTab.js:803
([object Array],[object Object])@/usr/share/gnome-shell/js/ui/altTab.js:841
AppSwitcher([object Array],[object Object])@/usr/share/gnome-shell/js/ui/altTab.js:827
(false,false)@/usr/share/gnome-shell/js/ui/altTab.js:141
([object _private_Shell_WM],"switch_windows",null,false)@/usr/share/gnome-shell/js/ui/windowManager.js:537
([object _private_Shell_WM],"switch_windows",null,false)@/usr/share/gjs-1.0/lang.js:110
'
    JS ERROR: !!!     message = 'Failed to convert UTF-8 string to JS string: /F('DGT ('�*� F'E9*(1 /1 H1H/� *(/�D'
    JS ERROR: !!!   Exception was: TypeError: this._appSwitcher is undefined
    JS ERROR: !!!     lineNumber = '87'
    JS ERROR: !!!     fileName = '/usr/share/gnome-shell/js/ui/altTab.js'
    JS ERROR: !!!     stack = '([object _private_Shell_GenericContainer],[object _private_Clutter_ActorBox],0)@/usr/share/gnome-shell/js/ui/altTab.js:87
([object _private_Shell_GenericContainer],[object _private_Clutter_ActorBox],0)@/usr/share/gjs-1.0/lang.js:110
'
    JS ERROR: !!!     message = 'this._appSwitcher is undefined'
    JS ERROR: !!!   Exception was: TypeError: this._appIcons is undefined
    JS ERROR: !!!     lineNumber = '352'
    JS ERROR: !!!     fileName = '/usr/share/gnome-shell/js/ui/altTab.js'
    JS ERROR: !!!     stack = '()@/usr/share/gnome-shell/js/ui/altTab.js:352
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gnome-shell/js/ui/altTab.js:260
([object _private_Shell_GenericContainer],[object _private_Clutter_Event])@/usr/share/gjs-1.0/lang.js:110
'

Comment 2 Colin Walters 2011-05-16 20:50:23 UTC
What locale are you in that gives the errors?

Comment 3 Hedayat Vatankhah 2011-05-17 07:01:19 UTC
fa_IR

Comment 4 Hedayat Vatankhah 2011-05-17 07:18:52 UTC
Oops, notice that currently you cannot normally login to gnome-shell with fa_IR locale and it crashes due to this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=650086

To be able to login, I have tried both the following solutions, and I have faced the problem in both of them:
First:
--------------------------------------------------
The problem is caused by the Date.toLocaleFormat() function in:
/usr/share/gnome-shell/js/ui/environment.js

If I remove these lines:
//    Date.prototype.toLocaleFormat = function(format) {
//        return Shell.util_format_date(format, this.getTime());
//    };

I can login successfully.
--------------------------------------------------

Second: 
by commenting out some parts of Persian translation which used %Od and %OH and alike, which are addressed by the mentioned bug report.

Comment 5 Hedayat Vatankhah 2011-05-28 10:53:23 UTC
The login problem is resolved with the recent update. However, the focus problem still exists.

Comment 6 Hedayat Vatankhah 2011-06-03 11:49:14 UTC
Well, it seems that the actual problem is this:
---------------------------------------------------------------
    JS ERROR: !!!   Exception was: Error: Failed to convert UTF-8 string to JS string: دنبالهٔ بایتی نامعتبر در ورودی تبدیل
    JS ERROR: !!!     lineNumber = '0'
    JS ERROR: !!!     fileName = 'gjs_throw'
    JS ERROR: !!!     stack = '("Failed to convert UTF-8 string to JS string: \u062F\u0646\u0628\u0627\u0644\u0647\u0654 \u0628\u0627\u06CC\u062A\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 \u0648\u0631\u0648\u062F\u06CC \u062A\u0628\u062F\u06CC\u0644")@gjs_throw:0
([object _private_Shell_App])@/usr/share/gnome-shell/js/ui/altTab.js:815
AppIcon([object _private_Shell_App])@/usr/share/gnome-shell/js/ui/altTab.js:803
([object Array],[object Object])@/usr/share/gnome-shell/js/ui/altTab.js:841
AppSwitcher([object Array],[object Object])@/usr/share/gnome-shell/js/ui/altTab.js:827
(false,false)@/usr/share/gnome-shell/js/ui/altTab.js:141
([object _private_Shell_WM],"switch_windows",null,false)@/usr/share/gnome-shell/js/ui/windowManager.js:537
([object _private_Shell_WM],"switch_windows",null,false)@/usr/share/gjs-1.0/lang.js:110
'
-------------------------------------------------------
When this exception occurs, the _appIcon and _appSwitcher doesn't initialize and so the errors given in the first report appear. So, the problem is converting to UTF-8 in altTab.js: 815:

this.label = new St.Label({ text: this.app.get_name() });

Comment 7 Hedayat Vatankhah 2011-06-03 12:37:12 UTC
Well, looks like that the problem is in app.get_name(), and happens when Firefox is running in fa_IR locale and some special windows are open. I have not yet discovered when this problem occurs with Firefox, but it does not happen always. Anyway, shell should not be so sensitive to "app names", whatever it is!

Comment 8 Hedayat Vatankhah 2011-06-03 12:54:14 UTC
OK, I found a way to reproduce this bug, which works always and in all locales (on my system at least!):

export LANG=fa_IR.UTF-8
firefox

Results: You'll see some error messages in .xsession-errors which indicate that shell is unable to convert application name to UTF-8. Interestingly, this bug only happens when firefox is being run using 'firefox' command from a shell or using Alt+F2. 

If I run firefox in fa_IR locale from dash, this error doesn't happen (except if I restart gnome-shell after running firefox), but if I run it using 'firefox' command, this exceptions appear from the beginning.

Comment 9 Hedayat Vatankhah 2011-06-03 13:56:45 UTC
Well, the bug is in UTF-8 to JS string conversion, as described in Gnome upstread bug. Sorry for many comments in a short time.

Comment 10 Elad Alfassa 2011-06-05 05:12:41 UTC
moving to gnome-shell (was 0xFFFF)



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 11 Hedayat Vatankhah 2011-10-20 11:50:20 UTC
OK, I can no longer reproduce the bug.


Note You need to log in before you can comment on or make changes to this bug.