NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: misc/59591: Latin american layout "la" is incorrectly mapped to Lao in Xorg



The following reply was made to PR misc/59591; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: mrg%netbsd.org@localhost
Subject: Re: misc/59591: Latin american layout "la" is incorrectly mapped to
 Lao in Xorg
Date: Wed, 13 Aug 2025 00:14:16 +0000 (UTC)

 On Tue, 12 Aug 2025, chonmediano%gmail.com@localhost wrote:
 
 > In wskbd (wscons), the Latin American keyboard layout is identified as "la".
 >
 > When Xorg auto-configures the keyboard, it sees la and sets the layout to Lao (since "la" is the ISO 639-1 code for Lao in XKB).
 >
 > The correct XKB layout for Latin American Spanish is "latam".
 >
 
 Back in 2005, the various `#define KB_XXX' were converted to enums:
 
 https://github.com/NetBSD/src/commit/e3f3e5cc51a5dd9156972365bb9e8a89154399b4
 
 This should've has no effect on the Xorg server code, except that another
 change was made in 2016 which made it rely on it being `#defines' again:
 
 https://github.com/NetBSD/xsrc/commit/6629ff98e8379e4935ae98ff6626c360f6f4c028
 
 Not sure why it was done. Patch below which essentially brings the file
 up to date with the latest Xorg code. Should fix this.
 
 -RVP
 
 ---Start PATCH---
 diff -urN a/mnt/usr/xsrc/external/mit/xorg-server/dist/config/wscons.c b/mnt/usr/xsrc/external/mit/xorg-server/dist/config/wscons.c
 --- a/mnt/usr/xsrc/external/mit/xorg-server/dist/config/wscons.c	2021-12-05 21:14:12.000000000 +0000
 +++ b/mnt/usr/xsrc/external/mit/xorg-server/dist/config/wscons.c	2025-08-12 23:23:04.866905642 +0000
 @@ -21,21 +21,18 @@
    * DEALINGS IN THE SOFTWARE.
    */
 
 -#ifdef HAVE_DIX_CONFIG_H
   #include <dix-config.h>
 -#endif
 
 -#include <sys/types.h>
 -#include <sys/ioctl.h>
   #include <sys/time.h>
 -#include <fcntl.h>
 +#include <dev/wscons/wsconsio.h>
 +#include <dev/wscons/wsksymdef.h>
 +
 +#include <sys/ioctl.h>
   #include <errno.h>
 +#include <fcntl.h>
   #include <string.h>
   #include <unistd.h>
 
 -#include <dev/wscons/wsconsio.h>
 -#include <dev/wscons/wsksymdef.h>
 -
   #include "input.h"
   #include "inputstr.h"
   #include "os.h"
 @@ -44,7 +41,6 @@
   #define WSCONS_KBD_DEVICE "/dev/wskbd"
   #define WSCONS_MOUSE_PREFIX "/dev/wsmouse"
 
 -#if defined(KB_LA) && defined(KB_CF)
   #define KB_OVRENC \
   	{ KB_UK,	"gb" }, \
   	{ KB_SV,	"se" }, \
 @@ -52,22 +48,15 @@
   	{ KB_SF,	"ch" }, \
   	{ KB_LA,	"latam" }, \
   	{ KB_CF,	"ca" }
 -#else
 -#define KB_OVRENC \
 -	{ KB_UK,	"gb" }, \
 -	{ KB_SV,	"se" }, \
 -	{ KB_SG,	"ch" }, \
 -	{ KB_SF,	"ch" }
 -#endif
 
   struct nameint {
       int val;
 -    char *name;
 +    const char *name;
   } kbdenc[] = {
       KB_OVRENC,
       KB_ENCTAB
   #ifndef __NetBSD__
 -             ,
 +    ,
   #endif
       {0}
   };
 @@ -76,14 +65,10 @@
       {KB_NODEAD | KB_SG, "de_nodeadkeys"},
       {KB_NODEAD | KB_SF, "fr_nodeadkeys"},
       {KB_SF, "fr"},
 -#if defined(KB_CF)
       {KB_DVORAK | KB_CF, "fr-dvorak"},
 -#endif
       {KB_DVORAK | KB_FR, "bepo"},
       {KB_DVORAK, "dvorak"},
 -#if defined(KB_CF)
       {KB_CF, "fr-legacy"},
 -#endif
       {KB_NODEAD, "nodeadkeys"},
       {0}
   };
 @@ -236,10 +221,10 @@
       for (i = 0; i < 4; i++) {
           snprintf(devname, sizeof(devname), "%s%d", WSCONS_MOUSE_PREFIX, i);
           LogMessageVerb(X_INFO, 10, "wsmouse: checking %s\n", devname);
 -#ifdef __NetBSD__
 -        fd = open(devname, O_RDWR | O_NONBLOCK | O_EXCL);
 -#else
 +#ifdef HAVE_OPEN_DEVICE
           fd = open_device(devname, O_RDWR | O_NONBLOCK | O_EXCL);
 +#else
 +        fd = open(devname, O_RDWR | O_NONBLOCK | O_EXCL);
   #endif
           if (fd == -1) {
               LogMessageVerb(X_WARNING, 10, "%s: %s\n", devname, strerror(errno));
 @@ -253,7 +238,7 @@
           }
           close(fd);
           switch (wsmouse_type) {
 -#if defined(WSMOUSE_TYPE_SYNAPTICS)
 +#ifdef WSMOUSE_TYPE_SYNAPTICS
           case WSMOUSE_TYPE_SYNAPTICS:
               wscons_add_pointer(devname, "synaptics", ATTR_TOUCHPAD);
               break;
 @@ -265,7 +250,7 @@
               break;
           }
       }
 -    /* Add a default entry catching all other mux elements as "ws" */
 +    /* Add a default entry catching all other mux elements as pointers */
       wscons_add_pointer(WSCONS_MOUSE_PREFIX, "ws", ATTR_POINTER);
   }
 
 ---END PATCH---
 


Home | Main Index | Thread Index | Old Index