Commit Graph

77852 Commits

Author SHA1 Message Date
Michael Catanzaro
653c10e8b6 printoperation: add some assertions
Let's assert that we schedule the idle callback exactly once.

These assertions are not perfect because if the callback executes before
we schedule it, then the assertion itself would be a use-after-free,
since I'm using the PrinterFinder to track whether the callback that
frees it has been scheduled. But in practice when using loupe's print
dialog, I was noticing the callback scheduled twice before it was
executed. The assertion would have caught this problem.
2023-09-26 19:25:41 -05:00
Michael Catanzaro
dfbafdf047 printoperation: fix another case where operation may complete twice
This is a little tricky. At first, I thought we had a codepath where we
fail to schedule the idle that completes the print operation: if we take
the gtk_print_backend_printer_list_is_done path for each printer
backend, then printer_list_done_cb() is never executed and we never
schedule the idle. But in fact, in this case, then backends == NULL at
the bottom of find_printer(), and we'll schedule the idle there, so it's
OK. Except it's not really OK, because we'll schedule it even if a
printer was already found, resulting in the callback completing twice
and a double free.

Simplify this. Schedule the idle in find_printer() only if there are
*initially* no backends, not also if all backends are immediately ready
and already removed from consideration. Instead, always call
printer_list_done_cb() for every backend in find_printer_init(). After
the previous commit, printer_list_done_cb() will schedule the idle when
appropriate.

printer_list_done_cb() additionally disconnects signals that we did not
connect in this codepath, but it does so using
g_signal_handlers_disconnect_by_func, which is harmless. Otherwise, the
only extra work it's doing is scheduling the idle, and that's exactly
what find_printer_init() is missing.
2023-09-26 19:08:46 -05:00
Michael Catanzaro
d8c821a851 printoperation: fix case where operation may complete multiple twice
If we are the final backend, then after removing ourselves there is no
backend remaining. We will schedule the idle even if it has already been
scheduled. This idle is required to run exactly once and executing it
twices results in a double free that crashes loupe when printing. It
also causes the user callback to execute twice, which could cause
similar problems.

Fixes #6122
2023-09-26 18:47:01 -05:00
Emmanuele Bassi
79ebd76ac8 Merge branch 'wip/chergert/fix-gdkarrayimpl-from-c++' into 'main'
gdk: add missing G_END_DECLS to gdkarrayimpl.c

See merge request GNOME/gtk!6435
2023-09-26 18:48:02 +00:00
Christian Hergert
6eb9836eb0 gdk: add missing G_END_DECLS to gdkarrayimpl.c 2023-09-26 10:46:21 -07:00
Matthias Clasen
4a8f8a6eea Merge branch 'broadway-renderer-leak' into 'main'
broadway: Plug a leak in the GSK renderer

Closes #6120

See merge request GNOME/gtk!6434
2023-09-26 15:13:38 +00:00
Emmanuele Bassi
3ea723730b broadway: Do not add an extra reference when caching textures
We just created a GdkTexture, so we don't need to acquire a reference if
we're transferring the ownership to the node cache.
2023-09-26 14:44:05 +01:00
Emmanuele Bassi
90be2baf8b broadway: Plug another leak
When getting a colorized texture we're downloading the texture as a
Cairo surface, and then feeding it to another texture, but we never drop
the reference of the new surface.
2023-09-26 14:40:37 +01:00
Emmanuele Bassi
0b64fa88a1 docs: Clarify the behaviour of gdk_texture_new_for_surface()
Cairo surfaces are not GObject instances, so we should be more explicit
in the behaviour of the memory management, to avoid leaks.
2023-09-26 12:57:52 +01:00
Emmanuele Bassi
c6cc446e63 broadway: Plug a leak in the GSK renderer
We are leaking the Cairo image surface when creating a new node.

