Commit Graph

39282 Commits

Author SHA1 Message Date
Christian Hergert
2fa9f934b6 a11y: return -1 if parent is NULL 2021-12-14 21:18:13 +01:00
Emmanuele Bassi
3f7122b3d2 Add a boxed GType for GtkBitsetIter
This way language bindings have a chance at managing the memory of
GtkBitset iterators.

Fixes: #4543
2021-12-14 15:51:13 +00:00
Matthias Clasen
c5bffb9fb5 builder: Drop empty text chunks when precompiling
These don't add any value either.
2021-12-14 01:21:06 -05:00
Matthias Clasen
c7afa5452b builder: Drop irrelevant whitespace in precompile
Drop text nodes that won't contribute to the end result.
This gets rid of a lot of text nodes in the replay.
2021-12-14 00:35:35 -05:00
Garrett Regier
fcb6adaaaa builder: Use g_slice_free_chain() for strings in precompile 2021-12-13 23:44:02 -05:00
Garrett Regier
9c12b58e32 builder: Remove root special case from precompile 2021-12-13 23:44:02 -05:00
Garrett Regier
6c8b505f93 builder: Avoid g_hash_table_get_values() in precompile
Embed the GList link in the RecordDataString.
2021-12-13 23:44:02 -05:00
Garrett Regier
8b228e7471 builder: Use a flexible array for attributes in precompile 2021-12-13 23:44:02 -05:00
Garrett Regier
4ce07f41ca builder: Reduce memory usage in precompile
Split the Element and Text nodes into separate structures.
2021-12-13 23:44:02 -05:00
Garrett Regier
1bfd0e5e38 builder: Use a GQueue in precompile
This avoids g_list_last() and
embeds the GList link in the RecordDataTree.
2021-12-13 23:44:02 -05:00
Garrett Regier
b962d37f79 builder: Use a reasonable default string size in precompile 2021-12-13 23:44:02 -05:00
Garrett Regier
c6ecf02a07 builder: Embed text length in precompile 2021-12-13 23:44:02 -05:00
Garrett Regier
8b7d4b423c builder: Combine attribute name and value allocations 2021-12-13 23:44:02 -05:00
Garrett Regier
83dc126565 builder: Use a string chunk for precompile
Also use an explicit length and avoid g_strndup().
2021-12-13 23:44:02 -05:00
Garrett Regier
f2d3d7e710 builder: Avoid double string lookup in precompile 2021-12-13 23:44:02 -05:00
Matthias Clasen
f991428cb9 builder: Use GMarkup properly
We must call end_parse to ensure we get errors
for incomplete documents.
2021-12-13 23:42:47 -05:00
Matthias Clasen
da6f86bd79 colorbutton: No nested drag sources, please
This is causing trouble on X11.
2021-12-12 22:23:31 -05:00
Matthias Clasen
42fd499af4 dragicon: Make color icons work in X11
We need to disable the DND support in
GtkColorSwatch completely for this to work
in X11.
2021-12-12 22:09:28 -05:00
Matthias Clasen
de5b88477a colorswatch: Make drag source optional
When using a colorswatch as a drag icon,
this can get in the way, so make it optional.
2021-12-12 22:09:16 -05:00
Matthias Clasen
df025fcb88 dragicon: Provide default icons for more types
Provide default icons for paintables and files.
This is easy to do, and makes sense.

fixup drag icon
2021-12-12 21:29:36 -05:00
Matthias Clasen
bbb1404bd3 dragicon: No events, please
We run into trouble on X11 if the widgets
in the drag icon have drop targets attached.
Prevent this by suppressing event delivery
to drag icons outright.
2021-12-12 21:28:34 -05:00
Matthias Clasen
dbe5e57b8e inspector: Show more datatypes for the clipboard
It is easy enough to show colors, files and pixbufs.
2021-12-12 18:36:58 -05:00
Matthias Clasen
9a872f059f droptarget: Improve the docs
Add the signal connection to the example.
2021-12-12 16:27:36 -05:00
Matthias Clasen
e72df9cd5f docs: Small improvement
I could not find the attributes of the <binding>
element mentioned anywhere in the docs.
2021-12-12 09:03:11 -05:00
Benjamin Otte
4cd0a39794 Merge branch 'wip/otte/inspector' into 'main'
inspector: Add a clipboard page

See merge request GNOME/gtk!4237
2021-12-11 22:46:30 +00:00
Benjamin Otte
600ab5ba5f inspector: Add a clipboard page
Shows all the formats supported by the clipboard (and primary clipboard)
and allows displaying them (by potentially downloading them)
2021-12-11 23:01:42 +01:00
Matthias Clasen
66910ed998 Restore the GtkTextchild abi
Move the new chars field to a private struct.

Fixes: #4531
2021-12-11 10:58:58 -05:00
Matthias Clasen
79375dd7dd Merge branch 'fix-printer-enumeration' into 'main'
Fix dialog-less printing

Closes #4439

See merge request GNOME/gtk!4215
2021-12-10 18:01:59 +00:00
Matthias Clasen
0bf87281e0 Merge branch 'missing-since-tag' into 'main'
Add a missing since tag

See merge request GNOME/gtk!4229
2021-12-10 17:15:32 +00:00
Matthias Clasen
2d062fedd9 Add a missing since tag
gtk_text_child_anchor_new_with_replacement was
recently added.
2021-12-10 11:26:46 -05:00
Matthias Clasen
c6a68f3de2 Fix dialog-less printing
We were sometimes ending printer enumeration prematurely,
and the code was confused about the meaning of found_printer.

