Commit graph

1576 commits

Author SHA1 Message Date
Alan Coopersmith
70f7403fd3 configure.ac: Fix --enable-thread-safety-constructor
Prior to this, --enable-thread-safety-constructor would disable it,
while --disable worked as expected, and no option left it enabled as
expected by default.  This also fixes the --help text to be displayed.

Fixes: afcdb6fb00
Reported-by: @igor.v.kovalenko
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2022-05-04 09:23:18 -07:00
Adam Jackson
d0da5a1e0f libX11 1.8
Minor number bump to reflect the thread safety default change.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2022-04-29 11:27:44 -04:00
Adam Jackson
afcdb6fb00 global: call XInitThreads() from the library's constructor
There is really no point in not being thread safe, I measured, all you
can see happen is noop performance gets like twice as slow and you have
thread safety bugs. And we're using xcb as the transport which means we
should expect threads in our clients anyway. Just do it.

This assumes your compiler understands __attribute__((constructor)). If
this is not your compiler, you can disable this with the appropriate
configure flag, but be aware you're asking for bugs.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2022-04-26 15:08:31 -04:00
Benno Schulenberg
1ab48f3cc9 docs: add release notes for versions 1.7.3, 1.7.4, and 1.7.5
They were forgotten when those releases were made.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-04-24 15:15:05 +02:00
Alan Coopersmith
35d1513bc7 XkbOpenDisplay: Add _Xconst qualifier to display name argument
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-23 16:38:49 +00:00
Alan Coopersmith
c88ceaad4a XKBgeom.h: Add _Xconst qualifier to char * arguments in functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-23 16:38:49 +00:00
Alan Coopersmith
0ce4425826 XKBgeom.h: Remove XKB_IN_SERVER section
The Xserver made its own copy of this file in 2008, and the API's are
no longer the same between the server and client forks.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-23 16:38:49 +00:00
Benno Schulenberg
be8c01946a lcCT: use the correct index for checking the second byte
(Not that it will make any difference, as the checking of these
high bits looks like an excess of precaution.)

This fixes issue #134.

Reported-by: Rafał Mikrut

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-04-20 10:23:51 +02:00
Benno Schulenberg
488b156fe2 nls: make the Ethiopian compose sequences actually work
In the Ethiopian keyboard layout, the dead vowel keys do not produce <e>
and <u> and so on, but instead produce <U+FE69> and <U+FE75> and so on,
so the compose sequences should use those latter code points.

Also, include the basic compose sequences from en_US.UTF-8/Compose,
so that, when switching to a different layout in the Ethiopian locale,
all the usual compose sequences work too.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-04-20 06:58:52 +00:00
Benno Schulenberg
e6f98a3dbd nls: add Multi-key sequences for abovedot, diaeresis, and ogonek
These accents by themselves could only be produced when one had a
dead key for them, not with the help of the Multi key.

