Commit Graph

73775 Commits

Author SHA1 Message Date
Alexander Mikhaylenko
52f7afeecd builderparser: Don't exit too early on nested custom tags
Currently nested custom tags work only as long as the element names differ
from the root one. If it's same, for example:

<condition type="any">
  <condition type="max-width">600</condition>
  <condition type="max-height">600</condition>
</condition>

then it will fail. Meanwhile the same tags wrapped into <conditions> would
work.

The problem is that custom tag parsing is considered finished as soon as we
encounter a closing tag with the same element name. So instead, track the
nesting level.
2023-03-01 01:20:48 +02:00
Ivan Molodetskikh
370ab8aa52 widget: Reset alloc_needed_on_child before allocating children
Reset alloc_needed_on_child *before* allocating the children. This is
because some child's size_allocate() may call queue_allocate(), which
will bubble up alloc_needed_on_child. An example of this happening is
with GtkScrollable implementations, which are supposed to configure
their adjustments in size_allocate(), which will cause GtkScrollbar's
GtkRange to notice and queue_allocate() on itself.

If we reset alloc_needed_on_child after this happens, then our children
will have a lingering alloc_needed_on_child and will not receive an
allocation.

This commit fixes widgets occasionally losing an allocation when this
scenario happens.
2023-03-01 01:20:17 +02:00
Matthias Clasen
08479ae4b2 text: Make editable API irreversible
Programmatic changes to the entry contents should
not become part of the undo history.

Sadly, the editable implementations are also used
in the code paths that we use for user-initiated changes,
so we have to be careful to only set them as
irreversible if we are not already in a user action.

Fixes: #5622
2023-03-01 01:19:54 +02:00
Matthias Clasen
45d6ffcce8 text: Fix disabling of history
Keep a separate boolean for enable-undo, and
disable the history if it is false, or the entry
is not using visible text, or isn't editable.

Related to: #5622
2023-03-01 01:19:34 +02:00
Lukáš Tyrychtr
f3b09a8725 GtkNotebook: Improve the labels of notebook pages for a11y 2023-03-01 01:18:05 +02:00
Matthias Clasen
d6d5a22306 filechooser: Fix paned limits
The intention of the ui file was to not let
the paned shrink both children down to nothing,
but using <child> for the children effectively
overrides the setting of the shrink properties.
Fix that by using child properties instead of
<child>.
2023-03-01 01:17:50 +02:00
Carlos Garnacho
512dec54d3 gdk/x11: Also grab keyboard during XDnD grabs
The drag source must handle events and messaging, this also
includes keyboard handling for accessibility and cancellation.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5604
2023-03-01 01:15:26 +02:00
Alexandros Theodotou
5cf5b9c7f5 Remove timeout when disposing GtkEditableLabel
Fixes: #5584
2023-03-01 01:11:46 +02:00
Matthias Clasen
c4ddf47d8f placessidebar: Make all rows ellipsize
Otherwise, we end up with a single long row
pushing the content of all the other rows
off to the left, which is much worse than
ellipsizing.

Fixes: #4710
2023-03-01 01:10:38 +02:00
Arjan Molenaar
fb36c167e1 wayland: Fix button mask for button 2 and 3
Wayland and GTK order mouse button 2 and 3 differently.

Fixes #5561.
2023-03-01 01:09:24 +02:00
Arjan Molenaar
d221d314b5 Allow all mouse buttons to be used for the drawingarea demo
So we can test if the drag gesture works with all mouse buttons.
2023-03-01 01:09:10 +02:00
Matthias Clasen
069fef6f99 passwordentry: Fix an asymmetry
When connecting a signal in realize,
we should disconnect in unrealize.

Fixes: #5285
2023-03-01 01:06:14 +02:00
Matthias Clasen
5caecf16ac tooltip: Prevent too-wide tooltip windows
Set the label to expand, so it actually fills
the width that we allocated for it, instead
of shrinking back to the minimum width for
its height.

Fixes: #5521
2023-03-01 01:05:45 +02:00
Matthias Clasen
8203b69e74 tooltip: Don't play games with max-width-chars
Setting max-width-chars to the number of characters
in the string works ok only as long as the average
char width we get from Pango matches reality. Sadly
that seems not always the case, and this code was
causing short Chinese tooltips to always be broken
into two lines.

Fixes: #4470
2023-03-01 01:05:27 +02:00
Sophie Herold
189c1dd306 scrolledWindow: Propagate event for no scrolling 2023-03-01 01:00:06 +02:00
Christian Hergert
a4512a4c95 istring: fix istring_prepend() on malloc transition
When transitioning from internal to malloc, the strings were placed in
the wrong order to g_strconcat(). This fixes an issue with undo where
if you hit the boundary in just the right way, your undo stack will do
unexpected things.

