Wednesday, July 9, 2008

compiz with mpx support

Part two of my June work for the Uni/CSIRO was to modify compiz to support multiple input devices.

Get it now from git://people.freedesktop.org/~whot/compiz.git, checkout the mpx branch.

The current state: compiz core supports XI2, and the move, resize and annotate plugin support multiple devices. So you can wobble two windows at once if you feel like it - just for extra bling. Likewise, you can resize a window into 4 directions at once (I think so, only tested it with two).

The approach I took was fairly simple: in core, replace some functions (e.g. pushScreenGrab) with a device-specific one (pushDeviceGrab). This was done throughout the whole of compiz, and instead of core events, compiz now listens for XI events. In the plugins, replace the single variables with arrays/lists large enough for each device.

For the move/resize plugins I had to use an additional hack - the window decorator tells compiz over ICCCM that a resize/move operation has started. The ICCCM message doesn't include device ids and doesn't have any free bytes to stuff them in. The solution I found was to simply query all devices and find the one closest to the reported position - with the button 1 down.

In theory, the mpx-aware compiz should also work on a non-XI2 server but I haven't tested it.
The work is not finished with many details missing, but the core is there. I won't be able to continue on it as it was a project written under quite some time pressure and that time is up now.

I encourage you to take it and finish it off, it would be good to see a real window manager supporting XI2. If you have any questions about how to continue, pop me an email.

6 comments:

wiz said...

Great stuff! Just thanks for pushing it around!

SmSpillaz said...

Hey Peter!

I probably should have left this comment earlier, but I've decided to do it now.

I have taken your work with compiz-mpx and am now in the process of porting every compiz-fusion plugin to mpx support. I'm looking at a release soon. My blog is http://smspillaz.wordpress.com/ in case you are interested!

mad_pollock said...

We had great success with MPX on rhel6 which was using Gnome2. What I mean by success is that we had a 3 monitor set-up running separate X displays and each monitor had a separate touch pointer. We were able to keep the pointers on each of the monitors via the transformation matrix. And the keyboard focus went into the last window touched which was perfect. Then we went to rhel7 (Gnome3) and everything that worked in rhel6 no longer worked. Gnome3 no longer supports multi-screen and MWM doesn't seem to know about MPX and keyboard focus. Any ideas on a window manager that may have MPX support? From what I have researched, you had invented MPWM for demonstration purposes, but it has since been abandoned?

Peter Hutterer said...

mad_pollock: GTK3 supports MPX natively so you can write applications that use it. But otherwise it should work just as before, I'm not sure what you mean by "GNOME3 no longer supports multi-screen". There's no MPX-capable window manager in common use, it's too much of a niche case. MPWM is abandoned, yes. But anyway, from your basic description you should still be able to do the same thing as before.

mad_pollock said...

Thanks for the response. We saw a post where the gnome developers abandoned multiple X screen support when going to Gnome3? We almost have everything working on rhel7 using gdm as our display manager and mwm as our window manager, except keyboard focus does not work consistently when touching the window (frame or inside the window) with the MPX (xinput) created slave pointers (i.e. 3 touch pointers are created and dedicated to each x-screen via the transformation matrix and the core mouse pointer can move across all three x-screens). Keyboard focus only works with the core pointer (mouse) on rhel7 and we cant seem to figure out why keyboard focus wont transfer with touch when it worked perfectly on rhel6 when running gdm and gnome2. We have tried several different display managers on rhel7 such as lightdm, gdm and we also tried different window managers such as Gnome3, mwm and mate. Nothing seems to solve the issue where keyboard focus consistently transfers in a window via the touch pointers. All of the other touch functionality such as drag, resize and button presses work fine. Its just keyboard focus management that is not working in the rhel7 environment?

Peter Hutterer said...

mad_pollock: let's take this off here, the comment function here is less than ideal for discussions. Send me an email, maybe we can figure out what's going on.