Commit graph

1612 commits

Author SHA1 Message Date
Alan Coopersmith
d1baf2ec48 Remove NEWS file which only covered 2006 & 2007 releases
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-07 20:11:28 +00:00
Po Lu
1294bfa487 specs: document change in XIMPreeditCallbacks
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-03 14:47:19 -07:00
Alan Coopersmith
1a7e54609c man pages: document XCloseIM frees its argument
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-03 14:44:22 -07:00
Alan Coopersmith
a04b84f0f7 Copyright & license cleanup 2022-11-03 20:31:31 +00:00
Benno Schulenberg
5e41119d96 nls: reshuffle a few compose sequences, to have similar ones together
It makes more sense to have similar sequences grouped together
than to rigidly follow the order of ascending Unicode codes.
2022-11-02 18:26:56 +00:00
Benno Schulenberg
65d89342f5 nls: remove two compose sequences that use deprecated symbols
The last few occurrences of `leftcaret` and `rightcaret` were replaced
with `less` and `greater` in xkeyboard-config half a year ago.
2022-11-02 18:26:56 +00:00
Benno Schulenberg
6baccbae53 nls: let <Multi_key> <minus> <underscore> compose U+2212 (MINUS SIGN)
There was not yet any way to compose the Unicode minus sign, U+2212.
2022-11-02 18:26:56 +00:00
Adam Jackson
7977557541 Allow X*IfEvent() to reenter libX11
The documentation for this family of functions very clearly says not to
call into xlib in your predicate function, but historically single
threaded apps could get away with it just fine, and now that we've
forced thread-safety on the world such apps will now deadlock instead.
That's not an acceptable regression even if the app is technically
broken. This has been reported with XFCE and FVWM, and Motif's
cut-and-paste code has the same bug by inspection, so this does need to
be addressed.

This change nerfs LockDisplay/UnlockDisplay while inside the critical
bit of an IfEvent function. This is still safe in the sense that the
display remains locked and no other thread should be able to change it
from under us, but the loop that scans the event queue might not be
robust against it being modified as a side effect of protocol emitted by
the predicate callback. But that's not new, non-XInitThreads'd xlib
would have the same caveat.

Closes: xorg/lib/libx11#157
2022-11-02 14:05:38 +00:00
Benno Schulenberg
0d1d65bdd9 nls: change <Compose> <^> <-> to mean superscript minus instead of macron
Several other `<Multi_key> <asciicircum> <symbol>` sequences
produce the superscript equivalent of the given symbol.  So,
let `<Multi_key> <asciicircum> <minus>` do the same.

Also, add two other sequences for producing a plain macron,
to compensate a bit the loss of the above sequence.

Additionally, make `<Multi_key> <underscore> <minus>` produce
a subscript minus, for consistency.

This fixes issue #165.

Requested-by: J. McWilliams

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-10-31 16:29:47 +01:00
Jan Tojnar
3108982707 nls: Map sr locales to sr_RS compose files
Serbian used sr_YU (Yugoslavia) code in the past.
Then it was succeeded by sr_CS (Serbia and Montenegro).
Finally, it was split into sr_RS (Serbia) and sr_ME (Montenegro).

da95ecbbdc
introduced the modern sr_RS and sr_ME codes.

Next, 4076189869
added the Serbian compose table but only for the legacy sr_CS entry.

5cd60398b7
removed the legacy sr_CS entry, the only one pointing to the correct compose file.
It also renamed the file to sr_RS, but did not update the compose mapping.

Let’s point all Serbian locales to the Compose file again.
2022-10-20 09:14:49 +02:00
Alan Coopersmith
a35d706cd8 COPYING: remove notice for the removed UIThrStubs.c
Fixes: 701e9e9a ("Use same pthread-stubs as libxcb")

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-14 20:55:27 +00:00
Benno Schulenberg
3b1750e982 nls: delete two compose sequences with an anomalous post-fixed breve
Two years ago, commit b126bfd7fe allowed using also a lowercase `u`
wherever an uppercase `U` was used to represent a breve.  But the
commit should have limited itself to only the prefixed uses of `U`,
as that is how most letters with a breve are composed.

