Don't beep when modifiers are released in entries.
This was an inadvertent change that snuck in with
the emoji support.
Also, don't beep while entering an emoji name.
There is entirely too much beeping here.
This commit adds some basic support for entering emoji by name
to GtkIMContextSimple. To begin an emoji sequence, use Ctrl-Shift-e
instead of Ctrl-Shift-u that is used for hex input. Otherwise, the
behavior is the same: you can can let go of the modifier keys and
end the sequence with space or enter, or hold on to the modifier
keys and end the sequence by releasing them.
Only a limited, fixed set of names is supported at this time, see
the GtkIMContextSimple docs for a full list.
Pick the W32 API for possible deadkey+<something> combinations
and prefer these to other sources of deadkey combos.
Specifically, if W32 API supports at least one combo for a particular
deadkey, only use that data and do not attempt to do other, unsupported
combinations, even if they make sense otherwise.
This is needed to, for example, correctly support US-International
keyboard layout, which produces a combined character for <' + a>
combo, but not for <' + s>, for example.
This is achieved by stashing all the deadkeys that we find in
an array, then doing extra loop through all virtual key codes and
trying to combine them with each of these deadkeys. Any combinations
that produce a single character are cached for later use.
In GTK Simple IM context, call a new GDK W32 function to do a lookup
on that cached combination table early on, among the "special cases"
(which are now partially obsolete).
A limitation of this code is that combinations with more than
one deadkey are not supported, except for combinations that consist
entirely of 2 known deadkeys. The upshot is that lookups should
be relatively fast, as deadkey array stays small and the combination
tree stays shallow.
Note that the use of ToUnicodeEx() seems suboptimal, as it should
be possible to just load a keyboard library (KBD*.DLL) manually
and obtain and use its key table directly. However, that is much more
complicated and would result in a significant rewrite of gdkkeys-win32.
The code from this commit, though hacky, is a direct addition to
existing code and should cover vast majority of the use-cases.
https://bugzilla.gnome.org/show_bug.cgi?id=569581
Since a41f02f9b1, GtkIMContextSimple
uses threads to load X Compose files. It does that every time a new
im context object is initialized, so we can easily end up with multiple
threads accessing the shared global_tables list at the same time.
Use a lock to prevent that.
https://bugzilla.redhat.com/show_bug.cgi?id=1276432
Only use the hard-coded build-time path given by X11_PREFIX on X11 and
Wayland where a X11 package is normally available. On other platforms,
get the datadir of the running system and mimic the behavior by
constructing the path dynamically. This avoids hardcoding the path for
searching for compose tables where we want to have relocatability.
This fixes the build on Windows/MSVC as well, where we don't normally have
any X11 packages available.
https://bugzilla.gnome.org/show_bug.cgi?id=757984
fr(bepo) XKB keymap sends dead_stroke with AltGr+l keys
and gtk-im-simple-context should send '/' with
dead_stroke+dead_stroke keys but gtkimcontextsimpleseqs.h
was not sorted in the descending order and failed to get
dead_stroke.
Also need to add dead_currency for Shift+AltGr+e and
dead_belowcomma for Shift+AltGr+Cedilla.
https://bugzilla.gnome.org/show_bug.cgi?id=736250
Turn dead_doubleacute plus space into '"' and not into a double
acute because that's the way to enter double quotes on the
US-International keyboard layout.
(cherry picked from commit 71164e57b9)
When switching to the compact table format, we inadvertedly lost
the 'tentative match' handling which allows to complete longer
compose sequences even if a prefix is a complete sequence.
This was pointed out in bug 666710.
in gtkimcontextsimple and gtktreeview, which are the easy places,
but also true bugfixes, because on OSX we can't use the virtual META
here, we needs MOD2 as delivered in key events.
This change does not introduce any functionality change, mostly
cosmtic cleanups, like re-linebreak when introduced annotations messed
up indentation or whitespace errors fixes.
We lookup a widget to call a function on GtkWidget that ends up just
performing an operation directly on the GdkWindow again anyway
(beeping). There's already fallback code at the point of the call that
does exactly that anyway, so just do that all of the time.
The keysyms create a lot of potential namespace conflicts for
C, and are especially problematic for introspection, where we take
constants into the namespace, so GDK_Display conflicts with GdkDisplay.
For C application compatiblity, add gdkkeysyms-compat.h which uses
the old names.
Just one user in GTK+ continues to use gdkkeysyms-compat.h, which is
the gtkimcontextsimple.c, since porting that requires porting more
custom Perl code.