Fixes #5506
2023-03-01 00:53:03 +02:00
Corey Berla
ce01d7d7a3 gtkmodelbutton: Ensure that accel label is always aligned to end
When the model button just has a text label and accel text,
the button fills and the accel label is implicitly aigned to end.
When there's also a icon, even though it's not shown (because
icons are only shown if there's no text), the button doesn't fill
and the accel ends up not aligned (assuming one of the other buttons
is longer). Ensure that the accel label is aligned to the end.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5504
2023-03-01 00:51:30 +02:00
Barnabás Pőcze
a4758db75e a11y: Use fallback logic when GApplication has no DBus object path
Use the fallback logic to generate the base path for the GtkAtSpiRoot
if the GApplication has no DBus object path to guarantee that
the base path will not stay NULL.
2023-03-01 00:51:00 +02:00
Barnabás Pőcze
6a991cf05a a11y: Check if path is NULL when removing from cache
`gtk_at_spi_cache_add_context()` checks if the GtkAtSpiContext's path
is NULL before inserting the context object into the hash table.
Do the same in `gtk_at_spi_cache_remove_context()` to avoid a NULL
pointer dereference in `g_str_hash()` during the hash table lookup
if a context with NULL path is removed. That can happen when the
GtkAtSpiRoot::base_path is NULL, which, in turn, can happen if
`g_application_get_dbus_object_path()` returns NULL.

  ==394047==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7fd1966f8b84 bp 0x7fff11e3ded0 sp 0x7fff11e3de58 T0)
  ==394047==The signal is caused by a READ memory access.
  ==394047==Hint: address points to the zero page.
      #0 0x7fd1966f8b84 in g_str_hash (/usr/lib/libglib-2.0.so.0+0x37b84)
      #1 0x7fd1966f9c09 in g_hash_table_contains (/usr/lib/libglib-2.0.so.0+0x38c09)
      #2 0x7fd196062c10 in gtk_at_spi_cache_remove_context ../gtk/a11y/gtkatspicache.c:447
      #3 0x7fd19606e0a9 in gtk_at_spi_root_unregister ../gtk/a11y/gtkatspiroot.c:653
      #4 0x7fd196067f58 in gtk_at_spi_context_unrealize ../gtk/a11y/gtkatspicontext.c:1559
      #5 0x7fd195ced97f in gtk_at_context_unrealize ../gtk/gtkatcontext.c:668
      #6 0x7fd195f5576e in gtk_widget_unroot_at_context ../gtk/gtkwidget.c:2399
      #7 0x7fd195f55bd2 in gtk_widget_unroot ../gtk/gtkwidget.c:2499
      ...
2023-03-01 00:50:49 +02:00
robxnano
0c83807a5a filechoosernativewin32: Set default extension 2023-03-01 00:49:42 +02:00
Corey Berla
254eca269a calendar: Set marked days immediately
The marked days are set only as part of gtk_calendar_select_day().
This is insufficient, especially because the day-selected signal
is emitted after the marked days are set in gtk_calendar_select_day().
2023-03-01 00:48:05 +02:00
Corey Berla
a59bf6e3cc calendar: Only apply the marked_day to the current month
The marked day gets applied to the current month, and either the previous
or subsequent month if they are visible within the current month.
This doesn't make any sense and likely was an accidental regression
in a6f9052cf1.  Clarify the docs.
2023-03-01 00:47:36 +02:00
Corey Berla
b06294d5d7 calendar: Add css style for marked days
As part of a6f9052cf1, marked days lost
their style, essentially making that function worthless.  Previously,
they were simply bolded, but that doesn't give them proper justice.
2023-03-01 00:47:06 +02:00
Arjan Molenaar
3f9b7dd863 macos: Command should not come from gettext
Instead, just provide the right character.

See also
https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkaccelgroup.c#L916.
2023-03-01 00:45:27 +02:00
Arjan Molenaar
3b36459630 macos: Use Command key symbol for meta
Show the Apple Command symbol ⌘ as keyboard shortcut for the Meta key on macos,
similar to GtkAccelGroup.
2023-03-01 00:45:09 +02:00
Corey Berla
5c4f3a1943 gtkdroptarget: Notify value property on local drag
The value property is only getting notified when it's unset
or when it's set from gdk_drop_real_value_async().  Make sure
to always notify :value when its changed
2023-03-01 00:39:41 +02:00
Lukáš Tyrychtr
b53bd5b670 Don't present GTK class names to assistive technologies even as a fallback
A screen reader user is not interested in GTK internals, for example,
he does not care whether a button is an image button or not,
and a screen reader will report the fact that it is a button anyway.
Same applies for GtkEntry widgets, for example.

This actually is sufficient to fix gnome-control-center#2244.
And, according to the discussion in #5145, it should be fine.
2023-03-01 00:36:07 +02:00
Matthias Clasen
6257243574 Merge branch 'revert-font-chooser-filter-4-8' into 'gtk-4-8'
Revert "Fix an assertion in GtkFontChooserWidget when setting a filter."

See merge request GNOME/gtk!5568
2023-02-28 13:00:35 +00:00
Akira TAGOH
e18e99209e Revert "Fix an assertion in GtkFontChooserWidget when setting a filter."
Actually this filter hasn't ported to 4.8 branch and
the merge request GNOME/gtk!5514 has been accidentally merged.

