Commit Graph

40473 Commits

Author SHA1 Message Date
Matthias Clasen
703ed608c0 Fix a compiler warning
Clang things that load_error might be NULL here.
It may be right.
2023-01-13 12:07:40 -05:00
Matthias Clasen
51b4d70b8f gridview: Add a few assertions
Just to help static analysis out.

self->n_columns can't ever be 0, since
we clamp it between min_columns and
max_columns, with min_columns always
being at least one.
2023-01-13 12:07:40 -05:00
Matthias Clasen
d226dc3812 iconcache: Be a bit less wasteful 2023-01-12 00:36:18 -05:00
Matthias Clasen
46e0fde606 css: Avoid more allocations for tokens
Make short string tokens static.
2023-01-12 00:12:09 -05:00
Matthias Clasen
1e7f525e0e css: Avoid some allocations
Avoid duplicating the function name just
for an error message.
2023-01-12 00:12:09 -05:00
Matthias Clasen
d43e0fb9a7 css: Avoid allocation for tokens
All valid dimensions are short, so store
the dimension inside the token.
2023-01-12 00:11:46 -05:00
Matthias Clasen
6fb6f47fc8 css: Avoid some allocations
Reuse the name_buffer for reading strings.
2023-01-12 00:11:11 -05:00
Matthias Clasen
0f7d8e04d8 css: Some inlining 2023-01-12 00:11:10 -05:00
Matthias Clasen
c9fca559dc Cosmetics 2023-01-12 00:11:10 -05:00
Matthias Clasen
b9d1b5d6a3 icontheme: Bit a bit less wasteful 2023-01-12 00:11:10 -05:00
Matthias Clasen
41aeff331d texthistory: Avoid g_autofree
msvc does not like it, unfortunately.
2023-01-10 22:20:57 -05:00
Christian Hergert
ad0348b85e texthistory: add debugging helpers to print undo stack
This is helpful to have when tracking down issues like #5506.
2023-01-10 13:36:16 -08:00
Christian Hergert
6a134551b9 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-01-10 13:32:38 -08:00
Corey Berla
e20bc7723a 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-01-08 22:32:22 -08:00
Emmanuele Bassi
7edf8841fb Merge branch 'a11y_check_null_path' into 'main'
a11y: Avoid crashing if GtkAtSpiContext::path is NULL

See merge request GNOME/gtk!5405
2023-01-09 00:14:21 +00:00
Marco Melorio
c775262e9d docs: Improve gtk_window_present description
Move most of the documentation from gtk_window_present_with_time and
also reword it a bit to make it more understandable.
2023-01-08 22:41:19 +01:00
Marco Melorio
553fde9761 docs: Don't mention deprecated API in gtk_widget_set_visible
That statement is true, but since that API is deprecated, it doesn't
need to be there anymore to avoid confusing people.
2023-01-08 21:49:28 +01:00
Barnabás Pőcze
f2593dec4b 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-01-08 19:58:54 +01:00
Barnabás Pőcze
ab5a6ed0f1 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-01-08 19:56:49 +01:00
Matthias Clasen
be8fb1e9b8 Merge branch 'more-filesystemmodel-cleanups' into 'main'
filesystemmodel: Crop tree model cruft

See merge request GNOME/gtk!5402
2023-01-07 18:42:14 +00:00
robxnano
57ebf26f15 filechoosernativewin32: Set default extension 2023-01-07 18:14:36 +00:00
Matthias Clasen
32247bc50e filesystemmodel: Drop tree model cruft
We no longer need the placeholder item for the
editable, so drop it.
2023-01-07 12:22:25 -05:00
Matthias Clasen
ad940bc892 filesystemmodel: Rename private header 2023-01-07 12:01:15 -05:00
Matthias Clasen
7d34e7e0f7 Merge branch 'filesystemmodel-cleanups' into 'main'
filesystemmodel: Cleanup unused defines