Also, group the two compose sequences with an uppercase post-fixed `U`
together with the corresponding other post-fixed sequences.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-10-14 20:46:19 +00:00
Alan Coopersmith
701e9e9afb Use same pthread-stubs as libxcb
Avoid conflicts when libX11 calls libxcb and gets its pthread functions
overriding our ancient stubs.

v2: Keep linking with real threads libraries when thread safety
    constructor is enabled.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-08 13:00:52 -07:00
Thomas E. Dickey
1d11822601
fix a memory leak in XRegisterIMInstantiateCallback
Analysis:

    _XimRegisterIMInstantiateCallback() opens an XIM and closes it using
    the internal function pointers, but the internal close function does
    not free the pointer to the XIM (this would be done in XCloseIM()).

Report/patch:

    Date: Mon, 03 Oct 2022 18:47:32 +0800
    From: Po Lu <luangruo@yahoo.com>
    To: xorg-devel@lists.x.org
    Subject: Re: Yet another leak in Xlib

    For reference, here's how I'm calling XRegisterIMInstantiateCallback:

    XSetLocaleModifiers ("");
    XRegisterIMInstantiateCallback (compositor.display,
                                    XrmGetDatabase (compositor.display),
                                    (char *) compositor.resource_name,
                                    (char *) compositor.app_name,
                                    IMInstantiateCallback, NULL);

    and XMODIFIERS is:

        @im=ibus

Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-10-04 19:03:48 -04:00
Alan Coopersmith
1f8fd7ff1c If thread-safety-constructor is enabled, link against pthreads not stubs
Only really makes a difference if pthreads is not in libc.

Fixes: #162

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2022-09-27 15:02:23 -07:00
Thomas E. Dickey
bfe5d2dd98 reduce compiler warnings with casts (no object change)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-11 15:53:47 +00:00
Thomas E. Dickey
926f2454bc use casts to reduce compiler warnings (no object change)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-11 15:53:47 +00:00
Mike FABIAN
dc553ff908 Remove KOI8-R character set from en_US.UTF-8/XLC_LOCALE
https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/src/xlibi18n/lcCT.c#L58
has no escape sequence for KOI8-R.
That makes Xutf8TextListToTextProperty() sometimes fail when trying to
convert to COMPOUND_TEXT and when the KOI8-R charset is tried.

This is the cause for this bug:

https://github.com/ibus/ibus/issues/2422

Removing the KOI8-R charset entry fixes the problem.

This commit also fixes a few wrong texts in comments.

Signed-off-by: Mike FABIAN <mfabian@redhat.com>
2022-09-10 19:30:13 +00:00
Adam Sampson
1c04ac5141 xkb: Fix off-by-one error in XKeycodeToKeysym
The code here that made indexes greater than 3 refer to XKB symbol
groups had an off-by-one error, so it would always leave out the symbol
that should have been at index 4. Rewrite the code to fix this and
simplify the logic a bit.