This reverts commit f4768f16c8.
2023-02-28 21:42:00 +09:00
Matthias Clasen
8e9e32abaf Merge branch 'fix-font-chooser-filter-4-8' into 'gtk-4-8'
Fix an assertion in GtkFontChooserWidget when setting a filter.

See merge request GNOME/gtk!5514
2023-02-15 03:54:38 +00:00
Akira TAGOH
f4768f16c8 Fix an assertion in GtkFontChooserWidget when setting a filter.
(cherry-picked from commit 4532c3020b)
2023-02-14 15:12:52 +09:00
Matthias Clasen
790b9d59ad Merge branch 'cherry-pick-824e9833' into 'gtk-4-8'
[4.8.x] gdk/x11: Reset all scroll valuators on enter

See merge request GNOME/gtk!5480
2023-02-07 02:34:50 +00:00
Carlos Garnacho
37843ec941 gdk/x11: Reset all scroll valuators on enter
We no longer need to make much distinction between multiple logical
devices, plus it breaks esp. with the Xwayland input device distribution.
Just iterate across all devices and reset their scroll valuators.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4160


(cherry picked from commit 824e983372)
2023-02-04 11:37:01 -05:00
Sabri Ünal
1ef03e6eb8 Update Turkish translation 2023-01-15 22:43:19 +00:00
Matteo Percivaldi
1ff3a26c96 gtkcssanimatedstyle: Fix return of new_advance()
This was causing animation and transition to stop randomly and reset
their state to initial state.

This issue has existed since commit
7b68bdb831.

Closes #4426
2023-01-13 15:15:10 -05:00
Matthias Clasen
92ebf8ab13 fontchooser: Drop a few errant translations
No point in translating these properties, they
are not strings.

Fixes: #5146
2023-01-12 18:38:44 -05:00
Matthias Clasen
7169d346ec build: Use a stable harfbuzz
We don't need the latest harfbuzz.
Stick to 4.0 for now.
2023-01-12 18:37:50 -05:00
Matthias Clasen
162b061ad2 Merge branch 'cherry-pick-e7f798dc' into 'gtk-4-8'
[4.8 cherry-pick] gdk/surface: Handle clicks outside client surfaces

See merge request GNOME/gtk!5373
2023-01-11 18:14:03 +00:00
Emin Tufan Çetin
83284e6a9d Update Turkish translation 2023-01-11 06:59:32 +00:00
Sabri Ünal
4a38d5d1d5 Update Turkish translation 2023-01-11 05:31:28 +00:00
Matthias Clasen
a87b3f63ec Merge branch 'cherry-pick-b4db4893' into 'gtk-4-8'
Fix building `tests/mountoperation.c` on Windows (backport MR!5126 to gtk-4-8)

See merge request GNOME/gtk!5408
2023-01-09 10:58:46 +00:00
Matthias Clasen
66091f8139 Merge branch 'fix-windows-build-testmountoperation' into 'main'
tests/testmountoperation.c: Fix build on Windows

See merge request GNOME/gtk!5126

(cherry picked from commit b4db48935d)

1a5a65ac tests/testmountoperation.c: Fix build on Windows
2023-01-09 05:08:56 -05:00
Matthias Clasen
46eebcb2ac Merge branch 'cherry-pick-188f9269' into 'gtk-4-8'
Cherrypick to 4.8: listitemwidget: Setup factory only once the widget is visible

See merge request GNOME/gtk!5378
2023-01-07 15:06:05 +00:00
Nart Tlisha
1e27563425 Update Abkhazian translation 2023-01-05 12:23:44 +00:00
Benjamin Otte
2aaefd9ff6 Merge branch 'wip/corey/list-item-visible' into 'main'
listitemwidget: Setup factory only once the widget is visible

See merge request GNOME/gtk!5374

(cherry picked from commit 188f9269b7)

7ad693f8 gtkcolumnviewcolumn: Only create cells when the column is visible
2022-12-30 19:45:00 -05:00
Carlos Garnacho
826030dcc2
gdk/surface: Handle clicks outside client surfaces
The owner_events=TRUE grab makes GDK on X11 see events happening
outside every client window as received on the grab window.
Additionally check that the pointer is inside the grab window
(i.e. it received GDK_CROSSING_NORMAL crossing events for the
core pointer) in order to handle clicks happening outside client
windows.

These new paths are expected to be a no-op on Wayland, and to
also work for touchscreen input on X11, due to emulated pointer
events.
2022-12-29 13:21:07 +11:00
Matthias Clasen
748b68d58b Fix typo in NEWS 2022-12-22 23:05:37 -05:00
Matthias Clasen
74ed1b9e35 Post-release version bump 2022-12-22 14:12:14 -05:00
Matthias Clasen
793831af8a 4.8.3 2022-12-22 14:07:27 -05:00
Matthias Clasen
d51734d83b Merge branch 'cherry-pick-acd7d739' into 'gtk-4-8'
[4.8] GdkWin32: Fix resizes with native decorations

See merge request GNOME/gtk!5368
2022-12-22 18:41:22 +00:00