After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 663064 - alternate-tab shell error on alt-tab if no windows open
alternate-tab shell error on alt-tab if no windows open
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: extensions
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-30 21:01 UTC by windchine
Modified: 2011-12-01 16:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description windchine 2011-10-30 21:01:32 UTC
Alt tab with alternate tab extension installed (Fedora 15 - GNOME Shell 3.0.2) when no windows open causes xsession-errors log:

    JS ERROR: !!!   Exception was: TypeError: ap1 is null
    JS ERROR: !!!     lineNumber = '77'
    JS ERROR: !!!     fileName = '/usr/share/gnome-shell/extensions/alternate-tab@gnome-shell-extensions.gnome.org/extension.js'

This is due to "normal_windows.shift()" in the show function adding a null entry to normal_windows when normal_windows is empty. The following "if" clause can be wrapped around the problem code to protect against this:

      if(normal_windows.length) {
        let win_on_top = normal_windows.shift();
        normal_windows.push(win_on_top);
      }

With this fix a deeper problem emerges when the method subsequently exits at:

       if (!windows.length)
            return false;

An error then occurs outside of this class when this._appSwitcher is dereferenced, it being null. It appears that the return false from the show function is not being respected by the caller.

After the faults the usual effect is for mouse clicks to be disabled in overview mode, however sometimes the shell crashes and drops back to the login prompt.

This has been tested with no other extensions running. I will test again with 3.2 when Fedora 16 is released in a few days.
Comment 1 Giovanni Campagna 2011-11-18 17:58:46 UTC
I fixed this is master by exiting with this.destroy() if the window list is empty. Can you test it?
If it works for you, I'll mark this resolved fixed.
Thanks!
Comment 2 windchine 2011-11-20 01:50:39 UTC
Yes that works perfectly. Thanks for fixing the problem.

For info, I've not been able to test with Fedora 16 yet because the alternate-tab extension is not yet compatible with its Gnome3 version.
Comment 3 Giovanni Campagna 2011-11-20 10:51:34 UTC
Closing then.
Comment 4 Giovanni Campagna 2011-12-01 16:22:03 UTC
Ok, I went on and committed this.
I still don't expect to release tarballs of the gnome-3-0 branch, so people having this bug will have to clone, or to update to 3.2.
In any case, thanks for the bug report and thanks for the patch!
Comment 5 Giovanni Campagna 2011-12-01 16:25:33 UTC
(In reply to comment #4)
> Ok, I went on and committed this.
> I still don't expect to release tarballs of the gnome-3-0 branch, so people
> having this bug will have to clone, or to update to 3.2.
> In any case, thanks for the bug report and thanks for the patch!

Obviously, this comment was meant for the other bug...