|
|
 |
 |
 |
 |
MPX has been merged. |
 |
 |
 |
 |
 |
 |
 |
 |
Submitted by peter on Tuesday, May 27, 2008 - 14:32 |
MPX updates |
 |
 |
http://lists.freedesktop.org/archives/xorg/2008-May/035641.html
For those of you watching xorg-commits, you may have noticed that MPX has been
merged into master [1].
The client-side libraries and protocol headers have been merged quietly last
week already, this time is just the xserver itself.
A change in the previously proposed schedule [2]: the XKB rework didn't make
it. With the recent SSL issue and other workloads, Daniel wasn't able to get
it ready in time. We agreed on merging MPX without it, as it should not affect
XKB much anyway.
A number of changes went in since the announce, the most important being the
return of input device cordinate scaling. Tablets can thus be used. Thanks to
Magnus Vigerloef for his help on this matter.
The input ABI has been bumped and all the input drivers on fdo have been
updated to compile with the new API. You will need to get the latest version
however. I don't think the ABI will remain stable until the next release, but
I figured input modules not loading encourages people to fetch the latest
release rather than complaining about them not compiling anymore.
The video ABI has not been bumped yet, but you _must recompile_ your video
driver. No API changes, a recompile is enough.
As previously mentioned, existing setups should not be affected and anything
that changes is most likely a bug. Unless you create additional cursors/foci,
in which case the border between bug and broken UI paradigm is somewhat
blurry.
For the impatient, run the following commands:
Update xorg/app/xinput to the most recent version.
xinput --list --short
xinput --create-master "foobar"
xinput --reattach "MyMouse" "foobar pointer"
xinput --reattach "MyKeyboard" "foobar keyboard"
It is at this point you have a second set of devices that work independently.
It is at this point that you may realise that neither GNOME, KDE, nor any
other environment actually works decently with multiple devices. So start
fixing them right now.
To go back to a standard setup:
xinput --reattach "MyMouse" "Virtual core pointer"
xinput --reattach "MyKeyboard" "Virtual core keyboard"
xinput --remove-master "foobar pointer"
Have fun. Input bugs that result from the MPX merge can be assigned to me.
So long, and thanks for all the mice.
Cheers,
Peter
[1] http://lists.freedesktop.org/archives/xorg-commit/2008-May/016662.html
[2] http://lists.freedesktop.org/archives/xorg/2008-May/035225.html
|
 |
 |
 |
 |
 |
 |
 |
 |
MPX merge coming up |
 |
 |
 |
 |
 |
 |
 |
 |
Submitted by peter on Monday, May 12, 2008 - 09:47 |
MPX updates |
 |
 |
The MPX merge has been announced.
http://lists.freedesktop.org/archives/xorg/2008-May/035225.html
After over two years of development, MPX will be merged into master in the
week following the 25th of May.
Any yays and nays need to be expressed ASAP.
=== Stability ===
I'm using it on my laptop and on my box at home. Most of the recent patches
were cleanups, and I haven't had any issues with it.
With the most recent patch to HW-render the cursor, I cannot tell the
difference between master and mpx.
== Schedule ==
daniel is working on an xkb cleanup right now. mpx will be merged into this
xkb cleanup, and the combination will be merged into master.
xkb-mpx merge to happen in the week of the 19th to 25th, drop onto master
after testing.
This includes changes to x11proto, xextproto, inputproto, libXi, libX11,
libXext, xinput, and xserver.
I also need to get a simple patch into libxcb. This must be done first, w/o
the libxcb patch I cannot merge.
== Changes and possible issues ==
If you only ever use one cursor and one keyboard focus, you should not notice
any differences. If you do, please file a bug.
The story is different for multiple input devices. Now, as far as I can tell
this is the first time ever anyone has had native support for multiple
independent input devices on the GUI. So a number of basic UI-paradigms just
curl up and weep when you start juggling three mice and four keyboards.
I spent a lot of time trying to make the server behave well, even if the
application doesn't support multiple input devices. But, nothing is perfect
and there are some cases where the behaviour may seem weird. These behaviours
however should be deterministic and thus you can get used to them until the
applications are fixed up and actually support XI.
One thing that will get lost for the time being is support for tablets. Magnus
is working on that, and it may be in mpx before the merge happens.
== XI v2.0 ==
Due to the changes in server behaviour, XI will be bumped to v2.0. XI 1 is
still supported, albeit the server does some tricks here to not screw up your
settings.
Any comments - please put them forward NOW before it is too late!
|
 |
 |
 |
 |
 |
 |
 |
 |
