Commit Graph

75463 Commits

Author SHA1 Message Date
Matthias Clasen
a8d8724a02 gdk: Avoid a pointless indirection
Don't use g_fprintf if GLib is using system printf
anyway.
2023-03-27 21:56:41 -04:00
Matthias Clasen
a2d20a5dc0 docs: Some tweaks 2023-03-27 21:55:36 -04:00
Matthias Clasen
cacecd2fb5 Improve an error message
We were producing a misleading error message
when gtk_init() fails.

Fixes: #5704
2023-03-27 21:44:56 -04:00
Matthias Clasen
321877e94b gdk: Improve logging for backends
Log more when trying backends.
2023-03-27 21:42:10 -04:00
Benjamin Otte
ffb5d129f9 Merge branch 'wip/otte/for-main' into 'main'
clenaup

See merge request GNOME/gtk!5736
2023-03-27 22:28:07 +00:00
Benjamin Otte
51e3a1c7d2 columnviewcell: Remove root/unroot stuff
Instead, do that work on creation/dispose.

This is a followup to 3fb10ff2d8.
2023-03-27 23:37:01 +02:00
Benjamin Otte
706e1c2f6f columnviewcell: Remove "visible" property setting
Since 7ad693f865 we only create cells for
visible rows and don't just toggle visibility.

This is a leftover from that change.
2023-03-27 23:37:01 +02:00
Benjamin Otte
a44847e81e enums: Move G_END_DECLS to the end of the file 2023-03-27 23:37:01 +02:00
Matthias Clasen
68d629f84d Merge branch 'bilelmoussaoui/gi-docs' into 'main'
docs: Fix various broken links

See merge request GNOME/gtk!5734
2023-03-27 19:53:33 +00:00
Matthias Clasen
f002e23a37 Merge branch 'wip/reset-repositioned-after-handling' into 'main'
wayland/popup: Handle late received reposition feedback

See merge request GNOME/gtk!5735
2023-03-27 19:51:47 +00:00
Bilal Elmoussaoui
d1c43b94ef docs: Fix various broken links 2023-03-27 21:29:08 +02:00
Jonas Ådahl
c88f2caa04 wayland/popup: Handle late received reposition feedback
If we map, reposition, unmap, remap, the reposition feedback from the
last time a popup was mapped might be received while we're dealing with
the new version of the popup. At this point, the old reposition token
has no meating, so lets drop it. Also reset the reposition tokens when
creating new protocol objects, so that the reposition token are as if
we're in the initial state.

This fixes an issue where we'd get stuck if repeatedly smashing a button
that'd create popups that'd immediately get dismissed by the compositor.
2023-03-27 21:27:44 +02:00
Emmanuele Bassi
506206e1bd Merge branch 'ebassi/compute-size-annotation' into 'main'
Remove wrong annotation for GdkToplevel::compute-size

See merge request GNOME/gtk!5725
2023-03-27 11:43:34 +00:00
Matthias Clasen
cb298fbe23 Merge branch 'wayland_display' into 'main'
wayland: Try to open the display even if XDG_RUNTIME_DIR is unset

See merge request GNOME/gtk!5732
2023-03-27 11:38:14 +00:00
Ludovico de Nittis
d2672db648 wayland: Try to open the display even if XDG_RUNTIME_DIR is unset
Since Wayland 1.15, it is now possible to use absolute paths in
"WAYLAND_DISPLAY".
In that scenario, having a valid "XDG_RUNTIME_DIR" is not a requirement
anymore.

For this reason we remove the "XDG_RUNTIME_DIR" check and we let
`wl_display_connect()` decide if our environment is correct.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2023-03-27 11:53:57 +02:00
Benjamin Otte
3008f4babc Merge branch 'wip/otte/listview-inert' into 'main'
listview: Add concept of inertness

See merge request GNOME/gtk!5731
2023-03-27 05:48:12 +00:00
Benjamin Otte
aba1be6faf gridview: Add concept of inertness
An inert gridview is a gridview that does not use the factory. This
allows faster updates because no calls into user code need to happen.

