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>
The global (exported) serverGeneration field is `unsigned long`, while
many other places copy it and compare it two other integer types, eg.
plain `int` (which is signed). Even if it's unlikely ever reaching such
high number of generations that it will ever make trouble, it's still
a good idea to clean this up and use the same type everywhere.
For clearity, introducing a typedef `x_server_generation_t` which is
used everywhere, instead of raw `unsigned long`.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Print out a warning when actually written payload length doesn't mactch
the previously computed one.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
As it's caller now has x_rpcbuf, we can use it here, instead of
meddling with pre-allocated buffer space directly via raw pointer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
As it's caller now has x_rpcbuf, we can use it here, instead of
meddling with pre-allocated buffer space directly via raw pointer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
As it's caller now has x_rpcbuf, we can use it here, instead of
meddling with pre-allocated buffer space directly via raw pointer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
As we now have x_rpcbuf, we can use it here, instead of meddling
with pre-allocated buffer space directly via raw pointer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
As it's caller now has x_rpcbuf, we can use it here, instead of
meddling with pre-allocated buffer space directly via raw pointer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
As it's caller now has x_rpcbuf, we can use it here, instead of
meddling with pre-allocated buffer space directly via raw pointer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
As it's caller now has x_rpcbuf_t, we can use it here, instead of
meddling with pre-allocated buffer space directly via raw pointer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The keymap assembly machinery is a horribly complicated machinery,
because often whole replies with variable sized payloads can be nested
into each other. It's time to use x_rpcbuf_t for that, but's is not an
easy thing to do and really a huge change - therefore doing this in small
and easy to digest step.
At first, let XkbAssembleMap() operate on a x_rpcbuf_t. But for now just
let it use the x_rpcbuf_t's raw buffer directly (because it's callees cant
work on this yet) - thus XkbAssembleMap() yet need to make enough room
in the buffer before calling in.
For the time being we're allocating far too much (because calculating
the actually need amount would be too complicated here) and having an
extra memcpy(). But it's just an intermediate step anyways - subsequent
commits will convert everything down the whole call chain into using
x_rpcbuf_t operations, so that extra overhead can be dropped again later.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
All source files need to include it anyways, so no need to include it here,
and neither having an extra check for HAVE_DIX_CONFIG_H
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This is a regression first caused by 182404fde6
that sends back the old xkb data instead of the new one.
This causes a mismatch in the data and size calculations between the
XkbComputeGetMapReplySize that is called above that calculates the size
of the reply and XkbAssembleMap that sets the data for the reply.
Without this fix this error is seen when running setxkbmap fr:
"Error loading new keyboard description".
Fixes setxkbmap error described in #180
Signed-off-by: dec05eba <dec05eba@protonmail.com>
* xled change tested with `xset led named "Scroll Lock"`
* modesetting change tested with `xrandr --output DP-1 --gamma 0.5:0.5:0.5`.
Without this fix that command does nothing
* xvmc change tested with `mpv --vo=xv video.mp4`
Of the currently reported issues this fixes#104
Signed-off-by: dec05eba <dec05eba@protonmail.com>
This fixes a regression in 5499a2999 (xkb: let SendDeviceLedFBs() fill buffer instead of writing directly, 2024-07-16).
We need to write the whole buffer, and the updated length has to take
into consideration that `sz` now contains `led_len` so we need to
subtract that or properly calculate the remaining size.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Lots of logging functions, especially init and teardown aren't called
by any drivers/modules, so no need to keep them exported.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since most of the extension init logic (and on/off switches for them)
is driven from miext, this seems the appropriate place for the header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>