See merge request GNOME/gtk!5401
2023-01-07 14:36:20 +00:00
Georges Basile Stavracas Neto
b2f43076bd gtkfilesystemmodel: Use g_clear_* helpers
Saves some code.
2023-01-07 09:17:37 -05:00
Georges Basile Stavracas Neto
202e889577 filesystemmodel: Use G_DECLARE_FINAL_TYPE()
Clean up boilerplate. It's a private object anyway.
2023-01-07 09:17:37 -05:00
Georges Basile Stavracas Neto
a8690c84ab filesystemmodel: Cosmetics
Adjust code style, and shuffle some functions around. Remove
unhelpful doc comments.
2023-01-07 09:17:15 -05:00
Matthias Clasen
35244f4b59 filesystemmodel: Use g_set_object 2023-01-07 09:12:44 -05:00
Georges Basile Stavracas Neto
503c3ec04d filesystemmodel: Make function private to gtkfilesystemmodel.c
The _gtk_file_system_model_update_file() function is not used outside
GtkFileSystemModel, so no need to expose it in the header.

Shuffle it around in code, and remove it from the header.
2023-01-07 08:44:40 -05:00
Georges Basile Stavracas Neto
4a5a466975 filesystemmodel: Cleanup unused defines
They were made unused with the removal of GtkTreeModel interface
implementation.
2023-01-07 08:44:34 -05:00
Corey Berla
735cf301a4 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-01-06 20:37:54 -08:00
Corey Berla
e8a29f90d1 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-01-06 20:21:35 -08:00
Corey Berla
182cc74834 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-01-06 20:21:35 -08:00
Matthias Clasen
7801dd8944 Merge branch 'wip/phako/fix-activate-action-annotation' into 'main'
widget: Mark format as nullable in activate_action

See merge request GNOME/gtk!4653
2023-01-07 01:06:00 +00:00
Matthias Clasen
38e090f5c1 Merge branch 'main' into 'main'
Fix a typo

See merge request GNOME/gtk!5170
2023-01-07 00:59:32 +00:00
Matthias Clasen
120396fa40 wip: Split off GdkWaylandPopup
Like the GdkWaylandToplevel split-off, this needs some
more cleanup.
2023-01-06 16:50:19 -05:00
Matthias Clasen
d61ec38974 wip: Split off GdkWaylandToplevel
This still needs some more cleanup.
2023-01-06 16:50:19 -05:00
Matthias Clasen
68700f8722 Merge branch 'drop-file-dialog-shortcuts' into 'main'
filedialog: Drop shortcut folders

See merge request GNOME/gtk!5396
2023-01-06 13:35:14 +00:00
Matthias Clasen
f76270167c Merge branch 'wip/otte/for-5496' into 'main'
filedialog: Never set the chooser's file

Closes #5496

See merge request GNOME/gtk!5393
2023-01-06 13:34:55 +00:00
Matthias Clasen
2a442c4fbb Merge branch 'macos-command-symbol' into 'main'
macos: Use Command key symbol in Keyboard shortcuts window

See merge request GNOME/gtk!5296
2023-01-06 13:17:36 +00:00
Matthias Clasen
9356dfc404 filedialog: Drop shortcut folders
The filechooser portal does not support this,
and we are defaulting to using the portal now.
Lets not offer a non-functional API.
2023-01-06 07:40:57 -05:00
Arjan Molenaar
c52978dfa4
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-01-06 12:08:55 +01:00
Matthias Clasen
52dfa54301 Merge branch 'test-file-dialog' into 'main'
Test file dialog

See merge request GNOME/gtk!5394
2023-01-06 04:28:28 +00:00
Matthias Clasen
8780aa02d7 filedialog: Cosmetics 2023-01-05 23:06:31 -05:00
Benjamin Otte
8d5a39d765 Merge branch 'wip/corey/dnd-use-cursor' into 'main'
Fix accidental DnD

See merge request GNOME/gtk!5275
2023-01-05 22:39:26 +00:00
Benjamin Otte
446e6a8d62 filedialog: Never set the chooser's file
Instead, get by with setting the name and hope the filechooser figures
things out by itself.