Signed-off-by: Adam Sampson <ats@offog.org>
2022-09-10 19:07:42 +00:00
Thomas E. Dickey
ddaacd2196
reduce compiler warnings for macros BufAlloc, Data and Data32 using casts
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-09-09 20:20:34 -04:00
Kirill Chibisov
62c3337d89 ximcp/imRm.c: allow XNSpotLocation with OnTheSpot 2022-09-08 22:50:30 +00:00
Alan Coopersmith
1272879074 gitlab CI: stop requiring Signed-off-by in commits
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-08-05 14:06:46 -07:00
David H. Gutteridge
38033b073f configure.ac: report thread safety constructor build status
Signed-off-by: David H. Gutteridge <david@gutteridge.ca>
2022-07-25 19:30:19 -04:00
Alan Coopersmith
9a90b3a63d doc: Document possible return values for XkbGetKeyboard()
Fixes: #160

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-15 22:35:49 +00:00
Alan Coopersmith
0beb0cf46a xkb: set num_keys when filling in keys in _XkbReadGetNamesReply()
Fixes: #160

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-15 22:35:49 +00:00
Jon Turney
487e9489d1 Fix Win32 build with -fno-common
/work/xorg/lib/libX11/src/XlibInt.c:1968: multiple definition of `_Xdebug_p'; .libs/globals.o:globals.c:(.bss+0xc): first defined here

Avoid redundant definition of _Xdebug_p in globals.c (which is under the
influence of _Xdebug being #defined to _Xdebug_p.

This appears to be an ancient hack to work around data exports resolving
to the address of the import stub, not the import. (See [1]).

(This is probably no longer needed or can be done in a better way, as
per the discussion under --enable-auto-import in the ld manpage.)

[1] https://cygwin.com/pipermail/cygwin-xfree/2001-May/004606.html

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2022-07-15 18:06:12 +00:00
Benno Schulenberg
35ad99fad2 nls: add four sequences for the Samogitian E with dot above and macron
These sequences each produce two code points: the E-with-dot-above and
a combining macron.  The XIM input method is required for this to work.

(Also add a missing comment for a Unicode block.)

This fixes issue #54.

Requested-by: Arns Udovīčė

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-07-15 17:58:35 +00:00
Benno Schulenberg
2732dd20cc nls: delete eight sequences that pointlessly mix upper and lower case
Typing a compose sequence requires some care -- surely the user is able
to either keep holding the Shift key or not touch it at all while typing
the sequence.  Also, compose sequences are not an infinite resource AND
take up space and time -- defining redundant ones is a waste.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-07-15 10:03:00 +02:00
Benno Schulenberg
ea3cc474e1 nls: add compose sequences for the double-struck capitals ℕ ℤ ℚ ℝ ℂ
This allows the user to type the symbols for the five number systems.

This fixes the reasonable part of issue #159.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-07-15 10:03:00 +02:00
Benno Schulenberg
95a03cde43 nls: delete some pointless and wrong compose sequences meant for Bépo
Fourteen years ago, commit 7302984642 added some four hundred compose
sequences for the benefit of the French Bépo layout.  But among these
four hundred there are several that use symbols that are not available
in the Bépo layout and are thus impossible to type.  Some of the used
symbols, like Ahook, Ehook and Ohook, are not even present in *any*
layout, making these sequences a dead weight in the Compose file.

The Amacron and Omacron are available only in the Latvian, Hawaiian,
and Maori layouts, and the Omacron also in the Silesian layout.  But
the Latvian layouts and the Hawaiian do not contain any dead keys.
Only in the Maori and Silesian layouts these sequences with Amacron
and Omacron could be typed, but that was not why they were added.

More importantly, as James Cloos noted in issue #54, sequences like
`<dead_abovedot> <amacron>` for generating `ǡ` (that is: the macron
above the dot) are questionable, as in compose sequences generally
the first accent typed is the uppermost in the composed character.

Reference:
  https://gitlab.freedesktop.org/xorg/lib/libx11/-/issues/54#note_17321

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-07-14 12:31:52 +02:00
Matthieu Herrb
9702b83686 Mention that the predicate function is called with the display lock
Signed-off-by: Matthieu Herrb <matthieu@herrb.eu>
2022-07-01 11:13:13 +02:00
Benno Schulenberg
a5d00f889f docs: replace three placeholders with something that makes sense
Also, uncapitalize two arguments, to match the style of all others.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-06-24 16:23:14 +02:00
Benno Schulenberg
9ff8502040 docs: remove the unsightly dashes from the overviews of arguments
Seventeen months ago, commits 78027fdb7a and 4f15cfc645 removed
these dashes from two of the man pages.  Now, remove them all.
They are unhelpful and just make one wonder why they are there
(probably to function as improvised bullet points).

Also remove four leading spaces and a trailing comma.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-06-24 16:11:53 +02:00
Benno Schulenberg
a7968c47e3 docs: hard-wrap some items so that Table 2 fits within 80 characters
(Table 1 hard-wraps the first-column items in the same way.)

Also, correct the formatting of the subsequent paragraph.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-06-23 16:11:23 +02:00
Benno Schulenberg
c601c779ca nls: delete compose sequences that mix top-row digits with numpad digits
Compose sequences for circled numbers, like ⑫  or ㉑, are nice to have,
but allowing them to be composed by typing one digit on the top row and
the other on the numerical keypad (or the other way around) is over the
top.  Remove these absurd sequences.  Keep only the sequences where both
digits are either on the top row or on the numerical keypad.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
2022-06-15 11:02:08 +02:00
Alan Coopersmith
3a30ada60c
libX11 1.8.1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-08 17:41:46 -07:00
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