Window manager which allows multiple active windows/multiple input devices?

I have a huge desktop, with multiple monitors, and one pretty good computer. I also have multiple mice and keyboards laying around. Now I would really like to make use of all the hardware. Say a friend comes over and wants to code simultaneously with me on one computer. I would like to give him his own mouse and keyboard. Whenever his mouse is over one window, I want his Input to be directed at the window. This would allow us to write different program parts, and easily copy and paste between our windows.

As far as I know most window managers supports only one active window, which makes this impossible. Is this because it's just an unusual thing to want, or is it because of some fundamental architectural issue with X or even the OS?

This isn't really what I want, but would it be possible to run one X-server on each monitor and give each it's own keyboard/mouse?


Solution 1:

After reading the comments and surfing a bit, I finally found the answer: http://alec.mooo.com/mpx.html

In case the page goes offline:

  1. Create a new input pair.

    xinput create-master New
    
  2. Show the devices attached to each input pair

    xinput list
    
  3. Reattach devices to the new input pair (replace x and y with the number of the devices from the list)

    xinput reattach <x> <y>
    

Support is built into X, however none of the major window managers are designed with multi-cursor in mind. But it works to some degree. Here are the window managers i tried:

  • Gnome Classic
    • Both cursors visible
  • Ice WM
    • About the same support as Gnome Classic
  • Unity
    • The second cursor becomes invisible when it's not moving.
  • Gnome Shell
    • The cursor is invisible all the time, I think it's behind other windows.
  • Enlightenment. (My current wm)
    • Best of the Window Managers i tried.
    • Claims to support multiple focus modes (I couldn't figure out how to enable it)
    • Supports dragging of multiple windows at once is strange.

Except for Gnome Shell, all of the window managers handled the multiple cursors pretty well. I was able to browse concurrently with a friend. However, only one window can be focused at a time. This means one of the keyboards' input is directed at a non-focused (grey title bar) window. For some applications as for example the gnome-terminal, empathy, chrome, this works well, but the blinking text cursor is sometimes invisible.

To which window each keyboards input is directed also seems a bit random. Usually it's the keyboard paired with the cursor that last clicked the window, but not always. And scrolling is sometimes weird.

ICE-MC

I've searched the net for a window manager with better support, and the only thing i can find is a modified version of IceWM called Multi-Cursor Window Manager (Ice-MC). http://multicursor-wm.sourceforge.net/ It looks like development was abandoned sometime in 2009, and I had a lot of trouble compiling it (some outdated dependencies, I've given up temporarily).

From the screenshots it looks really promising. Each person get's a cursor with his or her own color and the window borders are colored with the color of the person that has keyboard focus. I'll definitely look into it when I have the time.