Commit Graph

21345 Commits

Author SHA1 Message Date
Enrico Weigelt, metux IT consult
658d2db226 dix: rpcbuf: add x_rpcbuf_write_INT32()
litle wrapper for directly writing INT32 w/o signess warnings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-21 17:42:04 +02:00
Enrico Weigelt, metux IT consult
d900434235 xfixes: ProcXFixesFetchRegion() use x_rpcbuf_t and X_SEND_REPLY_WITH_RPCBUF()
Use x_rpcbuf_t for reply payload assembly, and X_SEND_REPLY_WITH_RPCBUF()
for sending out the whole reply.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-21 13:29:52 +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
callmetango
19cf00d3a3 NEWS: updated to version 25.0.0.9
Updated the NEWS with the shortlogs of version 25.0.0.8 and 25.0.0.9.

Signed-off-by: callmetango <callmetango@users.noreply.github.com>
2025-08-21 11:30:56 +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
7f648df8af dix: rpcbuf: add x_rpcbuf_write_rect() for writing RECTANGLE PDU
The `RECTANGLE` PDU is pretty common, so it's good to have a helper for
writing this, so it doesn't need to be open-coded everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:37:47 +02:00
Enrico Weigelt, metux IT consult
2edb06c8bc dix: rpcbuf: add x_rpcbuf_write_rpcbuf_pad()
This is writing the contents of source rpcbuf into the target one,
pads it and finally clears the source buffer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:37:02 +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
Enrico Weigelt, metux IT consult
eea90293fb xkb: simplify XkbAssembleGeometry()
Preparation for further refactoring.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:32:05 +02:00
Enrico Weigelt, metux IT consult
7b0e5d9ac5 xkb: ProcXkbGetKbdByName(): drop unneeded payload size computation
The amount of data written by XkbAssembleMap() is already known rpcbuf,
so no need for additionally computing this our own anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:31:08 +02:00
Enrico Weigelt, metux IT consult
66311c6d51 dix: rpcbuf: add x_rpcbuf_write_counted_string_pad()
Add a helper for writing pascal-type strings: the counter is written
as CARD16, then followed by the string characters (w/o zero), and
finally everything padded up to full protocol units.

This encoding is used in various places throughout the Xserver,
eg. in xkb.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:13:07 +02:00
Enrico Weigelt, metux IT consult
4c18cebf09 xfixes: cursor: use x_rpcbuf_t and X_SEND_REPLY_WITH_RPCBUF()
Use x_rpcbuf_t for reply payload assembly, and X_SEND_REPLY_WITH_RPCBUF()
for sending out the whole replies.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-20 11:10:52 +02:00
Enrico Weigelt, metux IT consult
8ea70e9e78 treewide: use use x_rpcbuf_wsize_units() instead of rpcbuf.wpos
In the request handlers, use x_rpcbuf_wsize_units() for payload length
computation.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-19 15:50:54 +02:00
Enrico Weigelt, metux IT consult
15fdd0ae20 dix: fix X_SEND_REPLY_WITH_RPCBUF()
We need to call bytes_to_int32() instead of pad_to_int32(),
otherwise our computation is totally broken.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 19:38:15 +02:00
Enrico Weigelt, metux IT consult
bca6d2ddcd vidmode: ProcVidModeGetMonitor(): create reply struct right before send
Move the declaration of the reply struct down to after the payload has
been finally assembled, so we don't need extra payload size compuation
anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
4a57142388 vidmode: ProcVidModeGetDotClocks(): use x_rpcbuf_t for payload assembly
Use x_rpcbuf_t for reply payload assembly, instead of pre-counting and
pre-allocating buffer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
df98365a3c vidmode: ProcVidModeGetMonitor(): use x_rpcbuf_t for payload assembly
Use x_rpcbuf_t for reply payload assembly, instead of pre-counting and
pre-allocating buffer.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
b33244566c vidmode: ProcVidModeGetAllModeLines(): drop length computation
Since the x_rpcbuf already knows how much had been written, there's no
need for extra payload size computation anymore - just pick the number
of written bytes from the x_rpcbuf.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
bf41f83c67 vidmode: fillModeInfoV*(): use x_rpcbuf_t for byte-swapping
use x_rpcbuf_t operations for constructing the reply payload, so we don't
need to do the byte-swapping explicitly anymore.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
954c6e2c29 vidmode: fillModeInfoV*(): use x_rpcbuf_t
Second step of migrating ProcVidModeGetAllModeLines() to x_rpcbuf_t:
Let it's callees also use x_rpcbuf_t operations, instead of raw pointers.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
c9bd4cc4df vidmode: ProcVidModeGetAllModeLines(): use x_rpcbuf_t
First step of migration to x_rpcbuf: create a buffer with enough room for
the already calculated payload size and pass the raw buffer pointer to
our callees as we used to do with the calloc()ed one.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:42:13 +02:00
Enrico Weigelt, metux IT consult
c10baabc89 xres: ProcXResQueryClients(): use x_rpcbuf_t
use x_rpcbuf_t for reply payload assembly and byte-swapping.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:27:15 +02:00
Enrico Weigelt, metux IT consult
96129e44bd xkb: ProcXkbGetMap(): use WriteRpcbufToClient()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:26:42 +02:00
Enrico Weigelt, metux IT consult
723f6a55a8 xkb: fix swapping bug in ProcXkbGetKbdByName()
We've been adding the individual sub-packet's payload bytes *after*
the swapping, which is leading to totally wrong sizes.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 17:26:18 +02:00
Enrico Weigelt, metux IT consult
60b28c2568 os: osdep: small helper for safe strlen()
Adding helper safe_strlen() that's also checking for NULL pointer
and returning 0 in this case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 16:15:41 +02:00
Enrico Weigelt, metux IT consult
1d93fbc68e randr: use X_SEND_REPLY_WITH_RPCBUF() macro
Use the new X_SEND_REPLY_WITH_RPCBUF() macro for final reply write out

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 11:16:23 +02:00
Enrico Weigelt, metux IT consult
5842bd9c86 dbe: use X_SEND_REPLY_WITH_RPCBUF() macro
Use the new X_SEND_REPLY_WITH_RPCBUF() macro for final reply write out

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 11:16:23 +02:00
Enrico Weigelt, metux IT consult
29005e9873 shape: use X_SEND_REPLY_WITH_RPCBUF() macro
Use the new X_SEND_REPLY_WITH_RPCBUF() macro for final reply write out

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 11:16:23 +02:00
Enrico Weigelt, metux IT consult
0b7194c9bc dix: add X_SEND_REPLY_WITH_RPCBUF() macro
This macro is sending a reply header struct and rpcbuf payload
all in one shot. It also automatically computes the payload lengths
as well as also filling common fields like `type` and `sequenceNumber`

A typical call site looks like this:

>    int ProcFooRequest(ClientPtr client) {
>
>        [ ... ]
>
>        X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
>        return Success;
>    }

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 11:16:23 +02:00
Enrico Weigelt, metux IT consult
3e76baff89 xwin: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
5823fc2b7f xquartz: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
5bde454490 xnest: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
c77d47a3ac xfree86: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
97d72431cf kdrive: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
f2c28743a4 present: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
fb2c085de0 miext: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
6c25d52276 randr: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
17bf4e677e mi: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
6730e673d6 Xi: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
d81cf93329 Xext: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00
Enrico Weigelt, metux IT consult
e29c0454ce render: canonical walkScreen variable on screen list iterations
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-08-18 10:52:49 +02:00