XLibre Xserver
Go to file
Willem Jan Palenstijn 0ee4ed286e mi: fix rounding issues around zero in miPointerSetPosition
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/577

This patch replaces the instances of trunc in miPointerSetPosition by
floor, thereby removing the incorrect behaviour with subpixel pointer
locations between -1 and 0.

This is the relevant code fragment:

    /* In the event we actually change screen or we get confined, we just
     * drop the float component on the floor
     * FIXME: only drop remainder for ConstrainCursorHarder, not for screen
     * crossings */
    if (x != trunc(*screenx))
        *screenx = x;
    if (y != trunc(*screeny))
        *screeny = y;

The behaviour of this code does not match its comment for subpixel
coordinates between -1 and 0. For example, if *screenx is -0.5, the
preceding code would (correctly) clamp x to 0, but this would not be
detected by this condition, since 0 == trunc(-0.5), leaving *screenx
at -0.5, out of bounds.

This causes undesirable behaviour in GTK3 code using xi2, where negative
subpixel coordinates like this would (to all appearances randomly)
remove the focus from windows aligned with the zero boundary when the
mouse hits the left or top screen boundaries.

The other occurences of trunc in miPointerSetPosition have a more subtle
effect which would prevent proper clamping if there is a pointer limit
at a negative integer rather than at 0. This patch changes these to
floor for consistency.

Signed-off-by: Willem Jan Palenstijn <wjp@usecode.org>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1451>
2024-04-04 04:15:08 +00:00
.gitlab-ci CI: add a driver build stage to check for header breakage 2024-03-19 00:37:35 +00:00
Xext include: unpexport SELINUX_* consts from include/global.h 2024-03-25 19:40:04 +00:00
Xi Xi: ProcXIPassiveGrabDevice needs to use unswapped length to send reply 2024-04-02 19:19:40 -07:00
composite composite: move out unexported CompositeIsImplicitRedirectException() 2024-03-03 22:50:07 +00:00
config config: wscons: fix warning on discarded const 2024-04-01 23:30:43 +00:00
damageext Remove autotools support 2021-10-27 13:15:40 +03:00
dbe dbe: drop obsolete NEED_DBE_PROTOCOL 2024-02-28 11:29:39 +01:00
dix dix: unexport CloseDownClient() 2024-03-13 00:47:36 +00:00
doc dix: dixutils: make workQueue pointer dix-private 2024-02-23 23:06:38 +00:00
dri3 randr: move private definitons from randrstr.h to randrstr_priv.h 2024-02-22 23:47:49 +00:00
exa render: move private definitions out of public glyphstr.h 2024-03-03 22:54:16 +00:00
fb render: move private definitions out of public glyphstr.h 2024-03-03 22:54:16 +00:00
glamor render: move private definitions out of public glyphstr.h 2024-03-03 22:54:16 +00:00
glx include: drop obsolete registry.h 2024-03-03 23:20:06 +00:00
hw Xquartz: ProcAppleDRICreatePixmap needs to use unswapped length to send reply 2024-04-02 19:19:40 -07:00
include xkb: make XkbUpdateKeyTypesFromCore() static 2024-04-03 19:54:51 +02:00
m4 Add ax_pthread.m4 to m4/ 2016-05-29 19:20:51 -07:00
man Xserver.man: Note that -byteswappedclients is the default in this release 2024-03-23 10:27:03 -07:00
mi mi: fix rounding issues around zero in miPointerSetPosition 2024-04-04 04:15:08 +00:00
miext os: move os_move_fd() out of public API 2024-03-09 17:12:46 +00:00
os os: move SELinux enforcement state to the extension 2024-03-25 19:40:04 +00:00
present randr: move private definitons from randrstr.h to randrstr_priv.h 2024-02-22 23:47:49 +00:00
pseudoramiX Remove autotools support 2021-10-27 13:15:40 +03:00
randr render: drop obsolete macros pict_f_transform and pict_f_vector 2024-03-03 22:54:16 +00:00
record dix: unexport eventconvert.h functions 2024-03-11 12:26:44 +01:00
render render: fix refcounting of glyphs during ProcRenderAddGlyphs 2024-04-02 19:19:40 -07:00
test test: fix FTBS on missing xlib includes on NetBSD 2024-04-01 23:41:22 +00:00
xfixes dix: unexport global variables 2024-03-09 17:23:43 +00:00
xkb xkb: make XkbUpdateKeyTypesFromCore() static 2024-04-03 19:54:51 +02:00
.appveyor.yml appveyor: Add libxcvt build dep 2021-11-04 13:03:25 +00:00
.dir-locals.el .dir-locals.el: Add missing final newline 2019-10-01 17:05:28 +00:00
.gitignore Clean up the .gitignore file 2024-01-12 00:50:24 +00:00
.gitlab-ci.yml CI: Only run the driver build job on Xorg changes 2024-03-19 00:37:35 +00:00
.mailmap Add a .mailmap file to canonicalize author names and emails 2023-03-15 18:10:51 +00:00
.travis.yml travis: Add OSX meson build to matrix 2019-05-02 15:42:58 +00:00
COPYING modesetting: Merge modesetting's COPYING into the xserver's. 2014-09-15 12:46:02 -07:00
README.md Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
meson.build test: fix FTBS on missing xlib includes on NetBSD 2024-04-01 23:41:22 +00:00
meson_options.txt xwayland/glamor: Drop the EGLStream backend 2024-03-18 15:41:17 +00:00
xorg-server.m4 xorg-server.m4: just all cflags instead of just sdkdir 2018-09-20 20:12:24 +01:00
xorg-server.pc.in xfree86: link modules against Xorg symbols on Cygwin 2012-04-05 21:57:07 -05:00
xserver.ent.in doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00

X Server

The X server accepts requests from client applications to create windows, which are (normally rectangular) "virtual screens" that the client program can draw into.

Windows are then composed on the actual screen by the X server (or by a separate composite manager) as directed by the window manager, which usually communicates with the user via graphical controls such as buttons and draggable titlebars and borders.

For a comprehensive overview of X Server and X Window System, consult the following article: https://en.wikipedia.org/wiki/X_server

All questions regarding this software should be directed at the Xorg mailing list:

https://lists.freedesktop.org/mailman/listinfo/xorg

The primary development code repository can be found at:

https://gitlab.freedesktop.org/xorg/xserver

For patch submission instructions, see:

https://www.x.org/wiki/Development/Documentation/SubmittingPatches

As with other projects hosted on freedesktop.org, X.Org follows its Code of Conduct, based on the Contributor Covenant. Please conduct yourself in a respectful and civilized manner when using the above mailing lists, bug trackers, etc:

https://www.freedesktop.org/wiki/CodeOfConduct