A gridview is inert when either:
 - It is not rooted.
 - It is not visible.
 - No factory is set (that one is obvious)

The gridview does not need to be inert without a model, as that case is
handled by the item manager.

This should allow Nautilus to keep both the gridview and the columnview
around, and just gtk_widget_hide() the unused widget.

The code for now does not disable the item manager, as some
functionality of the item manager is required to allow setting scroll
positions and such.
But that is a place where more gains could be found if profiling showed
that was useful to do.
2023-03-27 07:08:44 +02:00
Benjamin Otte
62e9d1e470 listview: Add concept of inertness
An inert listview is a listview that does not use the factory. This
allows faster updates because no calls into user code need to happen.

A listview is inert when either:
 - It is not rooted.
 - It is not visible.
 - No factory is set (that one is obvious)

The listview does not need to be inert without a model, as that case is
handled by the item manager.

This should allow Nautilus to keep both the gridview and the columnview
around, and just gtk_widget_hide() the unused widget.

The code for now does not disable the item manager, as some
functionality of the item manager is required to allow setting scroll
positions and such.
But that is a place where more gains could be found if profiling showed
that was useful to do.
2023-03-27 07:08:44 +02:00
Benjamin Otte
3fb10ff2d8 listfactorywidget: Stop trying to be smart
The widget would teardown the factory on unroot to avoid unnecessary
work when it isn't shown.

However, recycling may reposition widgets, and repositioning widgets
does a unroot/root.

We don't want to recycle widgets then.
2023-03-27 07:08:44 +02:00
Benjamin Otte
924fd195ab gtk-demo: Set tab behavior for settings demo 2023-03-27 07:08:44 +02:00
Benjamin Otte
66cb79f62e magnifier: Don't check for visibility
gtk_widget_queue_draw() already does that.
2023-03-27 07:08:44 +02:00
Benjamin Otte
8cf3a95d8c Merge branch 'wip/otte/tab-behavior' into 'main'
listview: Add ::tab-behavior to list widgets

See merge request GNOME/gtk!5710
2023-03-26 19:10:29 +00:00
Benjamin Otte
0f55defe56 columnview: Add GtkColumnView::tab-behavior
Also make sure that GTK_LIST_TAB_CELL works by implementing support for
it in the row widget.
2023-03-26 20:29:47 +02:00
Benjamin Otte
8b0731b34f gridview: Add GtkGridView::tab-behavior 2023-03-26 20:29:47 +02:00
Benjamin Otte
c0ca71e9f4 listview: Add GtkListView::tab-behavior
The implementation lives (as always) in GtkListBase.

This is a feature request from the Nautilus developers, who currently do
some hacks to emulate that behavior and it apparently only breaks
sometimes.
2023-03-26 20:29:47 +02:00
Matthias Clasen
c86cf6340e Merge branch 'scrolled-window-signal-disconnnect' into 'main'
scrolledwindow: Disconnect the right handler

Closes #5684

See merge request GNOME/gtk!5726
2023-03-26 15:15:49 +00:00
Matthias Clasen
844a4bab8d scrolledwindow: Disconnect the right handler
We connect gtk_scrolled_window_update_use_indicators
as signal handler in realize(), but we were disconnecting
gtk_scrolled_window_sync_use_indicators in unrealize.

Spotted by Milan Crha.

Fixes: #5684
2023-03-26 10:57:01 -04:00
Emmanuele Bassi
8dddddfe8c Remove wrong annotation from GdkDragSurface::compute-size
Just like GdkToplevel::compute-size, the size argument of the signal is
given to the handlers by GDK; it's not an out argument meant to be
allocated by the caller.
2023-03-26 15:50:22 +01:00
Emmanuele Bassi
a08c31e71f Remove wrong annotation for GdkToplevel::compute-size
The size argument is passed to the signal by the GDK surface machinery,
as is: it's not going to be allocated by the caller (since it's a
signal), and it's not an out argument.
2023-03-26 15:48:44 +01:00
Matthias Clasen
3cdb639210 Merge branch 'wayland-startup-notification-crash' into 'main'
wayland: Don't crash without xdg_activation_v1

