Making X report the mouse position with subpixel precision

Johan Kiviniemi freedesktop.org-xorg at johan.kiviniemi.name
Fri Feb 23 13:42:55 PST 2007


Hi all,

I've had this idea for a feature in mind, and wrote a blag entry about
it a while ago:
http://johan.kiviniemi.name/blag/2007/02/23/making-x-report-the-mouse-position-with-subpixel-precision/

This list is probably the right place to reach the right people with the
idea, so i'll just paste the contents here:

✁ ✁ ✁

The precision of mice is generally much better than the precision of
screens. I'm not very familiar with the internals of X, but AFAIK it
only reports the mouse position to clients at the screen's precision.

My humble proposal is to make it possible for X clients to know the
mouse position with subpixel precision via an extension.

As I'm surely not the only one who has had this idea, perhaps it's
already being designed or even implemented. If that is the case, please
excuse my ignorance :-). Otherwise, I hope this idea reaches the Xorg
folks.

The feature would have a couple of benefits:

• Scrollbars

On a long page, a single pixel of scrollbar movement may cause the
content to scroll a huge amount. The entire design of scrollbars could
be better, but even with the current design, subpixel accuracy would
make it easier to control the scrolling.

GUI toolkits such as Gtk and Qt would have to be modified to support
this feature.

• Transformed windows

With some recent changes, it's possible for a window to have an
arbitrary coordinate map, to which input events are transformed. This
allows windows to be e.g. scaled or rotated in three dimensions and
still receive input correctly.

Is the coordinate transformation going to happen from the screen's pixel
grid? If a window is scaled down, that would mean that all its pixels
might not be reachable.

If the transformed mouse position is calculated from the subpixel screen
coordinates, this problem would vanish.

• Image processing

In programs such as GIMP, there are obvious benefits from being able to
draw and move things with subpixel precision, especially if the image
has been zoomed out.

• Others

There are many other programs that can benefit from this feature: 3D
modeling software, games, you name it.

✃ ✃ ✃

Thank you for all the hard work you're doing and thanks for considering
this feature.

Sincerely,
-- 
Jοhan Kiviniemi  http://johan.kiviniemi.name/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20070223/778624f3/attachment.pgp>


More information about the xorg mailing list