[Note that the sequences <dead_acute> <space> for apostrophe (')
and <dead_diaeresis> <space> for double quote (") are anomalies,
as normally <dead_accent> <space> produces the accent itself.]

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-04-18 17:27:41 +02:00
Benno Schulenberg
d323704e7c nls: remove eight pointless self-producing compose sequences
Compose sequences are meant to produce certain symbols by combining
certain different symbols, not to produce a symbol with the help of
the symbol itself.

This fixes issue #59.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-04-18 17:23:05 +02:00
Benno Schulenberg
3b62c0322c nls: remove misplaced sequences from Ethiopian and Greek compose files
The Khmer digraphs and Arabic ligatures have nothing to do with
Amharic or Greek.

(Also rewrap a comment and correct two others.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-04-15 13:28:01 +00:00
Benno Schulenberg
479af78f2e nls: remove redundant Khmer digraphs, already defined in included file
This fixes issue #160.

Reported-by: Mike Fabian

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-04-15 13:28:01 +00:00
Alan Coopersmith
6d7d08726f XkbUpdateKeyTypeVirtualMods: always initialize mask
XkbVirtualModsToReal should only fail to set mask if the server does
not support XKB, but it still made Oracle Parfait complain:

Error: Uninitialised memory
   Uninitialised memory variable [uninitialised-mem-var] (CWE 457):
      Possible access to uninitialised memory referenced by variable 'mask'
        at line 863 of lib/libX11/src/xkb/XKBMisc.c in function 'XkbUpdateKeyTypeVirtualMods'.
        Path in callee avoiding write at line 862
          mask allocated at line 860

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-10 14:51:55 -07:00
Matt Turner
9ac6859c20 libX11 1.7.5
Signed-off-by: Matt Turner <mattst88@gmail.com>
2022-04-03 10:15:30 -07:00
Simon McVittie
76d1cc3c1c Don't try to destroy NULL condition variables
This avoids a segfault during error-unwinding if an invalid display name
is passed to XOpenDisplay().

Fixes: 8a368d80 "Fix two memory leaks in _XFreeX11XCBStructure()"
Resolves: #155
Signed-off-by: Simon McVittie <smcv@debian.org>
2022-04-03 14:24:13 +01:00
Matt Turner
80b30d1251 libX11 1.7.4
Signed-off-by: Matt Turner <mattst88@gmail.com>
2022-03-30 13:54:13 -07:00
Hodong
8a368d808f Fix two memory leaks in _XFreeX11XCBStructure()
Even when XCloseDisplay() was called, some memory was leaked.

XCloseDisplay() calls _XFreeDisplayStructure(), which calls
_XFreeX11XCBStructure().

However, _XFreeX11XCBStructure() did not destroy the condition variables,
resulting in the leaking of some 40 bytes.

Signed-off-by: Hodong <hodong@yozmos.com>
2022-03-24 16:50:11 +00:00
Adam Jackson
da97120f23 xcb: Clarify the XInitThreads error message
XInitThreads has been called if _Xglobal_lock != NULL, we may as well
check that before printing a misleading error message.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2022-03-23 13:31:05 -04:00
Giovanni Mascellani
257927c51b xcb_io: Allow jumps backwards when widening the request number.
Request numbers are not always seen in the numeric order by widen(),
for example due to Mesa directly calling _XError(). When this happens,
widen() adds 2^32 to the reported widened number, triggering failed
assertions and bad behavior.

With this commit, wrapping of the lower dword is detected in a more
robust way, by requiring that a skip of at least 2^31 is seen.

This fixes issue #152.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
2022-03-23 16:22:25 +00:00
Benno Schulenberg
918063298c nls: add a compose sequence for the peace symbol
As the thing in the circle looks a bit like an upside-down Y,
use <O> <Y> as the sequence, similar to <O> <A> for anarchism.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-03-03 12:06:35 +01:00
Benno Schulenberg
4f9eb32709 nls: remove obsolete locale aliases with uppercase in the language code
(These aliases may have been useful on some systems twenty years ago,
but nowadays all should have settled on lowercase language code plus
uppercase country code.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-25 17:53:23 +00:00
Benno Schulenberg
ba0d3b437d nls: map eo.UTF-8 directly to en_US.UTF-8 instead of using a relay alias
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-25 12:53:10 +01:00
Benno Schulenberg
cfddb79981 nls: remove the mistaken eo_EO names -- EO is not a valid country code
(Debian has had several of these lines commented out for years.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-25 12:52:45 +01:00
iyzana
eb5885245a nls: add locale alias from eo.UTF-8 to eo_XX.UTF-8
There is no matching locale in the locale.dir and compose.dir files for
the locale eo.UTF-8. Setting it as the locale resulted in compose files
not being loaded.

Signed-off-by: iyzana <iyzana@protonmail.com>
2022-02-25 10:45:07 +00:00
Benno Schulenberg
24df23dff9 nls: group the compose sequences for tilde, degree, and cedilla together
Also, correct the comment for the double quote character ("), and move
the soft hyphen and the interrobangs to a special punctuation group.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-24 18:24:12 +00:00
Benno Schulenberg
c0191f020f nls: use shape-based compose sequences for hammer-and-sickle instead
Using a misspelled abbreviation (CCCP) of an obsolete country's name
to compose a fairly general communist symbol does not seem right.

    https://en.wikipedia.org/wiki/Hammer_and_sickle

Many compose sequences instead combine characters that together look
similar to the target character.  Do the same here: question mark (?)
plus backslash (\) look a bit like ☭ .

In the bargain, this fixes issue #63.

Reported-by: Marc Mezzarobba

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-24 18:24:12 +00:00
Alan Coopersmith
582dc6f89e gitlab CI: enable Static Application Security Testing (SAST)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-02-20 11:52:22 -08:00
Benno Schulenberg
336e8f7255 nls: add compose sequences for leftward, upward and downward double arrow
These sequences follow the logic of: the arrow shaft (=) first, the
arrow head (< or > or ^ or v) second.  This is so because the sequence
<= is already taken for ≤, and there is no obvious ASCII character for
a double vertical line, so we have to make do with a horizontal one.

Since commit 6101b967b6 from eight years ago, there is a compose sequence
for the rightward double arrow, but not for the other three directions.

This fixes issue #138.

Requested-by: Mélanie Chauvel

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-20 15:20:52 +01:00
Benno Schulenberg
623b77d4f3 imDefLkup: verify that a pointer isn't NULL before using it
It is possible for _XimICOfXICID() to return NULL, so it is necessary
to check this isn't actually the case before dereferencing the pointer.
All other callers of _XimICOfXICID() do this check too.

(The check itself is ugly, but it follows the style of the code in the
rest of the module.)

Fixes issue #45.

Reported-by: Bhavi Dhingra

Original-patch-by: Bhavi Dhingra

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-14 11:47:46 +01:00
Christopher Chavez
b83938f7f9 Xlib.h: fix spelling in comment
Signed-off-by: Christopher Chavez <chrischavez@gmx.us>
2022-02-14 00:23:09 -06:00
Christopher Chavez
4791055682 Xlib.h: spelling fix in comment 2022-02-13 05:26:14 +00:00
Denis Drakhnia
9304e645bd nls: Add ru_UA.utf8 locale alias.
Signed-off-by: Denis Drakhnia <numas13@gmail.com>
2022-02-04 16:24:02 +00:00
Benno Schulenberg
9ef2551f0c nls: do some manual adjustment of whitespace in the compose sequences
This achieves a more consistent vertical alignment (per group) of the
target character and the trailing comments.

(Most blocks were aligned in some fashion, except the "Greek Extended"
block, which has lines of greatly varying lengths.)

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-03 16:19:39 +01:00
Benno Schulenberg
0dad289ead nls: among the compose sequences, replace all runs of spaces with tabs
It was done with this script:

    cat nls/en_US.UTF-8/Compose.pre |
    sed 's!\(^<.\{6,13\}>\)\s*:!\1\t\t\t\t:!' |
    sed 's!\(^<.\{14,21\}>\)\s*:!\1\t\t\t:!' |
    sed 's!\(^<.\{22,29\}>\)\s*:!\1\t\t:!' |
    sed 's!\(^<.\{30,37\}>\)\s*:!\1\t:!' |
    sed 's!\(: ".*"\)\s*!\1\t!' |
    sed 's!\(\s*# \)! # !' > trimmed &&
    mv  trimmed  nls/en_US.UTF-8/Compose.pre

This saves 37 kilobytes of whitespace.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-02 14:12:06 +01:00
Benno Schulenberg
fc79e39c23 docs: add missing word, wrap line, fix typo, and trim an excess space
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-02-02 14:11:53 +01:00
Benno Schulenberg
93446455c4 KeyBind: reshuffle two ifs into the general order of ascending codes
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-27 15:02:09 +01:00
Benno Schulenberg
93f15f5f29 KeyBind: slightly speed up some case conversions by adding missing returns
This avoids pointlessly tumbling through several more ifs when the
conversion has aleady been done.

Also remove two redundant conditions (as lower codes have already
been handled) and fold two other conditions together.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-27 14:38:33 +01:00
Benno Schulenberg
317c7abbcc KeyBind: update the Greek case-conversion tables to Unicode Data 14.0
A few symbols, like Heta and Sampi and dotted lunate Sigma, have been
assigned code points since Unicode Data 4.0, and need their entries.

This fixes issue #132.

Reported-by: Ray Vine

Original-patch-by: Ray Vine

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-27 14:04:11 +01:00
Benno Schulenberg
402b843fa7 remove a commented-out code fragment, and remove a stray blank line
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-26 17:21:31 +01:00
Benno Schulenberg
fbbc3cf8b8 XKBCvt: remove an if that never gets triggered
The 'if' at the beginning of _XkbHandleSpecialSym() allows only symbols
from the numeric keypad and some control symbols to pass -- XK_hyphen
is not among them, so the check for XK_hyphen in the later 'if' will
always be false.

(The corresponding conversion in _XTranslateKeySym() in KeyBind.c was
removed in March 1994.)

(Also, several keyboard layouts nowadays contain the 'hyphen' symbol,
allowing the user to enter soft hyphens into a document.  So we really
don't want to remap this symbol.)

Fixes issue #48.

Reported-by: Bhavi Dhingra

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-26 17:12:26 +01:00
Benno Schulenberg
6786744f63 nls: add the es_CU locale name, for Cuba
It was added to glibc ten years ago.

This fixes issue #57.

Reported-by: Dominique Michel

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-23 17:13:02 +01:00
Benno Schulenberg
d241d8af7f nls: remove some obsolete Norwegian and Yugoslavian locale names
They have not existed in glibc for more than fifteen years.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-23 16:56:45 +01:00
Benno Schulenberg
32dd7c03e9 nls: put some entries in their alphabetical order, and adjust alignment
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-22 18:07:30 +01:00
Benno Schulenberg
46a066f251 nls: fix a typo (be_BG => bg_BG) and drop an obsolete comment
The typo was only partially fixed in commit 22a5255b80 sixteen years ago,
and the internet shows that there was at least one user frustrated that
bg_BG.utf8 didn't work but bg_BG.UTF-8 did.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-22 18:07:22 +01:00
Benno Schulenberg
84efc0aa59 nls: remove the compose sequences with the deviant KP_Space symbol
Using this KP_Space symbol as a stand-in for the symbol 2 doesn't make
sense.  It looks like a mistake, or as if someone had a broken keyboard
and used KP_Space as a substitute for 2.

Also, no keyboard layout in the last fifteen years has contained the
KP_Space symbol, so I don't see how anyone could type it.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-19 16:30:05 +01:00
Benno Schulenberg
b76e661ca2 nls: move the block of Jamo to its logical place (ascending Unicodes)
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-19 16:05:41 +01:00
Benno Schulenberg
21f82fb9c6 nls: delete some ineffective compose sequences (that were commented out)
They have never worked; there is no point in keeping them in the file.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-19 16:05:41 +01:00
Benno Schulenberg
6cc31eafa8 nls: group some compose sequences better, and add some comments
Also, align a few trailing comments more consistently, and change
some comments so they will be excluded from the installed file --
there is no need for those comments there.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-01-19 16:05:37 +01:00
ArenaL5
d60ede7843 nls: add a compose sequence for the copyleft symbol
Probably not used anywhere yet, let alone seriously, as stated in
https://en.wikipedia.org/wiki/Copyleft#Symbol

Signed-off-by: ArenaL5 <arenal5@protonmail.com>
2022-01-17 19:35:23 +01:00