1105 Commits

Author SHA1 Message Date
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
Enrico Weigelt, metux IT consult
358f76f2ad treewide: fix misleading firstScreen variable naming to masterScreen
Follow-up on renaming dixGetFirstScreenPtr() to dixGetMasterScreen():
also rename the target variables for correct technical terminology.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 11:44:05 +02:00
Enrico Weigelt, metux IT consult
b0ffa7b286 treewide: rename dixGetFirstScreenPtr() to dixGetMasterScreen() for correct semantics
In Xinerama/Panoramix configuration there's one screen that's having special
meaning - it's used for simulating as the frontend for all client operations:
the clients (should) only talk to that screen, while panoramix subsystem is
proxying those operations to all the other screens (with certain changed
applied, eg. coordinate transformations).

Historically, this screen happens to be the first one in the system (some of
it's proc's are hooked up in order to achieve desired behaviour). That's why it
used to be accessed via screenInfo.screens[0] - that already had been encapsulated
into a tiny helper `dixGetFirstScreen()`.

a) the correct terminus technicus for a situation where one device (or SW entity)
   entirely controlling others is a master-slave-relationship: the controlling
   device/entity is `master`, the controlled ones are `slave` (to that specific
   master).

b) the term "first screen" is inacurate and misleading here: what the caller's are
   actually interest in isn't the first entry in the screen array, but the screen
   that's controlling the others. With upcoming refactoring of the Xinerama/Panoramix
   subsystem, this might well be a different array index than 0.

c) the term `default` also wouldn't match: `default` implies there's a real practical
   choice, and such value applies when no explicit choice has been made. But in this
   case, it practically doesn't make sense (except perhaps for debugging purpose)
   for a client to use any different screen.

Therefore fixing the function name to the correct technical terminology.
(for sake of patch readability, renaming corresponding variables is left to
subsequent patches).

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 11:44:05 +02:00
Enrico Weigelt, metux IT consult
2b875e18bc Xi: consolidate request handler prototypes
Instead of having huge number of micro-headers, consolidate all the
request handler prototypes in one file.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-12 09:25:29 +02:00
Enrico Weigelt, metux IT consult
6bc438ab5a treewide: use inline helper for accessing first screen
Instead of everybody directly accessing the (internal) screenInfo struct,
let those consumers only interested in first screen use a little helper.

Also caching the value if it's needed several times.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:45:05 +02:00
Enrico Weigelt, metux IT consult
006f0ec78c Xi: move VPC define into the only source using it
Only used inside listdev.c, so no need to have it within a header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:42:31 +02:00
Enrico Weigelt, metux IT consult
b5210be9eb Xi: helper for private structure retrieval
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-10 13:41:47 +02:00
Enrico Weigelt, metux IT consult
a324351f67 treewide: drop unnecessary includes of Xi/eglobals.h
Dropping include by sources that don't use anything from this header.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-09 14:41:10 +02:00