Fixes: #6120
2023-09-26 12:49:32 +01:00
Benjamin Otte
0cad37760e Merge branch 'wip/otte/for-main' into 'main'
treeview: Fix crash in assertion

Closes #6114

See merge request GNOME/gtk!6433
2023-09-26 09:29:08 +00:00
Benjamin Otte
e720008dca glcontext: Add gdk_gl_context_get_glsl_version_string()
This is in preparation for the new renderer.
2023-09-26 11:08:59 +02:00
Benjamin Otte
9c636a6136 array: Compute new size properly
Using "1 << x" means that we are shifting a signed 32bit integer, but we
want a gsize, which is an unsigned 64bit integer.

So now we don't overflow anymore if the array reaches a size of 2GB.
2023-09-26 11:08:59 +02:00
Benjamin Otte
1e24aa425e gdk: Fix compiler warning
gcc's -Wlto-type-mismatch found the hack, where we copied the wrong
prototype.
2023-09-26 11:08:59 +02:00
Benjamin Otte
a8c597005a treeview: Fix crash in assertion
The fix in commit a267dfac5d is wrong.
The function can return FALSE in normal operation.

Instead do a check for node == NULL that gracefully returns FALSE instead.

Fixes: #6114
2023-09-26 11:08:32 +02:00
Aurimas Černius
97a781b380 Update Lithuanian translation
(cherry picked from commit 61276e9a76)
2023-09-25 19:58:12 +00:00
Rafael Fontenelle
313cadefe6 Update Brazilian Portuguese translation
(cherry picked from commit 90b8dcdf33)
2023-09-25 12:58:47 +00:00
Matthias Clasen
8ff4e27103 Merge branch 'wip/alice/dialog-crash' into 'main'
dialog: Check header bar type before calling track_default_decoration()

Closes #6116

See merge request GNOME/gtk!6430
2023-09-24 13:24:49 +00:00
Matthias Clasen
8389ca633d Merge branch 'matthiasc/for-main' into 'main'
tests: Split off some path utilities

See merge request GNOME/gtk!6431
2023-09-24 13:07:45 +00:00
Matthias Clasen
18fbec0fe1 Improve FOO_DEBUG=help output
Explain the all value a bit better.
2023-09-24 08:33:22 -04:00
Alice Mikhaylenko
eb0a00067d dialog: Check header bar type before calling track_default_decoration()
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/6116
2023-09-24 15:38:19 +04:00
Alice Mikhaylenko
91216408e5 header-bar: Add a precondition to track_default_decoration() 2023-09-24 15:21:55 +04:00
Matthias Clasen
6da5b8cb25 tests: Split off some path utilities
Thes can be reused in different test sources.
2023-09-23 15:28:35 -04:00
Kristjan SCHMIDT
7bee7bf5fc Update Esperanto translation
(cherry picked from commit ecc42c506b)
2023-09-23 16:41:38 +00:00
Danial Behzadi
fac66ade01 Update Persian translation 2023-09-23 15:29:04 +00:00
Matthias Clasen
96eae5f62e Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Fix a refcounting mishap

Closes #6113

See merge request GNOME/gtk!6427
2023-09-23 13:20:04 +00:00
Matthias Clasen
1cc99847f4 Deprecate gtk_window_present_with_time
It is often difficult or impossible to get a suitable
timestamp. Instead, we should do the right thing in
the simpler API.

See #6095
2023-09-23 08:06:47 -04:00
Matthias Clasen
d8b14cd3e3 gtk-demo: Fix a refcounting mishap
gtk_font_dialog_button_new's argument is
transfer full.

Fixes: #6113
2023-09-23 07:47:09 -04:00
Matthias Clasen
0c80eb5afb Merge branch 'matthiasc/for-main' into 'main'
Remove sysprof leftovers

