Commit Graph

70539 Commits

Author SHA1 Message Date
Matthias Clasen
87e2a02e0c composetable: Rewrite Compose files if necessary
Apply heuristics to avoid breaking users existing configurations
with the change to not always add the default sequences.

If we find a cache that was generated before 4.4, and the Compose
file does not have an include, and doesn't contain so many sequences
that it is probably a copy of the system one, we take steps to keep
things working, and thell the user about it.
2021-07-15 09:30:09 -04:00
Matthias Clasen
264d592012 composetable: Keep the number of sequences
And print it out in tests.

Update all tests for this.
2021-07-15 09:30:01 -04:00
Matthias Clasen
0ad5094119 Remove some leftover debug code 2021-07-15 09:30:01 -04:00
Benjamin Otte
67952a9142 Merge branch 'wip/otte/for-master' into 'master'
rendernodeparser: Don't use %g when writing file

See merge request GNOME/gtk!3752
2021-07-14 18:46:36 +00:00
Benjamin Otte
ca3d942b9b rendernodeparser: Remove leftover debug prints 2021-07-14 20:19:40 +02:00
Benjamin Otte
5470a1344d rendernodeparser: Don't use %g when writing file
%g is locale dependent and can add "," where "." should be. Use
string_append_double() instead.
2021-07-14 20:18:44 +02:00
Matthias Clasen
4390f8102b imcontext: Improve the docs
Add more details about supported input methods.
2021-07-13 22:03:23 -04:00
Matthias Clasen
92129a2011 imcontext: Simplify checking compose seqs
Add the builtin table to the list of tables, and
remove the duplicated code that checks builtin
sequences separately.
2021-07-13 22:03:23 -04:00
Matthias Clasen
54dffa07f3 composetable: Drop GtkComposeTableCompact
All tables use the compact format now, and we generate
caches in that format too. Bump the cache version to 3
for this.

Replace the python script for generating the builtin table
by a small C program using the same code to generate the data
for the builtin table. This drops the restriction on only
generating a single character in the builtin sequences.
2021-07-13 22:03:23 -04:00
Matthias Clasen
1cff4bb27a composetable: Ignore length 1 sequences
It turns out that the X11 Compose file has some
length 1 sequences which are not interesting to us.
2021-07-13 22:02:33 -04:00
Matthias Clasen
8087250476 imcontext: Replace the builtin sequences
When we find a Compose file, replace the builtin
sequences with the table we found. This matches the
semantics described in Compose(5), and makes it possible
to drop unwanted sequences from the builtin table.

It is slight change of behavior for users with existing
Compose files. To match the previous behavior, you have
to add

include "%L"

to your Compose file, to keep the builtin sequences in
addition to your own.
2021-07-13 22:02:33 -04:00
Matthias Clasen
485dc052ca composetable: Allow removing sequences
Interpret an empty string as value in the Compose
file to mean: Remove this sequence.

Tests included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
45d39c2802 composetable: Switch to using a hash table
This lets us naturally replace matching sequences
while parsing. That means that the semantics are now
"last one wins" if the parser sees multiple entries
for the same sequence.

Add a testcase that checks the new replacement semantics.
2021-07-13 22:02:33 -04:00
Matthias Clasen
3b4b1c6878 composetable: Reinterpret %L
When we see include "%L" in a Compose file, use the
builtin sequences. We no longer filter out duplicates
wrt. to the builtin sequences.
2021-07-13 22:02:33 -04:00
Matthias Clasen
ff4f07d76f composetable: Handle substitutions in includes
Hande the %H, %L, %S substitutions that are described
in Compose(7).

Test included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
fb6c8cd466 composetable: Handle includes
This adds the mechanics for parsing include lines in
Compose files. We do detect and prevent cycles.

Tests included.
2021-07-13 22:02:33 -04:00
Matthias Clasen
8464b0484f composetable: Move code into the parser
This is just code reshuffling.
2021-07-13 22:02:33 -04:00
Matthias Clasen
bee58fd09d composetable: Introduce a parser struct
This will be used in the following commits to
beef up Compose file parsing.
2021-07-13 22:02:33 -04:00
Matthias Clasen
d25557a5ef Clean up the GtkComposeTable api
Keep the list of composetables private to GtkIMContextSimple,
and just have an api that creates new GtkComposeTables, either
from a file or from data.