Fixes #5496
2023-01-05 21:30:15 +01:00
Matthias Clasen
9b1bee99b8 Merge branch 'openuri-activation-token' into 'main'
Pass an activation token to OpenURI

See merge request GNOME/gtk!5389
2023-01-05 14:06:14 +00:00
Matthias Clasen
fc1f1366b4 filechooser: Don't assert for possible cases
switch_to_selected_folder can be called when the
selection contains more than one item. Handle it
like it used to be handled: switch to the first
folder we find.

Fixes: #5494
2023-01-05 08:41:33 -05:00
Matthias Clasen
6efd1a9dad Pass an activation token to OpenURI
The OpenURI portal can take an activation_token
nowadays. So it give one.
2023-01-04 16:39:24 -05:00
Matthias Clasen
918ff1d0f4 Deprecate gtk_toggle_button_toggled
The function is documented as useless.
2023-01-04 07:32:51 -05:00
Carlos Garnacho
4041ca0f69 gdkdisplay: Deprecate gdk_display_notify_startup_complete()
We have various layers where we store the startup ID for a request,
since this API does not have a GdkToplevel that we can refer about
for the Wayland platform, this is the most obvious candidate to
start untangling these various layers.

Deprecate this call, it is already unused in the gtk/ side.
2023-01-03 14:58:33 +01:00
Carlos Garnacho
3526d8b299 gtkapplication: Do not call gdk_display_notify_startup_complete()
This should do nothing worthwhile anymore, the X11/Wayland GtkApplication
implementations do already pass the startup ID from the platform_data
via windowing specific APIs, and the application handling the request
via show()/present() should trigger the activation request.
2023-01-03 14:58:33 +01:00
Carlos Garnacho
e8adfa2a88 gtkwindow: Shuffle gdk_toplevel_set_startup_id() calls
While this used to be tangential to windows showing or requesting
focus, the xdg-activation Wayland protocol does merge both concepts
together.

But also, for a correct interaction with the compositor, the
toolkit should ideally merge the activation request resulting from
both into the same one, so that the gdk_toplevel_focus() request
replies to the startup token that started the application and
correct focus-stealing prevention/etc happens, instead making up
one just in time for the focus request.

This kind of requires doing things in the right order, a show()
request on the GtkWindow should activate any pending activation
token on the toplevel, a present() request should additionally
create a new token if there was none pending. And
xdg_activation_v1_activate() should happen once on both.

Shuffle the gdk_toplevel_set_startup_id() calls so that this
happens in the right order for Wayland, while making X11 happy
too.
2023-01-03 14:58:33 +01:00
Carlos Garnacho
6f01f846dc gtkwindow: Minor refactor
Move the handling of the startup ID to a separate function, since
this will be called from several places.
2023-01-03 14:57:44 +01:00
Matthias Clasen
53813f24f0 Merge branch 'matthiasc/for-main' into 'main'
ci: Enable introspection for the docs build

See merge request GNOME/gtk!5383
2023-01-02 21:53:58 +00:00
Matthias Clasen
1fde83f12b Merge branch 'direction-from-language' into 'main'
Determine direction from language

See merge request GNOME/gtk!5385
2023-01-02 21:50:54 +00:00
Matthias Clasen
1f7783224b Determine direction from language
We can determine the direction to return here
without relying on translations, by using pango
and HarfBuzz apis to go
language -> script -> direction.
2023-01-02 16:30:27 -05:00
Matthias Clasen
0d04ceda76 Merge branch 'ccook/doc-changes-2' into 'main'
Various documentation suggests across a few domains.