HW rendered cursors are back. |
 |
 |
 |
 |
 |
 |
 |
 |
Submitted by peter on Wednesday, May 7, 2008 - 13:58 |
MPX updates |
 |
 |
Pushed a simple but quite important fix yesterday.
As you may know, cursors are rendered in HW these days. One benefit of this is that the cursor doesn't flicker when it is moved around. Another one is that the cursor is responsive even when the computer is under load. (This has to do with the server implementation, not with the hardware. HW cursors are updated during SIGIO handling, not during event processing, hence the responsiveness)
Unfortunately, current hardware can't render arbitrary numbers of cursors, and although anholt claims that he has ideas of how to render two cursors in HW, I understand we'll be stuck with SW rendering for a while (cursors, DRI works nonetheless). SW cursors are bad, since they can be laggy. I've been using it for a while at home, and it can be quite annoying.
The solution: MPX now switches between HW and SW rendering. As long as we have only a single cursor, we use HW rendering. When the second cursor is created, the server switches to SW cursors, and then back again to HW when only one cursor is left.
The side-effect: I could now drop MPX onto your machine and you wouldn't even notice that it's there until you start creating new devices. Yay.
|
 |
 |
 |
 |
 |
 |
 |
 |
GIMP support is back... |
 |
 |
 |
 |
 |
 |
 |
 |
Submitted by peter on Monday, April 28, 2008 - 15:18 |
MPX updates |
 |
 |
Well, that's just one of the changes, but the most visible one.
In the past, the GIMP didn't work. Simply because the new device semantics state that if you grab an attached slave device, it will be detached and set to floating automatically until you ungrab again. Now, the GIMP always grabbed all extension devices, leaving you with nothing to actually control the cursor.
So, one of the changes I did over the last weekend was to get some versioning support into XI. The previous one was weak, as it didn't allow the client to tell the server what it supported. A new XQueryInputVersion() call in libXi can do that now, unless this call is issued we assume that the client supports XI v1.x.
For those clients that only support 1.x, we don't return the full device list but rather only the virtual core pointer, the virtual core keyboard and finally all floating extension devices. This essentially resembles a XI setup pre-MPX. As a result, the GIMP only tries to open extension devices that are already floating, leaving you with the ability to control your cursor normally.
This isn't a perfect solution, as some other semantics change too but it works alright so far.
Other than that, it was mainly cleanup. Including the transition of libXi to docbook xml based manpages, which should make it easier to actually write manpages now.
To update, pull inputproto, libXi and xserver.
|
 |
 |
 |
 |
 |
 |
 |
 |
A new view on events |
 |
 |
 |
 |
 |
 |
 |
 |
Submitted by peter on Tuesday, January 15, 2008 - 19:11 |
MPX updates |
 |
 |