The new setup follows these rules:
- We *only* end the search prematurely if found_printer
  is set, which indicates that we found the right printer
- We *always* call find_printer_idle exactly once, and
  make it return less than perfect matches like the
  default printer, or the first printer we found

Fixes: #4439
2021-12-10 11:26:23 -05:00
Jakub Steiner
d74e62886c selections: have unfocused state
- text selections for unfocused elements - textview, label, entry,
  spinbutton

fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4393
2021-12-10 12:00:12 +01:00
Jakub Steiner
d8505f09eb Revert "styling: Have unfocused selections"
This reverts commit 96f63a6bf3.
2021-12-10 11:36:10 +01:00
Christian Hergert
99a8202015 macos: fix crash in imcontextquartz 2021-12-09 12:26:33 -08:00
Benjamin Otte
17c903e246 Merge branch 'fix-picture-natural-size-0' into 'main'
picture: Return natural size 0 for size 0

See merge request GNOME/gtk!4177
2021-12-08 19:33:28 +00:00
Ivan Molodetskikh
7ef54e9c53 picture: Return natural size 0 for size 0
It was returning the full natural size (same as -1) due to default value
handling in the code below.

Tests have been updated to match this output.
2021-12-08 19:20:24 +01:00
Matthias Clasen
12bb700c62 Merge branch 'wip/chergert/fix-recursive-action-muxer' into 'main'
actionmuxer: avoid duplicate and recursive work

Closes #4422, #4519, and gnome-text-editor#220

See merge request GNOME/gtk!4223
2021-12-08 10:47:40 +00:00
Christian Hergert
d1aec0c3f1 actionmuxer: avoid duplicate and recursive work
If we've already done the tracking into the parent muxer, there is no need
to do it again. This can save a great deal of recursive work when adding
items to the muxer.

This makes showing the context menu in gnome-text-editor repeatedly fast
even as spelling corrections are changed.

It is likely that this could fix #4422 as well.

Fixes #4519
Fixes https://gitlab.gnome.org/GNOME/gnome-text-editor/-/issues/220
2021-12-08 00:32:36 -08:00
Christian Hergert
00d5f72d6e menutracker: reduce allocations and signal emission
When handling action-added callbacks the code was previously using a
freeze_notify/thaw_notify in all cases. This turns out to allocate a
significant amount of memory when called a lot.

That said, it shouldn't be getting called this much but given the current
state of affairs elsewhere in GtkActionMuxer, this brought temporary
allocations down from 9MiB to 9KiB in gnome-text-editor after showing
the context menu a few times.

Related #4422
2021-12-07 22:42:04 -08:00
Benjamin Otte
ce7b0656c0 viewport: Allocate properly
Instead of allocation width for height for width for height or whatever
that code was doing, actually allocate the size we were given or the
requested size, whatever is larger.
2021-12-08 00:12:35 +01:00
Benjamin Otte
fd0d360f9b Revert "viewport: Actually report the size we're gonna allocate"
This reverts commit b8468af411.
2021-12-07 23:52:21 +01:00
Benjamin Otte
b8468af411 viewport: Actually report the size we're gonna allocate
Don't just pass on measure() calls, but actually behave in the way we
behave during size allocate.

This should improve cases where GtkScrolledWindow is used with GTK_POLICY_NEVER.
2021-12-07 21:58:42 +01:00
Benjamin Otte
9fd7e319f3 viewport: Use array for member variables
That way we can index them by orientation in future commits.
2021-12-07 21:58:42 +01:00
Benjamin Otte
b9d4da9cfe gtktypes: GTK_INVALID_LIST_POSITION should be an int
GListModel uses guint, so the macros we define for it should match that.

Related: !3738
2021-12-07 16:15:17 +01:00
Emmanuele Bassi
5bf5b58eb3 Merge branch 'gi-const' into 'main'
gtk: fix GTK_INVALID_LIST_POSITION type

See merge request GNOME/gtk!3738
2021-12-07 14:22:40 +00:00
Carlos Garnacho
ce1b970b46 gtkimcontextwayland: Set a higher IO extension priority
We want this to take precedence in the wayland platform to other
modules that might be loaded via the IO extension point. None of
those is going to bode well in this platform.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4443
2021-12-04 00:21:53 +01:00
Matthias Clasen
ceb77d6100 Merge branch 'wip/hadess/listbox-fixes' into 'main'
listbox: Explain behaviour of GtkListBoxCreateWidgetFunc

See merge request GNOME/gtk!4194
2021-12-03 23:05:13 +00:00
Matthias Clasen
02579a1333 Merge branch 'wip/chergert/inspector-im-module' into 'main'
inspector: add im-module

Closes #4512

See merge request GNOME/gtk!4214
2021-12-03 22:51:32 +00:00
Matthias Clasen
2f7fa10434 Merge branch 'textview-im-surrounding' into 'main'
textview: Provide more context to input methods

See merge request GNOME/gtk!4209
2021-12-03 20:26:54 +00:00
Christian Hergert
6be352f446 inspector: add im-module
This adds a new row to the Global/Information section which displays the
GTK im-module that is likely to be in use unless changed by an application.
It responds to updates of GtkSettings:gtk-im-module unless the
GTK_IM_MODULE environment variable is set.

Fixes #4512
2021-12-03 12:11:25 -08:00