See merge request GNOME/gtk!5384
2023-01-02 20:40:54 +00:00
Cam Cook
9396ccf9ff Various documentation suggests across a few domains.
| domain | current | suggestion |
|--------|---------|------------|
| [GtkSeparator](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkseparator.c#L39)    | "`![An example GtkSeparator](separators.png)`" | "`![An example GtkSeparator](separator.png)`" [1] |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L4885)  | "if there is an redoable action" | "if there is a redoable action" |
| [GtkTextBuffer/get_enable_undo](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L5005) | (Renders `No description available.`) | "Returns: %TRUE if undoing and redoing changes to the buffer is allowed." [3] |
| [GtkTextBuffer/get_max_undo_levels](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L5102) | (Renders `No description available.`)| "Returns: The max number of undo levels allowed (0 indicates unlimited)." |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L3874) | "with gtk_text_buffer_add_selection_clipboard()." | "with [method@Gtk.TextBuffer.add_selection_clipboard]" |
| [GtkTextBuffer](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L3494) | "it will automatically toggled" | "it will automatically toggle" |

* [1] See : [separator.png](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/images/separator.png), [gtk4.toml.in](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/gtk4.toml.in#L218), [visual_index.md](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/docs/reference/gtk/visual_index.md?plain=1#L16)
* [2] Taken from `enable-undo` [property description](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbuffer.c#L516)

* [GtkTextMark/gtk_text_mark_set_visible](https://docs.gtk.org/gtk4/method.TextMark.set_visible.html) is defined in [GtkTextMark's header](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextmark.h#L93), but implemented in [GtkTextBTree](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextbtree.c#L3036).
  * Other than being kind of confusing, this causes `gtk_text_mark_set_visible()`'s doc to not render where it expects it to.
2023-01-02 13:47:55 -05:00
Matthias Clasen
85df554ec1 Fix compiler warnings 2023-01-02 11:18:54 -05:00
Matthias Clasen
e126110ae0 Merge branch 'wide-inspector' into 'main'
inspector: Avoid super-wide window

See merge request GNOME/gtk!5379
2022-12-31 20:07:45 +00:00
Matthias Clasen
40a2910262 inspector: Avoid super-wide window
Ellipsize values that can get long, to avoid
forcing an excessively wide window.
2022-12-31 12:30:40 -05:00
Marco Melorio
ec84077486 docs: Annotate GtkDialog deprecations 2022-12-30 15:37:11 +01:00
Corey Berla
7ad693f865 gtkcolumnviewcolumn: Only create cells when the column is visible
It's a big performance drag to create many cells (and their associated
widgets) for columns that may never be shown. Only create cells
is the column is visible, and subsequently create/remove cells
when in column_set_visible.
2022-12-29 11:11:40 -08:00
Corey Berla
4e694c1824 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
2022-12-27 08:11:53 -08:00
Matthias Clasen
5eb4a3af0d filedialog: Handle initial-folder being NULL
This showed up as test failure in ci.
2022-12-24 09:01:16 -05:00
Benjamin Otte
c4c747d2ad alertdialog: Rephrase docs for show() a bit
In particular, discuss what to do about cancellables.

Related: !5326
2022-12-24 07:56:57 -05:00
Benjamin Otte
671fad5f34 filedialog: Clarify interaction of :filters and :default-filter 2022-12-24 07:56:57 -05:00
Benjamin Otte
1b9c45b660 filedialog: Rename :current-filter to :default-filter
The last "current" removed from properties. None of these are current.
2022-12-24 07:56:57 -05:00
Benjamin Otte
e2f730c0bf filedialog: Add gtk_file_dialog_set_initial_file()
A shortcut for setting initial-folder and initial-name at the same time.

We can remove all arguments from the actual async calls this way.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8a2d35b9fb filedialog: Add gtk_file_dialog_set_initial_name() 2022-12-24 07:56:57 -05:00
Benjamin Otte
26cec4a021 filedialog: Rename current-folder to initial-folder
It's not the current one - unlike in GtkFileChooser - because there are
no live updates. So we use a more descriptive name.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8d8e83afa2 fontdialog: Handle Escape better
Closing the dialog by hitting Escape should
have the same effect as clicking the cancel
button. Make it so.
2022-12-24 07:56:57 -05:00
Benjamin Otte
381bb84f3d alertdialog: Bring the GError back
Make sure we have a GError, so that dismissing and cancelling can be
separated.
2022-12-24 07:56:57 -05:00
Benjamin Otte
977fedfdf1 dialog: GTK_DIALOG_ERROR_ABORTED => GTK_DIALOG_ERROR_CANCELLED
This is done via the GCancellable, so let's call it cancelling.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8957302bd4 dialog: GTK_DIALOG_ERROR_CANCELLED => GTK_DIALOG_ERROR_DISMISSED
The term "cancelling" is used with GCancellable, a user clicking a close
button is not that.
User input is usually described as "dismissing", so we use that term.
2022-12-24 07:56:57 -05:00
Benjamin Otte
8a7f739f9f directorylist: Always add standard::name
glib can't figure out how to do that, so we need to do that ourselves.
2022-12-24 07:56:57 -05:00
Cam Cook
1cd44ec7b7 Make stylecheck happy 2022-12-23 11:21:18 -05:00
Cam Cook
424d56830a Merge remote-tracking branch 'upstream/main' into ccook/doc-changes-1 2022-12-23 11:02:18 -05:00
Cam Cook
7fc4d02851 Various spelling mistakes across a few domains that show up in documentation.
| domain | current | suggestion |
|--------|---------|------------|
| [GtkAspectFrame](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkaspectframe.c#L457)    | "requistion of the child" | "requisition of the child" |
| [GtkPaned](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpaned.c#L2500)               | "(attributes org.gtk.Method.set_propery=wide-handle)" | "(attributes org.gtk.Method.set_property=wide-handle)"|
| [GtkPopover](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpopover.c#L2484)           | "with gtk_popover_set_offset()." | "with [method@Gtk.Popover.set_offset()]." |
| [GtkPopoverMenu](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkpopovermenu.c#L859)    | "with gtk_popover_menu_add_child()" | "with [method@Gtk.PopoverMenu.add_child()]" |
| [GtkSelectionModel](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkselectionmodel.c#L316) | "the queired range" | "the queried range" |
| [GtkScrolledWindow](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkscrolledwindow.c#L76) | "automatically removed hen" | "automatically removed when"|
| [GtkSearchBar](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtksearchbar.c#L425)         | "Connects the \`GtkEditable widget" | "Connects the `GtkEditable` widget" |
2022-12-23 11:01:07 -05:00
Matthias Clasen
123eebb93d Merge branch 'tweak-gtkfilechooser-button-tooltips' into 'main'
GtkFileChooser: Tweak Grid View & List View button tooltips

See merge request GNOME/gtk!5345
2022-12-21 12:39:53 +00:00
Lukáš Tyrychtr
ffe333a21f 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.
2022-12-21 11:35:46 +01:00
Matthias Clasen
257ca10eb1 Merge branch 'file-nullable' into 'main'
filelauncher: Make set_file argument nullable

See merge request GNOME/gtk!5357
2022-12-21 03:23:58 +00:00
Benjamin Otte
ae097d9674 Merge branch 'wip/antoniof/listbase-rubberband-better-fix' into 'main'
listbase: Cancel rubberband if not handling drag

See merge request GNOME/gtk!4831
2022-12-21 01:14:57 +00:00
Luca Bacci
cf91e09d75 Include hicolor index.theme as a resource
index.theme file copied from upstream xdg/default-icon-theme
repository at tag 0.17:

https://gitlab.freedesktop.org/xdg/default-icon-theme/-/tree/0.17

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5303
2022-12-20 16:30:00 +01:00
Luca Bacci
59df956f4f Revert "Merge branch 'include-hicolor-index-theme-as-resource' into 'main'"
This reverts merge request !5341
2022-12-20 13:23:51 +00:00
Matthias Clasen
09691ead4c Merge branch 'include-hicolor-index-theme-as-resource' into 'main'
Include hicolor index.theme as a resource

Closes #5303

See merge request GNOME/gtk!5341
2022-12-20 12:24:25 +00:00
Maximiliano Sandoval R
18a7f715c4
filelauncher: Make set_file argument nullable 2022-12-20 11:08:47 +01:00
Matthias Clasen
d758754f20 build: Lift gir and build_gir to toplevel
build_gir is used in multiple subdirectories,
so it is a bit nasty that it is defined in
one too.
2022-12-19 22:38:38 -05:00
Matthias Clasen
a920c0d2de Merge branch 'wip/gtk4-fix-delete-surrounding' into 'main'
gtkimcontextwayland: Convert byte based offset to char based offset in delete_surrounding_text

See merge request GNOME/gtk!5254
2022-12-20 02:40:14 +00:00
Alynx Zhou
ad83d616c4 gtkimcontextwayland: Convert byte based offset to char based offset in delete_surrounding_text
ClutterInputFocus/GtkIMContext uses char based offset for
delete_surrounding, however, text_input_v3 uses byte based offset for
it. Currently only GTK with mutter can work correctly via text_input_v3
because they both forget to convert between char based offset and byte
based offset.

This commit fixes it in GTK by converting byte based offset to char
based offset with the UTF-8 encoded surrounding text.

Fixes <https://gitlab.gnome.org/GNOME/gtk/-/issues/4566>.
2022-12-20 09:51:08 +08:00
António Fernandes
efbd228940 listbase: Cancel rubberband if not handling drag
If the drag events are claimed by another gesture (e.g. a GtkDragSource
in an item widget), list base still commits a rubberband selection, for
a rubberband which wasn't even visible yet. This is a problem for the
GNOME Files application which needs both rubberbanding and drag-n-drop.

My previous fix[0] was enough for the case where the event sequence is
claimed right before the first GtkDragGesture::drag-update emission,
but it's useless if the event is claimed later (e.g. after the drag
treashold), because a rubberband already exists by that time.

Therefore, the complete solution requres checking whether the event
sequence is no longer being handled by our gesture, and commit the
selection changes only if it is, but otherwise cleanup the rubberband.

This is what GtkFlowBox does already, so let's do the same here.

[0] commit dc4540fae9
2022-12-18 21:31:31 -10:00
Nirbheek Chauhan
cd77936265 meson: Fix find_program and subproject usage
Dummy dependencies are not required to execute a subproject
automatically for providing a program, nor do you need to explicitly
call subproject() to do that.

A `[provide]` section in the wrap file is enough.
2022-12-19 03:09:11 +05:30
sunflowerskater
6b71ccdb43 GtkFileChooser: Tweak Grid View & List View button tooltips
The tooltips from the Grid View & List View buttons are unnecessarily long and look different from the tooltips used in Nautilus.

This commit makes the tooltips to be consistent with Nautilus and, consequently, makes them shorter.
2022-12-17 18:21:10 -03:00
Christopher Davis
143229f829 gtkfiledialog: Allow devs to set custom accept labels
Accept labels can be used for additional context regarding
the purpose of a file. The old GtkFileChooser APIs allowed
developers to set it, but the initial FileDialog API was missing
this functionality.

This commit adds `gtk_file_dialog_set_accept_label ()` to
restore the missing functionality.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/5421
2022-12-16 10:16:52 -05:00
Luca Bacci
b563736b66 Include hicolor index.theme as a resource
index.theme file copied from upstream xdg/default-icon-theme
repository at tag 0.17:

https://gitlab.freedesktop.org/xdg/default-icon-theme/-/tree/0.17

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5303
2022-12-16 14:58:59 +01:00
Matthias Clasen
6cb5f20942 Silence a compiler warning 2022-12-16 00:12:44 -05:00
Matthias Clasen
2154460139 Merge branch 'no-portals' into 'main'
Add GDK_DEBUG=no-portals

Closes #5441

See merge request GNOME/gtk!5336
2022-12-15 16:27:33 +00:00
Matthias Clasen
ef17a44876 Merge branch 'deprecate-show-hide' into 'main'
Deprecate gtk_widget_show/hide

See merge request GNOME/gtk!5278
2022-12-15 14:53:48 +00:00
Matthias Clasen
8eace1c385 Merge branch 'check-button-radio-docs' into 'main'
gtkcheckbutton: Document how to keep track of changes for radio buttons

See merge request GNOME/gtk!5328
2022-12-15 00:25:08 +00:00