Closes #5701

See merge request GNOME/gtk!5724
2023-03-26 14:36:57 +00:00
Matthias Clasen
3a5282abe1 wayland: Don't crash without xdg_activation_v1
If the compositor does not support this protocol,
we can't use it.

Fixes: #5701
2023-03-26 10:11:14 -04:00
Matthias Clasen
a70b85ef76 Merge branch 'wayland-cursor-size' into 'main'
wayland: Don't crash on cursor size 0

Closes #5700

See merge request GNOME/gtk!5721
2023-03-26 01:01:04 +00:00
Benjamin Otte
e27b3f1eae Merge branch 'wip/otte/for-main' into 'main'
popover: Fix typo

See merge request GNOME/gtk!5720
2023-03-26 00:26:31 +00:00
Matthias Clasen
7adbbe6f35 wayland: Don't crash on cursor size 0
The cursor-theme-size setting is documented as
'0 means the default size'. Make it so by using
size 24 if we see a 0. Its better than crashing.

Fixes: #5700
2023-03-25 20:25:51 -04:00
Benjamin Otte
5973df22aa gtk-demo: Rename dropdown demo
It's the listview selections demo, so use that name.
2023-03-26 01:06:18 +01:00
Benjamin Otte
32ff37f070 gtk-demo: Rename image scaling demo to image_scaling
This just means renaming the C file, but it makes --run=image_scaling
actually do what I'd expect.
2023-03-26 01:02:17 +01:00
Benjamin Otte
da9b19804d popover: Fix typo
The typo causs gnome-shell to crah, which is somewhat suboptimal.

It was introduced in 1a9c7a4b1f.
2023-03-26 01:02:17 +01:00
Matthias Clasen
13b0ed08a3 Merge branch 'coordinate-docs' into 'main'
docs: Add some cross references

See merge request GNOME/gtk!5719
2023-03-25 21:21:00 +00:00
Matthias Clasen
a9e37c6f2c Incorporate review feedback 2023-03-25 16:22:45 -04:00
Matthias Clasen
3d35b848d1 docs: Use our own box model illustration
This one has a dark mode too.
2023-03-25 16:16:34 -04:00
Matthias Clasen
de3b37d80c Tweak 2023-03-25 15:29:55 -04:00
Matthias Clasen
1e5dd5db71 Tweak 2023-03-25 15:27:23 -04:00
Matthias Clasen
7bd0fbb47e More review feedback 2023-03-25 15:26:33 -04:00
Matthias Clasen
0efd6cd23e docs: Add another cross reference
Refer to the new coordinate system overview
from the GdkEvent docs.
2023-03-25 15:06:19 -04:00
Matthias Clasen
2e26932925 docs: Apply review feedback
Clarify some points in the coordinate overview.
2023-03-25 15:05:28 -04:00
Matthias Clasen
0b3c979719 Docs: Cosmetics
Align section heading better. Now they all follow
the "Using GTK..." pattern.
2023-03-25 12:17:20 -04:00
Matthias Clasen
653749e4ae docs: Add some cross references
Refer to the new coordinate system overview
from a couple of places where it is useful.
2023-03-25 12:16:51 -04:00
Matthias Clasen
63ed2a13bf docs: Add a section about coordinate systems 2023-03-25 12:10:58 -04:00
Matthias Clasen
3f93a51146 Merge branch 'deprecate-translate-coordinates' into 'main'
Deprecate gtk_widget_translate_coordinates

Closes #5697

See merge request GNOME/gtk!5717
2023-03-25 14:33:14 +00:00
Matthias Clasen
78c8e58ee8 Drop gtk_widget_get_surface_allocation
This private api is confusing, and no longer used.
2023-03-25 10:14:35 -04:00