Commit Graph

881 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
3e9c40015f xkb: inline SProcXkbSetNamedIndicator()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-29 11:19:47 +02:00
Enrico Weigelt, metux IT consult
a5796a80f8 xkb: inline SProcXkbGetIndicatorMap()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-29 11:19:33 +02:00
Enrico Weigelt, metux IT consult
6cb3338c0b xkb: inline SProcXkbUseExtension()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:47:04 +02:00
Enrico Weigelt, metux IT consult
8daa5bc8b9 xkb: inline SProcXkbBell()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:46:50 +02:00
Enrico Weigelt, metux IT consult
8d100100af xkb: inline SProcXkbGetControls()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:46:38 +02:00
Enrico Weigelt, metux IT consult
9879290e2f xkb: inline SProcXkbGetMap()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:46:26 +02:00
Enrico Weigelt, metux IT consult
39f9bbd827 xkb: inline SProcXkbGetIndicatorState()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:46:13 +02:00
Enrico Weigelt, metux IT consult
3d787e4c48 xkb: inline SProcXkbGetNamedIndicator()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:46:01 +02:00
Enrico Weigelt, metux IT consult
68e134de44 xkb: inline SProcXkbGetNames() and SProcXkbSetNames()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:45:49 +02:00
Enrico Weigelt, metux IT consult
1cddcc087f xkb: inline SProcXkbGetCompatMap()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:45:25 +02:00
Enrico Weigelt, metux IT consult
8c545a6528 xkb: inline SProcXkbGetDeviceInfo()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:45:12 +02:00
Enrico Weigelt, metux IT consult
9eba2365c9 xkb: inline SProcXkbListComponents()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:44:59 +02:00
Enrico Weigelt, metux IT consult
25adcbfd5a xkb: inline SProcXkbSetGeometry()
No need to have whole extra functions for just a few LoC.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-26 11:44:47 +02:00
Enrico Weigelt, metux IT consult
6168868906 dix: replace XACE_SERVER_ACCESS by direct callback
Move the callbacks directly into DIX, since it's actually core infrastructure.
Also simplifying the whole machinery, by just using a simpel CallbackListPtr.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-25 14:27:41 +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
898251b461 xkb: ProcXkbGetKbdByName(): use return code of X_SEND_REPLY_WITH_RPCBUF()
The macro will automatically return BadAlloc if the buffer is broken,
otherwise Success. Thus, we don't need extra prior rpcbuf check.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-17 09:35:36 +02:00
Enrico Weigelt, metux IT consult
eb9a9e0708 xkb: ProcXkbGetKbdByName(): rename child buffers to childbuf
rename them to indicate that they're not the global payload buffer,
but temporary childs for sub-replies.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-15 11:20:36 +02:00
sesankm
71d0f66365 xkb: XKBMisc: use C99 declarations in XkbApplyCompatMapToKey
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-15 10:47:40 +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
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
sesankm
3e610c5fc5 xkb: XKBMisc: use C99 style declarations in XKBMisc functions 2025-09-10 13:40:15 +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
sesankm
af8b69b710 xkb: XKBMisc: scoped declaration in loops and use int instead of register ints
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-08 17:28:13 +02:00
sesankm
e3ae087bc7 xkb: XKBMisc: simple refactoring to declare variables where needed in XkbKeyTypesForCoreSymbols
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-08 17:28:13 +02:00
Enrico Weigelt, metux IT consult
8ac6a39c7f xkb: move WriteToClient() calls on Events into DIX macro
WriteToClient() shouldn't be called directly anymore, unless there's
no other way.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-05 20:25:02 +02:00
sesankm
0e43e8c2aa xkb: xkb.c: refactor to use c99 style declarations
Signed-off-by: sesankm <26676400+sesankm@users.noreply.github.com>
2025-09-03 13:33:40 +02:00
Enrico Weigelt, metux IT consult
7dcd9c7b1e xkb: xkbEvents: use static struct initialization
Instead of memset()ing all the structs and then assigning (overwriting)
invidual fields one by one, use static init and let the compiler find out
on its own how to do it the best way.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 12:51:43 +02:00
Enrico Weigelt, metux IT consult
f8ad69698a treewide return code of X_SEND_REPLY_WITH_RPCBUF()
The macro will automatically return BadAlloc if the buffer is broken,
otherwise Success. Thus, we don't need extra prior rpcbuf check.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-09-02 12:48:50 +02:00
Enrico Weigelt, metux IT consult
c4b492b36d xkb: ProcXkbGetDeviceInfo(): use x_rpcbuf_t for reply payload assembly
At this point just use it as allocator, so we can use the
X_SEND_REPLY_WITH_RPCBUF() macro for final sending.