Update tests to use the new api.
2021-07-13 22:02:33 -04:00
Matthias Clasen
da3ca6604b gtk-demo: Add a slider to the menu example
This is a fun way to show that we can scale fast.
2021-07-13 22:02:33 -04:00
Matthias Clasen
74cba6c3b2 Add a simple Javascript example
This shows how to use a layout manager in a widget,
implemented in javascript. The example sets up the
environment for running from the toplevel dir, assuming
that the build dir is called 'build'.
2021-07-13 22:02:33 -04:00
Emmanuele Bassi
c09718b731 Merge branch 'doc-fixes' into 'master'
doc: Syntax fixes

See merge request GNOME/gtk!3751
2021-07-13 23:43:06 +00:00
Marco Melorio
eacfa2a966 doc: Syntax fixes 2021-07-13 22:53:19 +00:00
Matthias Clasen
e7f228e240 Merge branch 'fp16-tests' into 'master'
ngl: Make the C half-float implementation accessible

See merge request GNOME/gtk!3748
2021-07-13 13:38:21 +00:00
Matthias Clasen
fab82a7c25 tests: Add some fp16 tests 2021-07-13 09:03:49 -04:00
Matthias Clasen
fc9c34897a ngl: Make the C half-float implementation accessible
Make this accessible for tests.
2021-07-13 09:03:49 -04:00
Emmanuele Bassi
28cdd3f497 Merge branch 'gi-fixes' into 'master'
Various introspection fixes

See merge request GNOME/gtk!3747
2021-07-13 11:21:20 +00:00
Marc-André Lureau
a009e26e95 gtk: fix GtkPasswordEntryBuffer introspection
Move the source file to public_sources list, and fix tag annotation.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-13 15:03:09 +04:00
Marc-André Lureau
ab908c23f4 Add GtkMenuButton:primary Since: annotation
Property added in commit a74420bc1a.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-13 11:31:09 +04:00
Marc-André Lureau
ae21f66fe5 Add GTK_DEBUG_ICONFALLBACK Since: 4.2 annotation
Introduced in commit 6f82408056.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-13 11:26:39 +04:00
Rafael Fontenelle
2d092ea280 Update Brazilian Portuguese translation
(cherry picked from commit c7a7fc4de6)
2021-07-10 19:30:32 +00:00
Rafael Fontenelle
0f9d39cdfd Update Brazilian Portuguese translation
(cherry picked from commit 72c3026764)
2021-07-10 17:14:31 +00:00
Matthias Clasen
a64087d481 Merge branch 'activatable-buttons' into 'master'
menubutton: Make menu buttons activatable again

Closes #4079

See merge request GNOME/gtk!3728
2021-07-10 12:59:39 +00:00
Matthias Clasen
c85f3f4942 Merge branch 'wip/chergert/fix-4094' into 'master'
joinedmenu: add helper to join menus instead of nesting

Closes #4094

See merge request GNOME/gtk!3739
2021-07-09 19:29:41 +00:00
Matthias Clasen
d7553279ff Merge branch 'gdkkeys-m' into 'master'
[master] gdkkeys-win32.c: fix initialisation of key_state in update_keymap

See merge request GNOME/gtk!3742
2021-07-09 10:58:23 +00:00
Matthias Clasen
c86631b8a9 Merge branch 'dynamic-typelib-path' into 'master'
build: Get typelib dir dynamically using gobject-introspection dependency

See merge request GNOME/gtk!3737
2021-07-09 10:57:37 +00:00
Matthias Clasen
c1af63de9b Merge branch 'invisible-char-fix' into 'master'
textbtree: Initialize to zero the tags counting array

See merge request GNOME/gtk!3740
2021-07-09 10:56:51 +00:00
Jeremy Tan
2784b03b2d gdkkeys-win32.c: fix initialisation of key_state in update_keymap
It apparently worked by chance in the past, but now causes e.g.
alphanumeric characters to be interpreted as half-width katakana
when using the Japanese IME.
2021-07-09 12:46:49 +08:00
Marco Trevisan (Treviño)
10bdf8c645 textbtree: Initialize to zero the tags counting array
We're using the tag contents array to count the number of invisible tags
set but we always increase it without being initialized.