See merge request GNOME/gtk!6425
2023-09-22 22:01:31 +00:00
Matthias Clasen
fdcb1d92c5 Remove sysprof leftovers
This is a followup to 5dd0d39a6b.
2023-09-22 17:33:09 -04:00
Matthias Clasen
d65dc6c730 Merge branch 'matthiasc/for-main' into 'main'
path-tool: Fix the restrict command

See merge request GNOME/gtk!6424
2023-09-22 00:21:22 +00:00
Matthias Clasen
c721c4d6ef path-tool: Fix the restrict command 2023-09-21 15:36:25 -04:00
Matthias Clasen
1a7ba3c512 Merge branch 'update-cursor-images' into 'main'
docs: Update cursor images

See merge request GNOME/gtk!6422
2023-09-21 18:54:04 +00:00
Matthias Clasen
25ee1a7784 Merge branch 'drop-performance-tests' into 'main'
Drop performance tests

Closes #6112

See merge request GNOME/gtk!6421
2023-09-21 17:59:08 +00:00
kramo
0b2cebe3d8
docs: Update cursor images 2023-09-21 19:51:11 +02:00
Matthias Clasen
5dd0d39a6b Drop performance tests
These were an experient, and not actively used,
and libsysprof has been changing api so they broke.

Fixes: #6112
2023-09-21 13:14:48 -04:00
Matthias Clasen
9f3ff427c1 Merge branch 'matthiasc/for-main' into 'main'
contour: Simplify add_segment for circles

See merge request GNOME/gtk!6420
2023-09-21 16:51:37 +00:00
Matthias Clasen
14e60d21ac ci: Skip the headless tests
Despite waiting for a long time, these still
regularly time out on slow runners.
2023-09-21 12:17:47 -04:00
Matthias Clasen
65c3796135 Merge branch 'ebassi/doc-fixes' into 'main'
docs: Add a link to the DropDown:selected property

See merge request GNOME/gtk!6419
2023-09-21 15:50:50 +00:00
Matthias Clasen
25acc26531 contour: Simplify add_segment for circles
We no longer need to translate path points.
2023-09-21 11:40:25 -04:00
Emmanuele Bassi
859bf8b15d docs: Mention for what GtkStringObject:string is useful 2023-09-21 15:28:37 +01:00
Emmanuele Bassi
e0bf96f329 docs: Link GtkStringObject from GtkStringList
A frequently asked question is: "what is the object type inside a
GtkStringList", so let's make the answer more obvious.
2023-09-21 15:27:35 +01:00
Emmanuele Bassi
11c5ea1fec docs: Add a link to the DropDown:selected property
The main description is a bit too coy, and some newcomers don't
understand the concept of properties and notification.
2023-09-21 15:20:46 +01:00
Daniel Rusek
bc063350ef Update Czech translation 2023-09-21 12:42:28 +00:00
Luca Bacci
347b0317e5 Merge branch 'fix-issue-6080' into 'main'
GdkWin32: Unref GdkMonitor after calling gdk_monitor_invalidate ()

Closes #6080

See merge request GNOME/gtk!6411
2023-09-21 12:41:55 +00:00
Matthias Clasen
72d832a4f3 Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Update some ifdefed code

See merge request GNOME/gtk!6416
2023-09-21 02:53:33 +00:00
Matthias Clasen
76df3ade18 gtk-demo: Update some ifdefed code
This was from a time when we had arcs.
2023-09-20 22:12:09 -04:00
Matthias Clasen
d849a53b98 contour: Fix get_closest_point for circles 2023-09-20 22:11:47 -04:00
Matthias Clasen
ef6d3af6b9 Merge branch 'revert-sassc-wrapdb' into 'main'
Revert "build-aux/flatpak: use sassc from wrapdb"

See merge request GNOME/gtk!6415
2023-09-20 22:46:33 +00:00
Christoph Reiter
f513914306 Revert "meson: Move libsass/sassc subprojects to use wrapdb"
This reverts commit 7eb999720a.
2023-09-19 21:28:28 +02:00