15 years in the making

One of the most annoying issues with Linux’s graphical system (and any UN*X), is that if you have some keys setup for switching the keyboard layout – when using two or more keyboard layouts, such as for writing English and Hebrew – then that key combination cannot be used in any other keyboard shortcut.

Its most annoyingly present when setting the keyboard layout switching command to ALT+SHIFT (like in MS-Windows), then you can’t do any keyboard shortcut that has ALT+SHIFT in it – such as ALT+SHIFT+TAB to move to the previous window.

Well, finally there is a solution! As detailed in FreeDesktop.org’s Bugzilla and Ubuntu’s Launchpad , and thanks to Ilya Murav’jov we now have a patch to solve this ancient X11 problem.

By changing the X server behavior to trigger the layout switch only when releasing the shortcut keys and only if no other key has been pressed, we can now enjoy a perfectly working “switch to previous window” action 🙂 Also all of the (default) ALT+SHIFT+<some key> keyboard shortcuts in Eclipse will finally work for me out of the box. This will also solve the Firefox keyboard shortcut problem I talked about in this post.

Now, this is just a preliminary patch. It has not been accepted anywhere yet and X.org developers will most likely want to have this configured and have the old behavior by default – at least for a while. So expect more changes and a lot more time until you see this in a repository near you. But if you are of the adventurous kind, and are running Ubuntu Karmic (9.10) or Lucid (10.04 alpha), then you can try to add my PPA to your system and upgrade your X.org server to the patched version.

On the other hand, if you’re really into pain ( 😉 ) here’s how to build it yourself on your Ubuntu system:

  1. Start by enabling the Ubuntu source repositories: open the “System” menu and go to “Administration” and start “Software Sources”. In “Software Sources”, click the checkbox labeled “Source code” – it may turn in to a dash instead of a check box, that’s ok. Click “Close” and when it asks if you want to update the repositories, click “Reload”.
  2. Now go to “System” -> “Administration” again and start “Synaptic Package Manager“. When it loads, use the quick search to look for “pbuilder” and check that for installation, then “devscripts” and also choose to install this. Click the “Apply” button to install them and wait until the installation is done.
  3. Create yourself a directory where you can put the source to be built. Now we need to go to the terminal for the rest of the work, so run it from “Applicatoins” -> “Accessories” and then use it to change into the directory you just created.
  4. run apt-get source xserver-xorg-core to download the source for the X server.
  5. Once the download is done, go to the FreeDesktop.org Bugzilla bug I linked above and download the patch from there (it should be the first one under attachments) and save it – in the directory you created you should now find a directory named xorg-xserver-someversion/debian/patches – save the patch there. Its a good idea to make sure the file ends with “.patch“.
  6. In the same directory where you saved the patch, edit the file “series” and add the file name of the patch file in the last line.
  7. Now back in the terminal, go into the xorg-xserver-someversion directory and run dch -n. This will open an editor that will let you write a changelog entry for the change you have just done. Write something meaningful and save it.
  8. To start the build, we want to first create a build chroot as described in the PBuilder Ubuntu Wiki page: run sudo pbuilder create --debootstrapopts --variant=buildd and wait for it to finish – it will take some time. When it is done, you can start the build by running pdebuild from the directory where you’ve put the source package. If you have a PGP key that you want to sign the new package with, you probably want to run pdebuild --auto-debsign so it will automatically sign the new package for you at the end of the build, otherwise you can sign it later or not sign it at all.
  9. Once the build is done, you should find your new X server DEB packages under /var/cache/pbuilder/result and you can install them by double clicking or by running sudo dpkg -i <deb files> from the terminal.

If there is interest, I can also build Fedora 12 packages with the patch – let me know.


I’ve finished building Fedora 12 packages for the patched X.org. If anyone is interested in proper shift key handling on Fedora 12, then you can find updated X.org RPMs here. These are compiled for 64bit Fedora 12, but you can also find there the source RPM from which you can build 32bit packages if you are so inclined.

[Another Update]

In preparation for Fedora 13 to be released, I’ve made RPMs with the bug #865 patch for Fedora 13 X.org.

Reblog this post [with Zemanta]

One Response to “15 years in the making”

  1. Ori:

    I have been thinking of looking into it for several years now. Thanks for bringing this wonderful fix to my attention!!!

Leave a Reply



Spam prevention powered by Akismet