Commit Graph

74602 Commits

Author SHA1 Message Date
Arjan Molenaar
1bc63eeadb macos: Queue events during drag
By passing the events during a (midal-ish) drag operation to the main loop,
we're able to keep up with what's happening. This allows the internal
drag state (GtkDragSource) to be updated and be done when the drag is
done.
2023-01-16 14:47:49 +01:00
Arjan Molenaar
1d8a23e97b macos: Provide fallback pasteboard for gtype Dnd
The Drag data should pass through the macos pasteboard system.
We need to provide some pasteboard type. Let's make it a "URL",
which is a pretty generic type anyway.
2023-01-15 10:03:47 +01:00
Arjan Molenaar
422b4b6561 macos: No need to drag handle events
This is handled by the DraggingSource object.
2023-01-15 10:03:47 +01:00
Arjan Molenaar
27ee8b23fd macos: No need to grab a seat
The macOS DnD logic will take over anyway.
2023-01-15 10:03:47 +01:00
Arjan Molenaar
b9847795a7 macos: Support dragging from GdkMacosWindow
The handling is done similar to drag targets.
Note that dragging is a modal action on macos: no events
are sent to the main window. This could cause trouble when
we finish the drag, and not finish the gesture in GTK.
2023-01-15 10:01:56 +01:00
Arjan Molenaar
420be8fb0f macos: run glib idle functions when in nested run loop
It looks like DnD starts a nested run loop. We still have to run our
GLib handlers, so animations work.
2023-01-13 20:03:55 +01:00
Christian Hergert
9c3629653f macos: abstract pasteboard for use in clipboard and drag
This will allow us to share a single NSPasteboardItem and data provider
implementation for both GdkClipboard and GdkDrag.
2023-01-13 20:03:55 +01:00
Christian Hergert
eb5cf831b1 macos: refactor pasteboard components into separate module
This will make it easier to reuse from drag integration so that we don't
require clipboards for everything.

We will need to subclass the pasteboard provider twice, however, both
for clipboard and dragging.
2023-01-13 20:03:55 +01:00
Matthias Clasen
b92e52bf0e Merge branch 'matthiasc/for-main' into 'main'
css: Avoid some allocations

See merge request GNOME/gtk!5413
2023-01-12 15:20:49 +00: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
Emin Tufan Çetin
5f75ba46a5 Update Turkish translation 2023-01-11 07:01:44 +00:00
Emin Tufan Çetin
2507301983 Update Turkish translation 2023-01-11 05:41:40 +00:00
Matthias Clasen
41aeff331d texthistory: Avoid g_autofree
msvc does not like it, unfortunately.
2023-01-10 22:20:57 -05:00
Matthias Clasen
3aab48ec16 Merge branch 'wip/chergert/fix-5506' into 'main'
istring: fix istring_prepend() on malloc transition

Closes #5506

See merge request GNOME/gtk!5411
2023-01-11 02:39:32 +00: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
Matthias Clasen
0e1ae6ad11 Merge branch 'matthiasc/for-main' into 'main'
Add some more text undo tests

See merge request GNOME/gtk!5410
2023-01-10 19:05:13 +00:00
Aleksandr Melman
5baf4b4b2e Update Russian translation 2023-01-10 12:57:03 +00:00
Matthias Clasen
63560061e8 Add some more text undo tests
Unsuccessfully trying to reproduce #5506.
2023-01-10 07:34:55 -05:00
Matthias Clasen
be721f5797 Merge branch 'matthiasc/for-main' into 'main'
Deprecate gdk_display_put_event

See merge request GNOME/gtk!5409
2023-01-09 21:15:08 +00:00
Matthias Clasen
0073bb79a7 Deprecate gdk_display_put_event
The documentation already tells you not to
use this function.

Ifdef the remaining users in the X11 backend.
2023-01-09 15:46:25 -05:00
Matthias Clasen
f59b506674 Merge branch 'macos-stable-dnd' into 'main'
macos: Drag and drop should not freeze applications

See merge request GNOME/gtk!5291
2023-01-09 11:52:50 +00:00
Matthias Clasen
88b4404296 Merge branch 'wip/corey/popover-accel' into 'main'
gtkmodelbutton: Ensure that accel label is always aligned to end

Closes #5504

See merge request GNOME/gtk!5407
2023-01-09 10:58:14 +00: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
Emmanuele Bassi
6b5b7eab04 Merge branch 'doc-improvements' into 'main'
Two docs improvements

See merge request GNOME/gtk!5406
2023-01-08 22:16:49 +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
dd3cdc52f5 Fix code style 2023-01-08 14:41:11 +00:00
Matthias Clasen
5a3156a8b7 gdk: Update docs
Update the docs for gdk_display_get_monitor_at_surface.
2023-01-07 21:35:29 -05:00
Matthias Clasen
a4c2f19155 Merge branch 'gdk-display-get-monitor-is-nullable' into 'main'
gdkdisplay: Document get_monitor_at_surface can return NULL

Closes #5075

See merge request GNOME/gtk!4917
2023-01-07 20:39:04 +00: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
Matthias Clasen
52c97dbf67 Merge branch 'win-file-ext' into 'main'
filechoosernativewin32: Set default extension

See merge request GNOME/gtk!5266
2023-01-07 18:14:37 +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