Follow-up commits will change the whole call stack to operate on
x_rpcbuf_t directly, so it's also doing the byte-swap for us.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-31 10:00:40 +02:00
Enrico Weigelt, metux IT consult
64d465fdaf xkb: send simple replies via X_SEND_REPLY_SIMPLE()
Use the X_SEND_REPLY_SIMPLE() macro for sending simple replies.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-29 11:42:53 +02:00
Enrico Weigelt, metux IT consult
a9fce3b3c2 xkb: XkbAssembleGeometry(): use x_rpcbuf_t
Use x_rpcbuf_t for assembling / byte-swapping reply payload.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-26 11:03:17 +02:00
Enrico Weigelt, metux IT consult
84dd2a5039 xkb: ProcXkbGetKbdByName(): extra payload size sanity check
Add extra check for comparing the actually written sub-payload sizes
with their previously computed ones. This is meant for troubeshooting
while still stabelizing the previous, not entirely trivial commits.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-26 11:02:44 +02:00
Enrico Weigelt, metux IT consult
79792e10ae xkb: XkbWriteGeomKeyAliases(): use x_rpcbuf_t
Use x_rpcbuf_t for assembling the reply payload chunk.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-24 12:42:02 +02:00
Enrico Weigelt, metux IT consult
dbf9f932eb xkb: FillDeviceLedInfo(): use x_rpcbuf_t 2025-08-24 12:09:25 +02:00
Enrico Weigelt, metux IT consult
7f7b909abe xkb: XkbWriteGeomProperties(): use x_rpcbuf_t
Use x_rpcbuf_t for assembling reply payload chunk.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-24 12:08:47 +02:00
Enrico Weigelt, metux IT consult
82677b237b xkb: XkbWriteGeomSections(): use x_rpcbuf_t
Use x_rpcbuf_t for payload chunk assembly / byte-swapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 14:44:05 +02:00
Enrico Weigelt, metux IT consult
fd96c2950e xkb: XkbWriteGeomColors(): use x_rpcbuf_t
Use x_rpcbuf_t for assembling reply payload chunk.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 14:33:10 +02:00
Enrico Weigelt, metux IT consult
d6089c52c3 treewide: macro for computing extra units needed for reply header
Add and use macro X_REPLY_HEADER_UNITS() for computing how many
extra protocol units are needed for a reply header (for .length field)

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-22 14:14:32 +02:00
Enrico Weigelt, metux IT consult
16997296d3 xkb: use x_rpcbuf_t in XkbWriteGeomShapes()
Use x_rpcbuf_t for assembling and byte-swapping the reply payload chunk.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-21 13:12:16 +02:00
Enrico Weigelt, metux IT consult
a2211393df xkb: XkbWriteGeomDoodads(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload chunk assembly and byte-swapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-21 13:03:25 +02:00
Enrico Weigelt, metux IT consult
ca27ebbd7d xkb: XkbAssembleNames(): use x_rpcbuf_t for payload assembly
Use rpcbuf for assembling and byte-swapping xkb names payload.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-21 13:03:12 +02:00
Enrico Weigelt, metux IT consult
b0149c0183 xkb: XkbAssembleIndicatorMap(): use x_rpcbuf_t
Use x_rpbuf_t instead of raw buffer for assembling and byte-swapping
indicator map payload.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-21 13:02:53 +02:00
Enrico Weigelt, metux IT consult
d3f9dc4973 xkb: use x_rpcbuf_t in XkbWriteGeomOverlay()
Use x_rpcbuf_t for assembling and byte-swapping the payload chunk.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-21 12:54:35 +02:00
Enrico Weigelt, metux IT consult
c621506c9e xkb: ProcXkbGetKbdByName(): drop obsolete x_rpcbuf_makeroom() call
Since no consumer of this rpcbuf is writing directly to the underlying
buffer space anymore, there's no need to explicitly make room.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-21 12:54:12 +02:00
Enrico Weigelt, metux IT consult
31b6e41c56 xkb: ProcXkbGetMap(): clean up local variables
declare them where needed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 18:35:21 +02:00
Enrico Weigelt, metux IT consult
bec3b45c02 xkb: ProcXkbGetMap(): rename local variable
Give the variable `n` a better name: `numKeys`.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 18:35:21 +02:00
Enrico Weigelt, metux IT consult
b8a30d7347 xkb: ProcXkbGetMap(): use X_SEND_REPLY_WITH_RPCBUF()
Use generic macro for sending out final reply.
Also dropping our own unnecessary size payload computation - rpcbuf
already giving us this value.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 18:35:21 +02:00
Enrico Weigelt, metux IT consult
e197043099 xkb: ProcXkbGetCompatMap(): clean up variable declarations
Declara only what's really needed, where it's needed.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:32:32 +02:00
Enrico Weigelt, metux IT consult
743838456d xkb: ProcXkbGetCompatMap(): use X_SEND_REPLY_WITH_RPCBUF()
Now that we're entirely operating on x_rpcbuf_t, we can use generic
macro for the whole final write out, including setting standard
reply header fields.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:32:32 +02:00
Enrico Weigelt, metux IT consult
eda4dcabf7 xkb: use x_rpcbuf_t in XkbAssembleCompatMap()
Instead of operating on a raw buffer, use x_rpcbuf_t to assemble the
compat map payload.

ProcXkbGetCompatMap() now can directly operate on generic x_rpcbuf_t
and doesn't need it's own private buffer management.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:32:32 +02:00