Commit Graph

39916 Commits

Author SHA1 Message Date
Matthias Clasen
ad8a3e5b45 Merge branch 'wip/antoniof/columnview-rtl' into 'main'
columnview: Invert columns on RTL

Closes nautilus#2302

See merge request GNOME/gtk!5002
2022-09-06 20:30:15 +00:00
Carlos Garnacho
5b78fe2721 gtktextview: Also reset IM context after IM surrounding text deletion
When the IM commands the GtkText to delete text, the cursor position
would change, and so would the surrounding text. Reset the IM context
so that these updates are properly picked up by the IM.

Fixes backspace	key behavior in	the GNOME Shell OSK, since that	relies
on the surrounding text	being properly updated for the next iteration.
2022-09-06 22:17:40 +02:00
Carlos Garnacho
7c0a395ff9 gtktext: Also reset IM context after IM surrounding text deletion
When the IM commands the GtkText to delete text, the cursor position
would change, and so would the surrounding text. Reset the IM context
so that these updates are properly picked up by the IM.

Fixes backspace key behavior in the GNOME Shell OSK, since that relies
on the surrounding text being properly updated for the next iteration.
2022-09-06 22:17:40 +02:00
Carlos Garnacho
41f26975a9 gtktext: Avoid early IM reset on updates
Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.

We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.

Since there is going to be an actual IM reset anyways, it does
no longer make sense to try to preserve the old priv->need_im_reset
status during commit handling.

Fixes: 52ac71b972 ("gtktextview: Shuffle the places doing IM reset")
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5133
2022-09-06 22:17:40 +02:00
Carlos Garnacho
085374198f gtktext: Avoid early IM reset on updates
Resetting the IM on IM updates is too eager and indeed the simple
IM context doesn't like that this happens in the middle of dead
key handling.

We however want to reset the IM after actual text buffer changes
(say, a committed string) moved the cursor position, altered the
surrounding text, etc. So that the IM implementation does know to
update its state.

Fixes: 9e29739e66 ("gtktext: Shuffle the places doing IM reset")
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5133
2022-09-06 22:17:40 +02:00
Matthias Clasen
586675c902 Merge branch 'treepopover-ellipsize' into 'main'
treepopover: Do not propagate natural width of content

See merge request GNOME/gtk!4895
2022-09-06 20:17:33 +00:00
Luca Bacci
cc57692345 GtkScale: Update the label's size request from set_digits ()
Update the label size request when setting the digits property
by calling the update_label_request () util function.

That util function works by measuring the size request of the
label with the lower and upper values of the adjustment, then
taking the max. That way the size requisition is constant
regardless of the actual displayed value.

Since the util function internally works by setting the text
of the label, let it also set the text at last by taking in
account the current adjustment's value. Most of its callers
do that anyway.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5156
2022-09-06 21:08:31 +02:00
Matthias Clasen
a0db8a24c2 Make gtk_launch_uri more robust
We were failing to launch the uri if we are on
Wayland, but have no xdg_foreign protocol support.

Fixes: #5152
2022-09-06 12:37:56 -04:00
Elliott Sales de Andrade
4cbfb69f74 Document irreversibility of gtk_text_buffer_set_text
If you've begun a user action and call `gtk_text_buffer_set_text`, you
get an unexpected warning:
```
Gtk-WARNING **: Cannot begin irreversible action while in user action
```
which can be fixed by doing the delete/insert yourself. But this is not
documented as occurring, so document it.
2022-09-04 02:47:57 -04:00
António Fernandes
91e6f8e4b9 columnview: Invert columns on RTL
Respect text direction.

Fixes https://gitlab.gnome.org/GNOME/nautilus/-/issues/2302
2022-09-02 15:44:59 +01:00
Mat
58953671fe treeview: Don't claim event sequence too early
We want to claim the event sequence in the click gesture when appropriate,
such as activating a row or clicking an editable cell, but this is currently
done too early, preventing other gestures for drag-and-drop and rubberband
selection entirely.

Fixes #3649
Fixes #3985
Fixes #4669
2022-09-02 15:04:43 +03:00
Luca Bacci
041a186272 Merge branch 'implement-gtk-color-picker-for-windows' into 'main'
Implement GtkColorPicker for Windows

