1112 Commits

Author SHA1 Message Date
b-aaz
d2dcac6eca Revert "xkb: unexport XkbGetCoreMap() and XkbSetRepeatKeys()"
This reverts commit 25d99353eeb806f2929cf4423e481ff745ae4216.
These symbols are required by the xorgxrdp driver.

Signed-off-by: b-aaz <b-aazbsd@proton.me>
2026-01-07 10:56:33 +01:00
Enrico Weigelt, metux IT consult
d2e5ed2a89 Xi: drop SWAPIF macro
Trivial enough for just writing the actual code.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 17:29:17 +01:00
Enrico Weigelt, metux IT consult
dbbbf14a83 Xi: consistenly name reply structs "reply" instead of "rep"
Preparation for future use of generic reply assembly macros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 16:28:54 +01:00
Enrico Weigelt, metux IT consult
d1dd9bc5e6 Xi: ProcXChangeDeviceControl() consistenly name reply structs "reply" instead of "rep"
Preparation for future use of generic reply assembly macros.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-12-04 11:47:41 +01:00
Enrico Weigelt, metux IT consult
33729b1361 include: windowstr.h: unexport w*() macros
These aren't used by any drivers, so no need to keep them public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 19:54:42 +01:00
Enrico Weigelt, metux IT consult
9b8d7d1eb9 treewide: don't include <region.h> anymore
Nothing in there that we need, include <regionstr.h> instead.
But keeping the file in place, until all external consumer have
been migrated.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-27 19:27:27 +01:00
Enrico Weigelt, metux IT consult
8039c2cbf1 dix: unexport SwapLongs()
Not used by any external drivers, so no need to keep it in public SDK.
Since it's used by internal modules, still needs to be _X_EXPORT'ed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-25 18:26:02 +01:00
Enrico Weigelt, metux IT consult
25d99353ee xkb: unexport XkbGetCoreMap() and XkbSetRepeatKeys()
Not needed by external drivers, so no need to keep them public.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-19 13:32:12 +01:00
Enrico Weigelt, metux IT consult
a18480ef84 Xi: drop redundant SProcIDispatch()
Now that all individual swapping request handlers have been merged into the
actual ones, there's no need for a separate dispatcher anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-11-04 10:45:04 +01:00
Enrico Weigelt, metux IT consult
d7eac08a22 Xi: inline SProcXISelectEvents() and SProcXIGetSelectedEvents()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-30 09:44:41 +01:00
Enrico Weigelt, metux IT consult
8d46c06965 Xi: inline SProcXIQueryPointer()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-29 10:57:52 +01:00
Enrico Weigelt, metux IT consult
e125d9badb Xi: inline SProcXIWarpPointer()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-29 10:56:57 +01:00
Enrico Weigelt, metux IT consult
8051613229 Xi: inline SProcXIQueryVersion()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-26 13:59:05 +01:00
Enrico Weigelt, metux IT consult
7d9fb7b4a0 Xi: inline SProcXIPassiveGrabDevice() and SProcXIPassiveUngrabDevice()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-26 13:58:17 +01:00
Enrico Weigelt, metux IT consult
25818f04c3 Xi: inline SProcXIGetClientPointer() and SProcXISetClientPointer()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-26 13:56:58 +01:00
Enrico Weigelt, metux IT consult
e2baf112f1 Xi: inline SProcXIBarrierReleasePointer()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-23 13:11:22 +02:00
Enrico Weigelt, metux IT consult
0a7df3a828 Xi: inline SProcXUngrabDeviceKey()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-22 14:05:24 +02:00
Alan Coopersmith
37226395ad Xi: set value for led_values in CopySwapKbdFeedback()
(The existing setting of led_mask is probably wrong, but has been set
 like this since X11R5 and going back as far as the first version in
 the X Consortium source control archives.)

Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:

xwayland-24.1.6/redhat-linux-build/../Xi/getfctl.c:108:9:
 warning[-Wanalyzer-use-of-uninitialized-value]:
 use of uninitialized value ‘*k2.led_values’
108|->         swapl(&k2->led_values);

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2075>
2025-10-21 13:02:04 +02:00
Alan Coopersmith
e26cad2421 Xi: avoid null dereference if wOtherInputMasks() returns NULL
The wOtherInputMasks(win) macro will return NULL if
win->optional is NULL.

Reported in https://gitlab.freedesktop.org/xorg/xserver/-/issues/1817:

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:1390:13:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:1404:13:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:2293:9:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:3244:22:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘inputMasks’

xwayland-24.1.6/redhat-linux-build/../Xi/exevents.c:3338:9:
 warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2075>
2025-10-21 13:02:04 +02:00
Enrico Weigelt, metux IT consult
9370aafb36 Xi: inline SProcXUngrabDeviceButton()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:21:52 +02:00
Enrico Weigelt, metux IT consult
a28cacbef2 Xi: inline SProcXIAllowEvents()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-21 10:21:31 +02:00
Enrico Weigelt, metux IT consult
437515032b Xi: inline SProcXGetDeviceMotionEvents()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-20 10:01:40 +02:00
Enrico Weigelt, metux IT consult
302533aac8 Xi: inline ProcXSetDeviceFocus()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-20 10:01:19 +02:00
Enrico Weigelt, metux IT consult
81a8619bda dix: replace XACE_CLIENT_ACCESS by direct callback
Replace complicated xace hook by simple and cheap callback.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-07 10:52:54 +02:00
Enrico Weigelt, metux IT consult
0f0164882f Xi: inline SProcXGetExtensionVersion()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-03 17:27:58 +02:00
Enrico Weigelt, metux IT consult
962580a15a treewide: macros lambda-esque screen iteration
iterating over screen list via lambda-esque macros calls like this

    DIX_FOR_EACH_SCREEN({
        do_something
    });