Some important changes pushed again. Let me explain (get yourself a beverage of your choice, this may take a while).
Historically, devices generate two input events: one core event, one XI event. The latter was ignored by pretty much everything but the GIMP, the former is basically what is used by every app out there. These two events came from two different devices, the core event always came from the core pointer, the XI event from the device directly.
With MPX, this doesn't work. XI is required to actually differ between devices, but core events are required as well if we want to actually use anything.
So one of the changes in MPX that was introduced many moons ago is that both core and XI events come from the same device. Likewise, if an app grabs the pointer, it would grab the device (search for ClientPointer in the archives), allowing for multiple pointer grabs on multiple device. But to ensure apps work correctly, only a single grab per device. Sounds good in theory, doesn't it?
Fast forward until last week. We* ran into the following problem: If an app would listen for DeviceButtonPress under a window manager that puts a passive core grab onto the button, the XI events never get through. Metacity with focus-follows mouse falls under that category. Turns out that the event freezing semantics caused the XI event to "disappear". So step one was to figure out WTF can be done.
Each device has an event queue for when event processing is frozen (during synchronous grabs). And with the code, the event that caused the freeze would be stored in the EQ. In our case, this was the core event. When that happend, the XI event was lost, and when the device was unfrozen, the XI event surprisingly did not arise like phoenix from the ashes but stayed lost. Probably in a pub, drinking beer, laughing at me.
After a bit of hacking, I changed the code that the XI event would get stored as well, after the core event. When the device is unfrozen, the server first resends the initial event (the core press, remember?) and then subsequent events. So my theory was that it would try to send the core event to the app, fail and then try the XI event and we can live happily ever after.
Wrong. Turns out metacity listens for button presses on the container window. And X traverses the window hierarch upwards for each event until it can be delivered. So the unfrozen core event actually got sent to metacity. This in turn caused an implicit passive grab to activate inside the X server (I think I wrote about that ages ago). And when it was time to process the XI event, the grab would discard the XI event. After all, metacity doesn't do XI.
The solution one was reasonably simple: fix up the passive grab event processing and frozen event queue to emulate core events on demand, but actually only ever deal with XI events. So even thought the core event is send to the client, we store the XI event in the device's EQ. And when thawing the device, the XI event is delivered first, and if not, a core event is generated and then sent.
Then we** found something else. If an app would listen for DeviceButtonPress and the window manager for ButtonPress on a parent window, trouble would pop in for a quick hello. The ButtonPress event, delivered to the WM would cause an implicit passive grab on the device. Then, the XI event would cause another implicit passive grab to activate. And it would overwrite the previous core implicit passive grab.
The result? Metacity never got a release event, so the window was following each and every mouse move. And while this behaviour is appropriate for, say, cat, a window manager has more important things to do. Like managing windows.
The solution to this is to support two grabs on a device. While at the same time only supporting a single grab on the device.
And up to now you thought you had it hard...
This is when I changed how input devices are perceived in the server. Instead of two separate events being processed, a single input event is pumped through two different APIs (core and XI). Sounds like esoterical BS but it helps to understand the whole problem better.
Each event can only be sent to a single application. First we try to send it as core, then as XI event. If an app receives either, processing stops. Otherwise, we try again on the parent window, until we reach the root window or time stops. Whichever is sooner.
The significant change with all this is that an event can only be sent to a single client. If the button press was sent to a core client, no XI client will receive the same press as an XI event. Which makes sense, as this means that an input event can only cause a single action, and not two actions in two different apps.
Ok. Not that exciting, I admit. But writing this gave me a perfect excuse to procrastinate from writing my thesis. After all, that's the main goal in life. Thank you for your attention.
*curtain falls. thunderous applause*
* by "we" I mean Baljinder, one of the lab's summer interns, who's writing a multi-device diagram editor.
* by "we" I mean my colleague Ben who's adopting FLTK to work with MPX.
|
 |
 |
 |
 |
|
 |
 |
 |
 |
Browse archives |
 |
 |
 |
 |
 |
 |
 |
 |
« November 2009
| |
|
|
|
|
|
1 |
| 2 |
3 |
4 |
5 |
6 |
7 |
8 |
| 9 |
10 |
11 |
12 |
13 |
14 |
15 |
| 16 |
17 |
18 |
19 |
20 |
21 |
22 |
| 23 |
24 |
25 |
26 |
27 |
28 |
29 |
| 30 |
|
|
|
|
|
|
|
 |
 |
 |
 |
|