Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 231169 - app-editors/emacs-23.1 slow to alt-tab away from (with x11-wm/metacity and assistive technologies enabled)
Summary: app-editors/emacs-23.1 slow to alt-tab away from (with x11-wm/metacity and as...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Emacs project
Depends on:
Reported: 2008-07-08 13:24 UTC by Alejandro Dubrovsky
Modified: 2010-03-24 15:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

xorg.log (xorg.log,31.04 KB, text/plain)
2008-07-10 12:55 UTC, Alejandro Dubrovsky
xorg.conf (xorg.conf,4.64 KB, text/plain)
2008-07-10 12:55 UTC, Alejandro Dubrovsky
new xorg.log (xorg.log,28.68 KB, text/plain)
2008-07-10 14:08 UTC, Alejandro Dubrovsky

Note You need to log in before you can comment on or make changes to this bug.
Description Alejandro Dubrovsky 2008-07-08 13:24:56 UTC
When in emacs, regardless of current buffer or current mode, switching to a different application with alt-tab is very slow (about half to three quarters of a second is my guess).  This is independent of the switched-to application. Switching to emacs or between any two other applications is instant.

This is sometimes extremely annoying.

Reproducible: Always

Steps to Reproduce:
1. Start emacs
2. Focus on emacs
3. Have some other application open (to act as target when alt-tabbing)
4. Press alt-tab to switch away and then back to emacs (doesn't happen the first time)
5. Press alt-tab to switch away from emacs
6. Wait too long for a core 2 duo with too much RAM
7. See other app come to the fore

Actual Results:  
As described

Expected Results:  
Expect switching to be instant, or to be dependent on target app, since that is the app that has to be redrawn.   Expectation met when emacs is not the source app.

Also happens in emacs-22.2-r2.
Also happens when emacs started with --no-desktop --no-init-file --no-site-file
This has been happening for a while.  I thought it was standard, but now I found out that it works well in Ubuntu as far as I can tell (emacs-snapshot).

Running ~x86

Not pasting .gnu-emacs since it happens with --no-init-file

Excerpts from emerge --info:

Portage 2.2_rc1 (default-linux/x86/2006.1/desktop, gcc-4.2.4, glibc-2.7-r0, 2.6.25-gentoo-r4 i686)
System uname: Linux-2.6.25-gentoo-r4-i686-Intel-R-_Core-TM-2_CPU_4300_@_1.80GHz-with-glibc2.0
Timestamp of tree: Fri, 04 Jul 2008 11:15:02 +0000
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.4.4-r13, 2.5.2-r2
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-devel/autoconf:  2.13, 2.62
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.4
virtual/os-headers:  2.6.25-r4
CFLAGS="-O2 -march=native -mtune=native -msse3 -pipe"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=native -mtune=native -msse3 -pipe"
FEATURES="autoaddcvs ccache distlocks keepwork parallel-fetch preserve-libs sandbox sfperms splitdebug strict unmerge-orphans userfetch userpriv"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

USE="3ds X a52 aac accessibility alsa apache2 arts asf asm async audiofile avahi bash-completion berkdb blender-game bzip2 bzlib cairo cal3d cdr chroot clanVoice cli cracklib crypt curl darcs dbus deprecated dga discouraged divx dri dvd dvdr dvdread eds effects emacs emboss encode esd ext-png ext-zlib faad fam fame fat festival ffmpeg fftw flash fontconfig fortran gcj gcl gd gdb gdbm gif gimp git glade glitz gmedia gmp gnome gnomecanvas gnomedb gnuplot gnutls gphoto2 gpm gs gsl gstreamer gtk gtkhtml hal icon iconv icq imlib2 ipod isdnlog jabber javascript joystick jpeg jpeg2k kde lcms ldap libffi libnotify lua lzo lzw lzw-tiff mad mbox mbrola mdnsresponder-compat midi mikmod mime mjpeg mmap mmx mono mozdevelop mozsvg mp3 mpeg mpeg2 mpeg4 mplayer mpm-prefork msn mudflap music mysql nautilus ncurses net nfsv4 nptl nptlonly nspr numarray numeric nvidia ode offensive ogg openal opengl openmp oscar pam pch pcre pdf pear-db perl php plugin png ppds pppd psyco pulseaudio pyste python qt3 qt3support qt4 quicktime readline real realmedia reflection ruby sblive sdl sdl-image sdl-sound sdlaudio session sharedext sharedmem smime sndfile sockets sound speech speex spell spl sql sqlite sse sse2 ssl startup-notification stream subversion svg svgz swig sysfs sysvipc tcl tcpd theora threads tidy tiff tk truetype type1 unicode usb v4l v4l2 vcd vfat videos vorbis win32codecs wma wmp wxwindows x86 xanim xine xinerama xml xorg xpm xulrunner xv zlib" ALSA_CARDS="emu10k1 hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en" USERLAND="GNU" VIDEO_CARDS="apm dummy nvidia vesa vga"
Comment 1 Ulrich Müller gentoo-dev 2008-07-08 16:47:58 UTC
What window manager are you using?
Comment 2 Alejandro Dubrovsky 2008-07-09 12:48:40 UTC
metacity 2.22.0
Comment 3 Christian Faulhammer (RETIRED) gentoo-dev 2008-07-09 13:18:04 UTC
(In reply to comment #2)
> metacity 2.22.0

 I use that one, too, though I have a stable system and only some parts of Gnome 2.22 installed.  No problems here.
Comment 4 Ulrich Müller gentoo-dev 2008-07-09 13:33:33 UTC
I cannot reproduce the problem here.

Gnome team: adding you to CC, any ideas about this?
Comment 5 Rémi Cardona gentoo-dev 2008-07-09 14:43:38 UTC
More likely an X driver issue. Could you tell us what versions you have for :
 - x11-base/xorg-server
 - x11-drivers/*

and could you attach a copy of your Xorg.O.log and xorg.conf?

Comment 6 Alejandro Dubrovsky 2008-07-10 12:54:50 UTC
xorg-server 1.4.2  (although the log below says is running.  I haven't restarted X for a while)
nvidia-drivers 173.14.09
xf86-input-evdev 1.99.2-r2
xf86-input-joystick 1.3.2
xf86-input-keyboard 1.3.1
xf86-input-mouse 1.3.0

That said, this has been an issue for a long time, so I doubt it depends on the current versions running.

Xorg.log and xorg.conf attached (bugzilla didn't like them pasted in here)
Comment 7 Alejandro Dubrovsky 2008-07-10 12:55:25 UTC
Created attachment 160048 [details]
Comment 8 Alejandro Dubrovsky 2008-07-10 12:55:48 UTC
Created attachment 160050 [details]
Comment 9 Rémi Cardona gentoo-dev 2008-07-10 13:36:59 UTC
Would you mind restarting your X? Does it happen even with a fresh session or only after a while?

Comment 10 Alejandro Dubrovsky 2008-07-10 14:08:03 UTC
Created attachment 160057 [details]
new xorg.log

Here's the new xorg.log.   I rebooted the machine to load the new nvidia drivers (previous session wasn't using the same drivers as I reported).  

Issue is still there on a new session.  

Something that I didn't make specific previously:  the problem happens only when switching away from emacs by using alt-tab; if I use the mouse, the switch is instant.  I was reminded of this because since restarting, the keyboard behaviour is a bit strange.  The repeat goes fast for the first 5 characters or so, and then slows down as if some buffer has been filled.
Comment 11 Ulrich Müller gentoo-dev 2008-09-06 07:32:08 UTC
<ulm> dberkholz: any idea what could be the issue with bug 231169?
<Willikins> ulm:
	    "app-editors/emacs-cvs-23.0.9999 slow to alt-tab away from";
	    Gentoo Linux, Applications; NEW;
<ulm> dberkholz: remi suspected it to be a driver problem
<nightmorph> solution: emerge -C emacs && emerge vim :p
<dberkholz> ulm: i don't really support binary drivers. but worth checking
	    whether the reporter has compositing enabled in metacity, and
	    whether he can reproduce with x86-video-nv.
<ulm> dberkholz: o.k., i'll ask him. and add x11 to cc

- Can you reproduce the problem with x11-drivers/xf86-video-nv?
- Do you have compositing enabled in metacity?
Comment 12 Alejandro Dubrovsky 2008-09-06 14:02:39 UTC
Compositing is disabled
The problem is also there when using the nv driver (I hope I don't have to test that very often, it does ugly things to my second monitor, and leaves it unusable till I reboot).

Something else I noticed:  switching with alt-tab while emacs is loading works fast; it is only when emacs is fully loaded that it starts behaving the way described here.

Also, if running emacs 22.2.92, doing fast alt-tabs semi-freezes the X client (mouse cursor still moves, but I can't switch to another program), till I do something like ctrl-alt-f2 and kill emacs.  This does not happen with emacs-cvs.

Comment 13 Ulrich Müller gentoo-dev 2008-12-07 22:01:45 UTC
Is this still an issue?
Comment 14 Alejandro Dubrovsky 2008-12-09 11:19:51 UTC
Comment 15 Alejandro Dubrovsky 2009-01-25 12:55:04 UTC
More possibly-useful information:

I tried to see what was going on with the slow down by running emacs under xlibtrace (, which is just a library that uses a LD_PRELOAD to step in between all calls to xlib and just outputs what is going on, but when run under trace, the slow alt-tabbing behaviour disappears. 
Comment 16 Alejandro Dubrovsky 2009-02-02 11:40:38 UTC
Upgraded to app-editors/emacs-cvs-23.0.9999-r1 last weekend.  Fixed! Thanks!
Comment 17 Ulrich Müller gentoo-dev 2009-02-02 13:53:11 UTC
(In reply to comment #16)
> Upgraded to app-editors/emacs-cvs-23.0.9999-r1 last weekend.  Fixed! Thanks!

Could you verify that the bug is gone in the pretest version, emacs-cvs-23.0.90 (upstream released it today)?
Comment 18 Alejandro Dubrovsky 2009-02-07 01:53:09 UTC
My celebration was premature.  I had forgotten I had turned off 'Enable assistive technologies' in the Assistive Technologies Preferences a while back after reading this:
(not exactly that, but some other related emacs bug on the ubuntu tracker which I can't find now)

The preference change is only activated after restarting gnome (which is why I forgot about it)

Turning on 'Enable assistive technologies' and restarting gnome brings the problem back.  I'll live without the assistive technologies, but the bug should probably remain open.
Comment 19 Ulrich Müller gentoo-dev 2009-05-13 15:07:28 UTC
Finally I succeeded to reproduce this on a current ~x86 system:

1. Make sure gnome-extra/at-spi (1.26.0), gnome-extra/libgail-gnome (1.20.1),
   and app-editors/emacs-cvs (23.0.92) are installed
2. Start a Gnome session
3. Make sure that "assistive technologies" are enabled (if not, enable them and
   logout/login again)
4. Open a terminal window
5. Start Emacs with "emacs-23 -Q --daemon"
6. Open an Emacs frame with "emacsclient-23 -n -c" and focus on it
7. Press Alt-TAB

At this point, the session freezes for about 30 seconds.
Comment 20 Ulrich Müller gentoo-dev 2009-05-13 15:12:40 UTC
Forgot to mention, no binary Xorg driver here, but x11-drivers/xf86-video-intel. IMHO it's unlikely that this is a driver issue.
Comment 21 Leif Walsh 2009-09-06 14:56:39 UTC
I had this issue as well, and disabling assistive technologies fixed the problem.  If I can help bisect the issue, let me know.  Here's relevant package versions for now:

Comment 22 Ulrich Müller gentoo-dev 2009-09-06 20:03:19 UTC
(In reply to comment #21)
> I had this issue as well, and disabling assistive technologies fixed the
> problem.  If I can help bisect the issue, let me know.

Any help with this problem is welcome.

The upstream bug report is here:
Comment 23 Ulrich Müller gentoo-dev 2010-03-24 15:27:43 UTC
No progress here. Closing.