This may lead to unexpected behavior when traversing them and it's
causing a reliable failure in the textiter tests under s390x.

So, memset that area content to 0 once allocated. It's not needed to do
the same for the tags themselves as we always assign them.

 Conditional jump or move depends on uninitialised value(s)
   at 0x4CFAA00: _gtk_text_btree_char_is_invisible (gtktextbtree.c:2569)
   by 0x4B8A1BB: find_visible_by_log_attrs (gtktextiter.c:3244)
   by 0x10E93D: check_backward_visible_word_start (textiter.c:484)
   by 0x10E93D: test_visible_word_boundaries (textiter.c:523)
   by 0x533288F: g_test_run_suite (in /usr/lib/s390x-linux-gnu/libglib-2.0.so.0)
   by 0x53328E7: g_test_run (in /usr/lib/s390x-linux-gnu/libglib-2.0.so.0)
   by 0x109CC1: main (textiter.c:807)
2021-07-09 03:48:40 +02:00
Christian Hergert
d63d9b2319 joinedmenu: add helper to join menus instead of nesting
In many cases, we have an "extra-menu" property that is used to allow
applications to join menus into the native menu for the widget. Previously,
this was done by nesting that menu in a section.

Doing so increases the complexity of the rules for GtkMenuTracker as you
may want different handling from inside of the section vs toplevel
sections.

If instead we synthetically glue the menus together, we have a much more
natural joining of menus as the application developer would expect for
their menu.

This also ports GtkLabel, GtkText, GtkPasswordEntry, and GtkTextView to
use the joined menu helper.

The joined menu helper comes originally from GNOME Builder and has had
extensive use there.

Fixes #4094
2021-07-08 14:16:06 -07:00
Marco Trevisan (Treviño)
d5f2b69d0c build: Get typelib dir dynamically using gobject-introspection dependency
We hardcoded the typelib directory for only an arch (and a distro),
while we can just get it from gobject-introspection pkg config if tests
are enabled.
2021-07-08 04:59:10 +02:00
Matthias Clasen
6818eee859 Merge branch 'wip/exalm/scroll-touch' into 'master'
scrolledwindow: Don't check drag threshold when already scrolling

See merge request GNOME/gtk!3735
2021-07-07 21:37:58 +00:00
Matthias Clasen
e7f1398d85 Merge branch 'text-cursor-extents' into 'master'
text: Add API to compute cursor extents

See merge request GNOME/gtk!3734
2021-07-07 21:37:14 +00:00
Matthias Clasen
880c01f8cc Merge branch 'wl-since' into 'master'
Add missing "Since: 4.X" doc tags

See merge request GNOME/gtk!3736
2021-07-07 21:36:13 +00:00
Marc-André Lureau
337c5e5e59 Add missing "Since: 4.X" tags
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-07-07 23:35:38 +04:00
Florian Müllner
af52ea78c6 text: Add API to compute cursor extents
The extents that correspond to the strong/weak cursor at a given
character position can be used for example to point a popover to
text in the widget.
2021-07-07 19:33:12 +02:00
Alexander Mikhaylenko
fe633d9ef9 scrolledwindow: Don't check drag threshold when already scrolling
Checkout the drag threshold only makes sense when starting a scroll, after
that it just adds jumps when trying to scroll back and forth.
2021-07-07 19:39:06 +05:00
Matthias Clasen
e6cce283a7 Merge branch 'matthiasc/for-master' into 'master'
gtk-demo: Add a slider to the menu example

See merge request GNOME/gtk!3733
2021-07-06 00:23:30 +00:00
Matthias Clasen
c920236c54 gtk-demo: Add a slider to the menu example
This is a fun way to show that we can scale fast.
2021-07-05 19:31:54 -04:00
Matthias Clasen
6f86b4d220 Merge branch 'js-example' into 'master'
Add a simple Javascript example

See merge request GNOME/gtk!3731
2021-07-05 20:24:30 +00:00