[PATCH] Resolve an inconsistency between libX11 and Xserver over GetModifierMapping
Peter Hutterer
peter.hutterer at who-t.net
Tue Oct 20 23:39:17 PDT 2009
On Tue, Oct 20, 2009 at 12:57:05PM +0100, Jon TURNEY wrote:
> libX11 ModMap.c believes that GetModifierMapping can never return an error
>
> Xserver devices.c believes that GetModifierMapping can return an error if
> the ModMap couldn't be generated
>
> According to the protocol document I have, libX11 is right, so adjust the
> server to send back an empty modmap if one couldn't be made...
>
> http://bugs.freedesktop.org/show_bug.cgi?id=24621
> ---
> dix/devices.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/dix/devices.c b/dix/devices.c
> index 6a79073..7486827 100644
> --- a/dix/devices.c
> +++ b/dix/devices.c
> @@ -1520,14 +1520,12 @@ int
> ProcGetModifierMapping(ClientPtr client)
> {
> xGetModifierMappingReply rep;
> - int ret, max_keys_per_mod = 0;
> + int max_keys_per_mod = 0;
> KeyCode *modkeymap = NULL;
> REQUEST_SIZE_MATCH(xReq);
>
> - ret = generate_modkeymap(client, PickKeyboard(client), &modkeymap,
> - &max_keys_per_mod);
> - if (ret != Success)
> - return ret;
> + generate_modkeymap(client, PickKeyboard(client), &modkeymap,
> + &max_keys_per_mod);
>
> memset(&rep, 0, sizeof(xGetModifierMappingReply));
> rep.type = X_Reply;
> --
> 1.6.4.2
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Cheers,
Peter
More information about the xorg-devel
mailing list