Commit Graph

73791 Commits

Author SHA1 Message Date
Matthias Clasen
ac5f95f856 Merge branch 'allocation-fixes-4-8' into 'gtk-4-8'
[4.8] Backport size allocation fixes

See merge request GNOME/gtk!5635
2023-03-10 23:41:30 +00:00
Matthias Clasen
6af8a31893 widget: Skip popovers in allocation
Native widgets get allocated via their surface,
so can skip them here. This avoids criticals when
re-mapping a popover for the second time, as can
be seen e.g. in the 'Selections' demo in gtk4-demo.
2023-03-11 00:17:00 +02:00
Matthias Clasen
4e0633a6ef widget: Stop propagating alloc_needed beyond popovers
This should not be necessary, since popovers get
their new size from present_popup via the compositor.
2023-03-11 00:16:39 +02:00
Benjamin Otte
7b0c6b6c9c widget: Remove goto usage in widget_allocate() 2023-03-11 00:16:19 +02:00
Benjamin Otte
76c7602b92 widget: Split out gtk_widget_ensure_allocate_on_children()
allocate() should not be calling into ensure_allocate(), they do a similar job.
In the end, the code does the same work, but it should be easier to follow now.
2023-03-11 00:15:59 +02:00
Matthias Clasen
d671fdab7c widget: Simplify size allocation
Don't call ensure_allocate if we've just
done size_allocate. This makes criticals
from reshowing popovers go away.
2023-03-11 00:15:35 +02:00
Ivan Molodetskikh
fc4044bbce combobox: Avoid extra queue_resize()
width-request already ensures it's above the minimum width, so avoid an
extra queue_resize() when setting size request to (-1, -1).

This is the same way as GtkDropDown works. This also unbreaks
GtkComboBox after the recent allocation fix in
75a417e337.

Incidentally, this also makes GtkComboBox actually resize its popup as
intended (that was broken before).

I don't think this is ultimately the final fix, sometimes I still get
allocation warnings. But the proper fix will probably involve changing
some more allocation machinery around popovers. This is good enough for
now.
2023-03-11 00:14:12 +02:00
Marek Černocký
770e5460d2 Update Czech translation 2023-03-06 11:59:19 +00:00
Matthias Clasen
2c5784977a Merge branch 'revert-undo-4-8' into 'gtk-4-8'
[4.8] Revert "text: Make editable API irreversible"

See merge request GNOME/gtk!5578
2023-03-01 12:28:02 +00:00
Mat
6c88cc7215 Revert "text: Fix disabling of history"
This reverts commit 45d6ffcce8.
2023-03-01 14:06:16 +02:00
Mat
ea1bb79566 Revert "text: Make editable API irreversible"
This reverts commit 08479ae4b2.
2023-03-01 14:04:34 +02:00
Matthias Clasen
d0e3dc7ce0 Merge branch 'textbuffer-foreground-property-4-8' into 'gtk-4-8'
[4.8] textbuffer: Use correct foreground color property

See merge request GNOME/gtk!5575
2023-03-01 11:05:08 +00:00
Matthias Clasen
fec951c2b2 Merge branch 'cherry-pick-4-8' into 'gtk-4-8'
Cherry-pick changes from main for 4.8

See merge request GNOME/gtk!5573
2023-03-01 11:04:13 +00:00
Lukáš Tyrychtr
d84dab39b9 Don't tell the screen reader that a button is related to an image which has no useful label 2023-03-01 06:24:35 +02:00
Mat
40ff1f442b textbuffer: Use correct foreground color property
The 'foreground-rgba' property should be used instead of 'foreground',
since the latter is not readable.
2023-03-01 04:49:44 +02:00
Corey Berla
c8b4f0c8e8 columnviewtitle: Prevent header clicks from propagating
The header in GtkColumnView has multiple event handlers
there is a ::pressed handler in GtkColumnView for
resizing the columns in CAPTURE as well as a motion
and drag controller.  The ::release handler is in
GtkColumnViewTitle.   We can't claim the event in the
existing handlers because then the ::release handler will
never get called.  Currently, however, all clicks get propagated
to the ColumnView from the header which can be problematic.
Since we don't usually want the clicks from the header
handled on the view, claim it in the BUBBLE phase.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5425
2023-03-01 01:38:18 +02:00
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