withing the body, the iterator variables `walkScreenIdx` and `walkScreen`
are defined and can be directly used (read-only). the code inside the body
is running in a separate scope.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-10-01 11:40:34 +02:00
Enrico Weigelt, metux IT consult
7f25e705f5 Xi: inline SProcXGetDeviceDontPropagateList()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-30 10:00:35 +02:00
Enrico Weigelt, metux IT consult
53bae08ed0 Xi: inline SProcXGetSelectedExtensionEvents()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-30 09:58:12 +02:00
Alexandre Janon
16ee02ab67 dix: ensure that event fix-up is not performed on core events
CoreEnterLeaveEvent calls FixUpEventFromWindow with a pointer to a stack-allocated xEvent structure, which may get later casted into an xXIDeviceEvent*, with writes done by FixUpXI2DeviceEventFromWindow at an offset larger than sizeof(xEvent). This code-path is protected by xi2_get_type() but the following warning is generated by building with -O3 and LTO:

In function 'FixUpXI2DeviceEventFromWindow',
    inlined from 'FixUpEventFromWindow' at ../dix/events.c:2716:13,
    inlined from 'CoreEnterLeaveEvent' at ../dix/events.c:4679:5:
../dix/events.c:2628:48: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
 2628 |         ((xXIEnterEvent *) event)->same_screen =
      |                                                ^
../dix/events.c: In function 'CoreEnterLeaveEvent':
../dix/events.c:4652:12: note: at offset 48 into destination object 'event' of size 32
 4652 |     xEvent event = {
      |            ^

This PR suppresses this warning, by tracking the level of the event (ie., core event, XI or XI2) and ensuring that fix-up is performed only on XI2 events.

Signed-off-by: alex14fr <alex14fr@gmail.com>
2025-09-29 17:15:16 +02:00
Enrico Weigelt, metux IT consult
07ac2c2c99 Xi: inline SProcXGrabDeviceButton()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-29 11:22:03 +02:00
Enrico Weigelt, metux IT consult
175dbe3661 Xi: inline SProcXIQueryDevice()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-29 11:19:10 +02:00
Enrico Weigelt, metux IT consult
829595da02 Xi: inline SProcXIGetFocus() and SProcXISetFocus()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-29 11:17:57 +02:00
Enrico Weigelt, metux IT consult
21fb27735a os: unexport XNFreallocarray()
Not used by any drivers, no no need to keep it in public SDK.
Since it's not used by drivers, it's effectively not an ABI change,
so can be done within ABI-25.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-29 10:53:15 +02:00
Enrico Weigelt, metux IT consult
3f5fdfc615 Xi: inline SProcXGrabDeviceKey()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:49:06 +02:00
Enrico Weigelt, metux IT consult
0c40403eb7 Xi: inline SProcXChangeDeviceDontPropagateList()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:48:27 +02:00
Enrico Weigelt, metux IT consult
71133d6502 Xi: inline SProcXSendExtensionEvent()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:48:16 +02:00
Enrico Weigelt, metux IT consult
c9437b5467 Xi: fix missing includes of extinit.h
Don't rely on this file just being included indirectly by somebody else
just by accident.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-25 13:48:53 +02:00
Enrico Weigelt, metux IT consult
4fa442b6eb Xi: inline SProcXChangeDeviceControl()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 11:39:51 +02:00
Enrico Weigelt, metux IT consult
88ed85dffc Xi: inline SProcXGrabDevice()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 11:39:00 +02:00
Enrico Weigelt, metux IT consult
2b9c079b86 Xi: inline SProcXChangeFeedbackControl()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 11:38:50 +02:00
Enrico Weigelt, metux IT consult
2e64ce88ea Xi: inline SProcXSelectExtensionEvent()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 11:38:34 +02:00
Enrico Weigelt, metux IT consult
da1c2a4605 Xi: inline SProcXUngrabDevice()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 11:38:22 +02:00
Enrico Weigelt, metux IT consult
3b4ba245b7 Xi: inline SProcXIGrabDevice() and SProcXIUngrabDevice()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 11:38:10 +02:00
Enrico Weigelt, metux IT consult
24f8535f28 Xi: inline SProcXIChangeCursor()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 11:37:58 +02:00
Enrico Weigelt, metux IT consult
36facd71b5 dix: move request/response related functions to new request_priv.h header
Move functions/macros dealing with request parsing or reply assembly/write
out of the big dix_priv.h into their own headers. This new header will also
get more of those function/macros soon (yet still in the pipeline).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-24 11:32:50 +02:00
Enrico Weigelt, metux IT consult
d82aa8308d xace: drop never used XACE_KEY_AVAIL
This hook was never used, so no need to keep around something that's
really not used anywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-23 11:26:19 +02:00
Enrico Weigelt, metux IT consult
48c72edf38 Xi: use return value of X_SEND_REPLY_SIMPLE()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:43:31 +02:00
Enrico Weigelt, metux IT consult
90a258d08a Xi: inline swapped property request handlers
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:43:21 +02:00
Enrico Weigelt, metux IT consult
c2a2ce1d7e Xi: inline SProcXAllowDeviceEvents()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-22 12:42:44 +02:00
Enrico Weigelt, metux IT consult
a040a93f59 Xi: inline SProcXChangeDeviceKeyMapping()
No need to have a hole bunch of extra functions, if we can just easily
inline the few relevant lines.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:43:47 +02:00