Closes #5136

See merge request GNOME/gtk!4983
2022-09-01 20:39:15 +00:00
Luca Bacci
86a38918d7 Implement GtkColorPicker for Windows
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5136
2022-09-01 19:25:07 +02:00
Matthias Clasen
adcec93b02 Merge branch 'gtkplacessidebar' into 'main'
gtkplacessidebar: Fix crash when remove or rename bookmark

See merge request GNOME/gtk!4625
2022-09-01 15:00:42 +00:00
Lukáš Tyrychtr
27f32b7f9b GtkInscription: Set the a11y label when updating the text property 2022-09-01 16:19:59 +02:00
Georges Basile Stavracas Neto
9261b0079d gtk: Remove last-folder-uri from schema
It's unused since 2013, apparently.
2022-08-30 15:58:47 -03:00
Maxim Zakharov
982b4ff3b2 gtk/gtktooltip.c: check result of event position get operation
Do not perform coordinates transformation when gdk_event_get_position()
returns FALSE as it returns NaNs in that case and these coordinates
are not used anyway in further processing (closes #5134).
2022-08-30 15:54:52 +10:00
Matthias Clasen
e077a6bffe Merge branch 'wip/jimmac/HC-italic-hints' into 'main'
HC: entry - make hints italic

Closes #5143

See merge request GNOME/gtk!4994
2022-08-29 18:55:34 +00:00
Matthias Clasen
39439aa838 fontchooser: Rename default feature value
"Default" is a better fit than "None" here.
2022-08-29 14:14:07 -04:00
Matthias Clasen
018bd0a927 fontchooser: Add a tooltip to the tweak button
Icon-only buttons are always better with a tooltip.
2022-08-29 12:13:32 -04:00
Matthias Clasen
975ab6e7cf fontchooser: Remove placeholder from preview entry
The way we explicitly set the font on the entry
conflicts with the placeholder text styling. But the
entry isn't normally empty, so placeholder text is
not that important here. Remove it and use a tooltip
instead.
2022-08-29 10:21:37 -04:00
Jakub Steiner
09176fc1b3 HC: entry - make hints italic
- to keep contrast but indicated difference between a value and a hint

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5143
2022-08-29 11:58:29 +02:00
Matthias Clasen
0f2582ff02 Merge branch 'font-feature-work' into 'main'
fontchooser: Improve handling of features

See merge request GNOME/gtk!4992
2022-08-29 01:26:12 +00:00
Matthias Clasen
a217be14f9 Merge branch 'gtknotebook-arrow-press' into 'main'
gtknotebook: Claim event sequence after pressing notebook arrow buttons

See merge request GNOME/gtk!4990
2022-08-28 23:30:00 +00:00
Matthias Clasen
c364f1ee12 fontchooser: Improve handling of features
salt and swsh need to be treated like cvXX, with
a dropdown. Also add examples to the default cases
of radio groups.
2022-08-28 17:02:56 -04:00
Mat
dd8c899737 gtknotebook: update arrow button state when reordering tabs
When reordering notebook tabs, updating the sensitivity state of the
arrow buttons is necessary if the tab is moved to the beginning or
end of the tab list.
2022-08-29 00:00:10 +03:00
Mat
d69fdaa04d gtknotebook: Claim event sequence after pressing notebook arrow buttons
When notebook tabs are reorderable, pressing the notebook arrow buttons to
change the active tab results in tabs reordering unexpectedly.
Claim the event sequence after pressing an arrow button to avoid conflicts
with the motion/drag gesture used for reordering.
2022-08-28 23:42:59 +03:00
Matthias Clasen
1276e8868d Merge branch 'notebook-tab-accessibility' into 'main'
gtkatspiselection: Retrieve the correct GtkNotebook tab widget

See merge request GNOME/gtk!4989
2022-08-28 14:53:03 +00:00
Mat
df40efd50d gtkatspiselection: Retrieve the correct GtkNotebook tab widget
A typo resulted in the tab container widget being retrieved instead of
the tab widget. If an adjacent action widget was present, an infinite
loop occurred when switching tabs while a screen reader was enabled.
2022-08-28 17:02:01 +03:00
Matthias Clasen
32796cad10 Use gtk_event_controller_set_static_name
This avoids strdups.
2022-08-27 22:35:13 -04:00
Matthias Clasen
b6a965a67c eventcontroller: Allow static names
These names are a debug-only feature, and we
use string literals everywhere, so avoid the
overhead of copying them.
2022-08-27 22:35:13 -04:00
Matthias Clasen
6136f3ab95 shortcutaction: Intern signal names
Signal names are already interned anyway,
so we can avoid strdups here, and just use
the interned names.
2022-08-27 22:35:13 -04:00
Matthias Clasen
d3e79633e1 notebook: Use canonical signal names
No excuse for not doing that.
2022-08-27 22:34:31 -04:00
Matthias Clasen
137af44f81 Merge branch 'font-chooser-feature-work' into 'main'
fontchooser: Handle font features better

See merge request GNOME/gtk!4984
2022-08-26 22:10:52 +00:00
Matthias Clasen
0441fd3678 fontchooser: Handle font features better
Properly show multiple-choice cvXX features as dropdowns,
include afrc, and fix bugs in feature enumeration that
made some features not show up.
2022-08-26 17:53:55 -04:00
Luca Bacci
3abc3425cb Merge branch 'win32-gir' into 'main'
gdk/win32: do not expose gdk_win32_*_libgtk_only in public headers

See merge request GNOME/gtk!4980
2022-08-26 13:14:30 +00:00
Benjamin Otte
fb7257a1f5 Merge branch 'treelistmodel-collapse-test' into 'main'
treelistmodel: Fix handling of collapsed nodes

Closes #4595

See merge request GNOME/gtk!4981
2022-08-24 13:42:51 +00:00
Matthias Clasen
f1c1c979c2 treelistmodel: Fix handling of collapsed nodes
When we collapse a node, we clear out the children,
but we were not disconnecting the signal handler on
the child listmodel, leading to bad outcomes when
that model is persistent and changing.

Fixes: #4595
2022-08-24 08:23:20 -04:00
Marc-André Lureau
6cfb6e0c9c gdk/win32: do not expose gdk_win32_*_libgtk_only in public headers
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-08-24 15:44:32 +04:00
Marc-André Lureau
88503bcc3b gtk/win32: fix a switch-default warning
gtk/gtkimcontextime.c:714:3: warning: switch missing default case [-Wswitch-default]

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-08-23 16:42:17 +04:00
Marc-André Lureau
04ebec0fa7 gtk/win32: use gdk_win32_surface_get_handle
As I propose to deprecate gdk_win32_surface_get_impl_hwnd() next,
replace it with the alternative.

The main difference between the two functions is that
gdk_win32_surface_get_impl_hwnd() fails gracefully by returning NULL if
the surface is not of the win32 implementation.

All the surfaces should be native surfaces here, and the existing code
doesn't seem to deal with NULL case anyway.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-08-23 16:31:09 +04:00
Luca Bacci
0d4d52d322 Merge branch 'win32-gir' into 'main'
Generate gtk/GdkWin32-4.0.gir

Closes #5112

See merge request GNOME/gtk!4965
2022-08-22 22:26:09 +00:00
Matthias Clasen
a52ee9ee22 css: Fix freeing of calc values
We were getting our memory allocations mixed
up here.

Fixes: #5130
2022-08-22 11:51:56 -04:00
Matthias Clasen
092c166f54 Merge branch 'no-emoji-insert' into 'main'
text: Respect no-emoji hint fully

See merge request GNOME/gtk!4972
2022-08-21 20:47:27 +00:00
Matthias Clasen
13f8eeb3ee text: Respect no-emoji hint fully
We were disabling the insert-emoji action when the
no-emoji input hint is set, but the Ctrl-. shortcut
was bypassing the action and kept working. Make
the shortcut activate the action instead.

Fixes: #5123
2022-08-21 16:31:14 -04:00
Matthias Clasen
78eaad614a emojichooser: Fix arrow keynav
When some of the Emoji have been filtered out by
a search term, arrow keynav would behave oddly and
get stuck in invisible sections. Fix this by ignoring
any filtered out children when moving between
sections for arrow keynav.

Fixes: #5076
2022-08-19 15:55:10 -04:00
Marc-André Lureau
8ab57fc8ef build-sys: generate GdkWin32.gir
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-08-19 17:42:30 +04:00
Matthias Clasen
44931aa8f8 Merge branch 'treeview-search-focus' into 'main'
treeview: Always call grab_focus_without_selecting on search entry

Closes #4551

See merge request GNOME/gtk!4961
2022-08-18 23:51:02 +00:00
Carlos Garnacho
f66ffde68d gtkimcontextwayland: Refactor handling of client updates
Currently, the wayland IM context sends zwp_text_input_v3.commit from
a number of places, and some of them with partial data. In order to
make client state updates "atomic" and complete, make the communication
happen over an unified notify_im_change() function that happens on
a narrower set of circumstances:

  - The GtkIMContext is reset
  - The GtkIMContext is just focused
  - The gesture to invoke the OSK is triggered
  - The IM context is reacting to changes coming from the compositor

Notably, setting the cursor location or the surrounding text do not try
to commit state on their own, and now will be flushed with the corresponding
IM update or reset. But also, these requests won't be prevented from
happening individually on serial mismatch, instead it will be the whole
state commit which is held off.

With these changes in place, all client-side updates are notified
atomically to the compositor under a single .commit request.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5106
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5105
2022-08-18 19:19:53 +02:00
Carlos Garnacho
52ac71b972 gtktextview: Shuffle the places doing IM reset
During text widget manipulation (inserting or deleting text via keyboard)
the IM context is reset somewhat early, before the actual change took place.
This makes IM lag behind in terms of surrounding text and cursor position.

Shuffle these IM reset calls so that they happen after the changes, and
ensure that the IM is actually reset, since that is currently toggled on
a pretty narrow set of circumstances.

Also, fix a bug during GtkEventControllerKey::im-update where the condition
on cursor position editability to reset the IM context was inverted.
2022-08-18 19:07:12 +02:00
Mat
27eaca8b79 treeview: Always call grab_focus_without_selecting on search entry
The search text entry is always a GtkText widget, not GtkEntry. If a
custom search entry is set, this part of the code is never reached.

Fixes #4551
2022-08-18 18:03:04 +03:00
Carlos Garnacho
9e29739e66 gtktext: Shuffle the places doing IM reset
During text widget manipulation (inserting or deleting text via keyboard)
the IM context is reset somewhat early, before the actual change took place.
This makes IM lag behind in terms of surrounding text and cursor position.

Shuffle these IM reset calls so that they happen after the changes, and
ensure that the IM is actually reset, since that is currently toggled on
a pretty narrow set of circumstances.
2022-08-18 00:55:30 +02:00
Matthias Clasen
bebaac64e1 Merge branch 'gtktreeview-adjustment' into 'main'
treeview: Do not set top row adjustment value while animating

Closes #4550

See merge request GNOME/gtk!4940
2022-08-14 22:40:32 +00:00
Matthias Clasen
1d232a725f Merge branch 'treeview-widget-coords' into 'main'
treeview: Use widget coordinates where required

See merge request GNOME/gtk!4939
2022-08-14 22:39:21 +00:00
Benjamin Otte
918dd66dca listitemwidget: Actually unref the listitems
Fixes #5102
2022-08-14 22:55:27 +02:00
Matthias Clasen
33cf8f9404 inscription: Plug a memory leak
PangoFontMetrics also need to be freed.
2022-08-12 20:35:36 -04:00
Matthias Clasen
1640390839 inscription: Plug a memory leak
PangoLayoutIter needs to be freed.
2022-08-12 20:35:36 -04:00
Matthias Clasen
e81db46578 a11y: Fix a memory leak
We need to free the queued context list in dispose
if we didn't get to register the contexts, and we also
need to free the list properly when we do get to
register them.

This showed up in valgrind as leaked GList structs.
2022-08-12 12:01:42 -04:00
Pablo Correa Gómez
97d3363360
gtk/css: data_url_path fix leak in error path
Fixes 7900032f30
2022-08-12 01:34:18 +02:00
Matthias Clasen
7900032f30 css: Propagate charset conversion errors
Lets not throw away informtation that
helps to figure out why things fail.
2022-08-11 07:29:56 -04:00
José Expósito
95860d4989 gtkeventcontrollerscroll: Always accumulate discrete deltas
When GTK_EVENT_CONTROLLER_SCROLL_DISCRETE is set, accumulate deltas also
for mouse scroll so a high-resolution mouse wheel click behaves in the
in the same manner as a low-resolution mouse wheel click.
2022-08-10 14:23:58 +00:00
José Expósito
6ebb38e12e gdk/events: Set discrete scroll deltas in its constructor
Instead of calculating the discrete scroll deltas in
GtkEventControllerScroll, move that code to the event constructor and
access the precalculated values using gdk_scroll_event_get_deltas.

Refactor, no functional changes.
2022-08-10 14:23:58 +00:00
Mat
b4ade026f1 treeview: Do not set top row adjustment value while animating
gtk_tree_view_top_row_to_dy, which is called from GtkTreeView's
size_allocate function, changes the adjustment value. Since this
conflicts with the animation when changing the active row, bail
out until the animation is finished.

Fixes #4550
2022-08-10 08:32:47 +03:00
Mat
102ca838b8 treeview: Use widget coordinates where required
When a GtkTreeView scrolled horizontally, it was not possible to
select rows outside the initial area due to an erroneous comparison
between widget and bin window coordinates.

Original change to widget coordinates occurred in commit
a0de570e47
2022-08-10 04:25:19 +03:00
Carlos Garnacho
378ae4fbc1 Merge branch 'gbsneto/paned-focus-infloop' into 'main'
paned: Protect against NULL variable

Closes #5094

See merge request GNOME/gtk!4938
2022-08-09 18:26:48 +00:00
Carlos Garnacho
54465adff2 gtkwindow: Use pointer-oriented function to deal with crossing events
Commit adba0b97 fixed missed pointer crossings by using a helper function that
was already present and looked like did everything that was needed. However
this function was oriented to keyboard focus and it also did update the related
widget state. Doing these changes on pointer-based crossing was misuse, and
could cause weird interactions with keyboard focus management.

Fix this by using gtkmain.c gtk_synthesize_crossing_event() that is in fact
oriented to pointers.

Fixes: adba0b97 (gtkwindow: Synthesize pointer crossing events on state changes)
Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5094
2022-08-09 19:48:15 +02:00
Georges Basile Stavracas Neto
29580d4252 paned: Warn if child is not actually a child
This will at least allow us to debug this in the future.
2022-08-09 14:20:25 -03:00
Carlos Garnacho
25c3616a79 gtkmain: Pass coordinates when synthesizing pointer events
Instead of passing an event and figuring out coordinates from it, pass
directly the toplevel coordinates so that we can use this outside event
handling.

All callers have been updated to pass the coordinates, in practical effects
they were already based on the GtkNative.
2022-08-09 19:13:28 +02:00
Georges Basile Stavracas Neto
120399cc92 paned: Protect against NULL variable
The inner loop in gtk_paned_set_focus_child() tries to find the
topmost GtkPaned, however, if the `w` variable ends up becoming
NULL after bubbling up the entire GtkWidget hierarchy, this loop
never breaks.

Check for NULL in this loop.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/5094
2022-08-09 13:59:09 -03:00
Alexander Mikhaylenko
493660a296 scrolledwindow: Lower the scroll multiplier
c68247f63b introduced a scroll multiplier,
intended to be significantly lower than the GTK 4.6 behavior but higher
than 1. However, it was _higher_ than 4.6, since 4.6 also had a permanent
1/10 multiplier in GDK, so the cited multiplier values were really 6.4 and
9.7.
2022-08-08 00:07:36 +04:00
Carlos Garnacho
0e5a97ae58 gtk/scrolledwindow: Check for overshoot setting up kinetic scroll helpers
We may have situations where velocity is 0/0, but are overshooting. Places where
this happens are mouse wheels, and continuous scroll that ended up still before
finish. In this situation we also want to run the animation for overshoot, so
check for the corresponding axes to also set up the kinetic scroll helper.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4784
2022-08-07 20:26:52 +02:00
Carlos Garnacho
c68247f63b gtkscrolledwindow: Add fixed multiplier to scroll events in surface units
The expected configurability is not going to arrive yet from compositors, and
it is precipitate for GTK to gain any configurability. We do know a factor of 1
feels way too slow, and we do know a factor of page_size * pow (2 / 3) feels way
way too fast.

With the previous multiplier, gtk4-demo at its default size had a vertical textview
factor of 64.332901, and maximized on a 1920x1080 screen a factor of 97.585365.
Pick a magic multiplier that is both significantly below these values and above 1,
and stick to it.

Future work will add the configurability of smooth scroll events where it belongs.
At that point this commit may be reverted so we don't pile up on magic numbers again.

Related: https://gitlab.gnome.org/GNOME/gtk/-/issues/4793
2022-08-07 17:16:14 +02:00
Carlos Garnacho
adba0b972e gtkwindow: Synthesize pointer crossing events on state changes
When widgets go mapped/unmapped, we repick but don't generate crossing
events. Since there could be stateful controllers that use those in
the previously picked widget (e.g. GtkEventControllerMotion), skipping
those breaks their state.

Ensure to send the relevant crossing events on every situation that
changes the pointer focus, so these controllers get a fair opportunity
to undo their state.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2877
2022-08-05 19:25:13 +02:00
Carlos Garnacho
8eda182f24 gtkeventcontroller: Fix internal enum documentation
Copy and paste typo.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
15e0c175a3 gtkgesturerotate: Filter touchpad holds events
Since the pinch touchpad gestures already have begin/update/end phases,
this gesture has no actual use for these events.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
bc953eebdd gtkgesturerotate: Filter touchpad holds events
Since the pinch touchpad gestures already have begin/update/end phases,
this gesture has no actual use for these events.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
6238f97cb6 gdkevent: Give touchpad hold events a sequence
Following what was done for pinch/swipe events, give hold gestures their
own distinct sequence as well. Without this it was NULL, which was already
distinct to other touchpad gestures.
2022-08-05 19:25:13 +02:00
Carlos Garnacho
023924bca9 gtkgesture: Do not coalesce hold events with other touchpad gestures
This delaying of the cancel event was made to avoid intermediate cancellation
for >=2fg hold gestures followed by pinch/swipe gestures, and it worked as
long as everything was considered to have the same sequence.

Since each pinch/swipe pointer gesture now gets its own sequence, this no
longer applies, nor works. This results in zoom/rotate/swipe gestures being
stuck since the sequence for the touchpad events changes mid-gesture.

Sticking to this pattern of giving touchpad gestures their own sequence,
these hold events cannot be assumed to coalesce with other touchpad gestures,
it is better to let it propagate altogether so that both the hold gesture
and the incoming gesture trigger coherent begin and end/cancel phases.

In the worst case, this results in "::begin, ::cancel, ::begin , ..." before
triggering a touchpad gesture, but the extra begin/cancel ought to be a safe
no-op in widgets.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5003
2022-08-05 19:25:13 +02:00
Emmanuele Bassi
d030c92d63 Move private function out of the AT-SPI a11y backend
The textbuffer test is calling into a function defined by the AT-SPI
accessibility backend. As of commit 4ddf1b70 we only build and run the
test on Linux, but the function in question isn't really
accessibility-related: it's just a serialization function.
2022-08-04 23:34:41 +01:00
Matthias Clasen
f7b3a214f3 Merge branch 'mount_operation' into 'main'
mountoperation: Fix authentication dialog

Closes #5059 and #5058

See merge request GNOME/gtk!4899
2022-08-03 11:56:25 +00:00
Matthias Clasen
a48942bf39 Merge branch 'label-tabs' into 'main'
Label tabs

See merge request GNOME/gtk!4914
2022-08-02 00:18:44 +00:00
Benjamin Otte
dbab69c453 snapshot: Don't critical on dispose
When there's remaining state that draws nothing, it returns no
rendernode. So do a NULL-check before unreffing it.
2022-08-01 20:28:46 +00:00
Benjamin Otte
09f0c96b9b Fix g_object_new(GTK_TYPE_SNAPSHOT)
GJS apparent likes g_object_new() over actual constructors, so make that work.
2022-08-01 20:08:58 +00:00
Matthias Clasen
641a589734 Add GtkLabel:tabs
This adds more powerful formatting capabilities to GtkLabel
without costing us much, since Pango already supports tabs.
2022-08-01 08:20:05 -04:00
Christian Hergert
d00d1334ce gtkbuilder: update gtk_builder_expose_object() docs 2022-07-31 21:37:20 -07:00
Christian Hergert
fbe124ca54 gtkbuilder: update gtk_builder_extend_with_templat() docs 2022-07-31 21:25:58 -07:00
Christian Hergert
f680b86130 gtkbuilder: check for existing object before extending template
If gtk_builder_expose_object() is called twice with the same name, it will
result in a g_critical(). This improves that situation by checking for the
object before exposing additional times.

This turns out to be handy in situations where templates are expanded
multiple times, such as application-side implementations of UI merging.
2022-07-31 21:25:58 -07:00
David Demelier
06bec5fb45 gtk: Missing end of code block 2022-07-26 14:52:30 +00:00
Corey Berla
a7bbc25851 listview: Fix selection for last item in get_items_in_rect
Make the last item dependent on y + height
2022-07-25 17:55:26 -07:00
Corey Berla
d6fab1408a listview: Allow starting rubberband in empty space below last row
Rubberband does not work when initiated past the last row
(warning is printed "Could not start rubberbanding: No item).

Clamp y at the max height of the widgets in the listview
2022-07-25 17:55:15 -07:00
Corey Berla
e14b84ff67 listview: Return an empty bitset when selecting only empty space
Return an empty bitset if the user selects exclusively below the last
row.
2022-07-25 17:54:44 -07:00
Corey Berla
aba2d994e6 gridview: Fix typo in docstring for gtk_grid_view_get_cell_at_y() 2022-07-25 17:54:44 -07:00
Corey Berla
57c032e6cc listbase: Clear selection if rubberband selected an empty set
If rubberband returns an empty bitset the selection should be cleared
unless the shift or ctrl key is held
2022-07-25 17:54:44 -07:00
Corey Berla
f3fc8f5b35 gridview: Return an empty bitset when selecting only empty space
Return an empty bitset if the user selects exclusively below the last
row.  No need to calculate selection.
2022-07-25 17:54:44 -07:00
Corey Berla
ba909cf901 gridview: Fix get_items_in_rect() selection
last_row should be dependent on y + height, not y
2022-07-25 17:54:44 -07:00
Corey Berla
1e9a36ffa8 gridview: Allow starting rubberband in empty space below last row
Rubberband does not work when initiated past the last row
(warning is printed "Could not start rubberbanding: No item).

Clamp y at the max height of the widgets in the gridview

Fixes: #3462
2022-07-25 17:54:35 -07:00
Corey Berla
c6f357e447 gridview: Limit rectangle to gridview columns
The function gtk_grid_view_get_items_in_rect() erroneously calculates
columns less than 0 and greater than n_columns when the user attempts
to rubberband all the way to the left or right respectively.  This
causes the rubberband to persistent and creates unexpected behavior.
Limit the rows to a minimum of 0 and maximum of n_columns - 1.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3445
2022-07-25 17:27:24 -07:00
Corey Berla
2bcae546b3 gridview: Move gtk_grid_view_computer_total_height() up for reuse 2022-07-25 17:27:24 -07:00
Philip Withnall
87ba99f66b gtkwidget: Fix a small typo in a docs comment
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2022-07-25 23:15:58 +02:00
Corey Berla
111929593a mountoperation: Free user_widgets list upon dialog destruction
There's a list user_widgets that contains all of the entries and
selections during authentication.  This is only freed  upon
finalizing the GtkMountOperation.  It's possible (and true for the
GVFS SMB implementation) that a MountOperation can have the
gtk_mount_operation_ask_password_do_gtk () function called multiple
times (i.e. bad password).  The user_widgets list grows with now
invalid pointers to old widgets (causing unexpected behavior and
seg faults).

Free the user_widgets list upon dialog destruction, we don't need it
anymore.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5059
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5058
2022-07-25 06:54:14 -07:00