gtk4.git
2 years agoMerge branch 'bilelmoussaoui/gi-docs' into 'main'
Matthias Clasen [Mon, 27 Mar 2023 19:53:33 +0000 (19:53 +0000)]
Merge branch 'bilelmoussaoui/gi-docs' into 'main'

docs: Fix various broken links

See merge request GNOME/gtk!5734

2 years agoMerge branch 'wip/reset-repositioned-after-handling' into 'main'
Matthias Clasen [Mon, 27 Mar 2023 19:51:47 +0000 (19:51 +0000)]
Merge branch 'wip/reset-repositioned-after-handling' into 'main'

wayland/popup: Handle late received reposition feedback

See merge request GNOME/gtk!5735

2 years agodocs: Fix various broken links
Bilal Elmoussaoui [Mon, 27 Mar 2023 19:19:06 +0000 (21:19 +0200)]
docs: Fix various broken links

2 years agowayland/popup: Handle late received reposition feedback
Jonas Ådahl [Mon, 27 Mar 2023 19:27:44 +0000 (21:27 +0200)]
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.

2 years agoMerge branch 'ebassi/compute-size-annotation' into 'main'
Emmanuele Bassi [Mon, 27 Mar 2023 11:43:34 +0000 (11:43 +0000)]
Merge branch 'ebassi/compute-size-annotation' into 'main'

Remove wrong annotation for GdkToplevel::compute-size

See merge request GNOME/gtk!5725

2 years agoMerge branch 'wayland_display' into 'main'
Matthias Clasen [Mon, 27 Mar 2023 11:38:14 +0000 (11:38 +0000)]
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

2 years agowayland: Try to open the display even if XDG_RUNTIME_DIR is unset
Ludovico de Nittis [Mon, 27 Mar 2023 09:53:57 +0000 (11:53 +0200)]
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>
2 years agoMerge branch 'wip/otte/listview-inert' into 'main'
Benjamin Otte [Mon, 27 Mar 2023 05:48:12 +0000 (05:48 +0000)]
Merge branch 'wip/otte/listview-inert' into 'main'

listview: Add concept of inertness

See merge request GNOME/gtk!5731

2 years agogridview: Add concept of inertness
Benjamin Otte [Mon, 27 Mar 2023 05:03:38 +0000 (07:03 +0200)]
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.

2 years agolistview: Add concept of inertness
Benjamin Otte [Mon, 27 Mar 2023 04:54:10 +0000 (06:54 +0200)]
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.

2 years agolistfactorywidget: Stop trying to be smart
Benjamin Otte [Mon, 27 Mar 2023 02:53:48 +0000 (04:53 +0200)]
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.

2 years agogtk-demo: Set tab behavior for settings demo
Benjamin Otte [Mon, 27 Mar 2023 04:53:29 +0000 (06:53 +0200)]
gtk-demo: Set tab behavior for settings demo

2 years agomagnifier: Don't check for visibility
Benjamin Otte [Mon, 27 Mar 2023 04:23:35 +0000 (06:23 +0200)]
magnifier: Don't check for visibility

gtk_widget_queue_draw() already does that.

2 years agoMerge branch 'wip/otte/tab-behavior' into 'main'
Benjamin Otte [Sun, 26 Mar 2023 19:10:29 +0000 (19:10 +0000)]
Merge branch 'wip/otte/tab-behavior' into 'main'

listview: Add ::tab-behavior to list widgets

See merge request GNOME/gtk!5710

2 years agocolumnview: Add GtkColumnView::tab-behavior
Benjamin Otte [Fri, 24 Mar 2023 04:41:03 +0000 (05:41 +0100)]
columnview: Add GtkColumnView::tab-behavior

Also make sure that GTK_LIST_TAB_CELL works by implementing support for
it in the row widget.

2 years agogridview: Add GtkGridView::tab-behavior
Benjamin Otte [Fri, 24 Mar 2023 02:45:24 +0000 (03:45 +0100)]
gridview: Add GtkGridView::tab-behavior

2 years agolistview: Add GtkListView::tab-behavior
Benjamin Otte [Fri, 24 Mar 2023 02:00:02 +0000 (03:00 +0100)]
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.

2 years agoMerge branch 'scrolled-window-signal-disconnnect' into 'main'
Matthias Clasen [Sun, 26 Mar 2023 15:15:49 +0000 (15:15 +0000)]
Merge branch 'scrolled-window-signal-disconnnect' into 'main'

scrolledwindow: Disconnect the right handler

Closes #5684

See merge request GNOME/gtk!5726

2 years agoscrolledwindow: Disconnect the right handler
Matthias Clasen [Sun, 26 Mar 2023 14:55:08 +0000 (10:55 -0400)]
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
2 years agoRemove wrong annotation from GdkDragSurface::compute-size
Emmanuele Bassi [Sun, 26 Mar 2023 14:50:22 +0000 (15:50 +0100)]
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.

2 years agoRemove wrong annotation for GdkToplevel::compute-size
Emmanuele Bassi [Sun, 26 Mar 2023 14:48:44 +0000 (15:48 +0100)]
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.

2 years agoMerge branch 'wayland-startup-notification-crash' into 'main'
Matthias Clasen [Sun, 26 Mar 2023 14:36:57 +0000 (14:36 +0000)]
Merge branch 'wayland-startup-notification-crash' into 'main'

wayland: Don't crash without xdg_activation_v1

Closes #5701

See merge request GNOME/gtk!5724

2 years agowayland: Don't crash without xdg_activation_v1
Matthias Clasen [Sun, 26 Mar 2023 14:11:14 +0000 (10:11 -0400)]
wayland: Don't crash without xdg_activation_v1

If the compositor does not support this protocol,
we can't use it.

Fixes: #5701
2 years agoMerge branch 'wayland-cursor-size' into 'main'
Matthias Clasen [Sun, 26 Mar 2023 01:01:04 +0000 (01:01 +0000)]
Merge branch 'wayland-cursor-size' into 'main'

wayland: Don't crash on cursor size 0

Closes #5700

See merge request GNOME/gtk!5721

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sun, 26 Mar 2023 00:26:31 +0000 (00:26 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

popover: Fix typo

See merge request GNOME/gtk!5720

2 years agowayland: Don't crash on cursor size 0
Matthias Clasen [Sun, 26 Mar 2023 00:25:51 +0000 (20:25 -0400)]
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
2 years agogtk-demo: Rename dropdown demo
Benjamin Otte [Sun, 26 Mar 2023 00:01:29 +0000 (01:01 +0100)]
gtk-demo: Rename dropdown demo

It's the listview selections demo, so use that name.

2 years agogtk-demo: Rename image scaling demo to image_scaling
Benjamin Otte [Sat, 25 Mar 2023 23:53:20 +0000 (00:53 +0100)]
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.

2 years agopopover: Fix typo
Benjamin Otte [Sat, 25 Mar 2023 23:43:58 +0000 (00:43 +0100)]
popover: Fix typo

The typo causs gnome-shell to crah, which is somewhat suboptimal.

It was introduced in 1a9c7a4b1fb.

2 years agoMerge branch 'coordinate-docs' into 'main'
Matthias Clasen [Sat, 25 Mar 2023 21:21:00 +0000 (21:21 +0000)]
Merge branch 'coordinate-docs' into 'main'

docs: Add some cross references

See merge request GNOME/gtk!5719

2 years agoIncorporate review feedback
Matthias Clasen [Sat, 25 Mar 2023 20:22:45 +0000 (16:22 -0400)]
Incorporate review feedback

2 years agodocs: Use our own box model illustration
Matthias Clasen [Sat, 25 Mar 2023 20:16:34 +0000 (16:16 -0400)]
docs: Use our own box model illustration

This one has a dark mode too.

2 years agoTweak
Matthias Clasen [Sat, 25 Mar 2023 19:29:55 +0000 (15:29 -0400)]
Tweak

2 years agoTweak
Matthias Clasen [Sat, 25 Mar 2023 19:27:23 +0000 (15:27 -0400)]
Tweak

2 years agoMore review feedback
Matthias Clasen [Sat, 25 Mar 2023 19:26:33 +0000 (15:26 -0400)]
More review feedback

2 years agodocs: Add another cross reference
Matthias Clasen [Sat, 25 Mar 2023 19:06:19 +0000 (15:06 -0400)]
docs: Add another cross reference

Refer to the new coordinate system overview
from the GdkEvent docs.

2 years agodocs: Apply review feedback
Matthias Clasen [Sat, 25 Mar 2023 19:05:28 +0000 (15:05 -0400)]
docs: Apply review feedback

Clarify some points in the coordinate overview.

2 years agoDocs: Cosmetics
Matthias Clasen [Sat, 25 Mar 2023 16:17:20 +0000 (12:17 -0400)]
Docs: Cosmetics

Align section heading better. Now they all follow
the "Using GTK..." pattern.

2 years agodocs: Add some cross references
Matthias Clasen [Sat, 25 Mar 2023 16:16:51 +0000 (12:16 -0400)]
docs: Add some cross references

Refer to the new coordinate system overview
from a couple of places where it is useful.

2 years agodocs: Add a section about coordinate systems
Matthias Clasen [Sat, 25 Mar 2023 16:10:58 +0000 (12:10 -0400)]
docs: Add a section about coordinate systems

2 years agoMerge branch 'deprecate-translate-coordinates' into 'main'
Matthias Clasen [Sat, 25 Mar 2023 14:33:14 +0000 (14:33 +0000)]
Merge branch 'deprecate-translate-coordinates' into 'main'

Deprecate gtk_widget_translate_coordinates

Closes #5697

See merge request GNOME/gtk!5717

2 years agoDrop gtk_widget_get_surface_allocation
Matthias Clasen [Sat, 25 Mar 2023 13:48:12 +0000 (09:48 -0400)]
Drop gtk_widget_get_surface_allocation

This private api is confusing, and no longer used.

2 years agoentrycompletion: Stop using gtk_widget_get_surface_allocation
Matthias Clasen [Sat, 25 Mar 2023 13:46:34 +0000 (09:46 -0400)]
entrycompletion: Stop using gtk_widget_get_surface_allocation

We only need the width of the widgets' bounds
here anyway, so just use gtk_widget_compute_bounds.

2 years agopopover: Stop using gtk_widget_get_surface_allocation
Matthias Clasen [Sat, 25 Mar 2023 13:45:31 +0000 (09:45 -0400)]
popover: Stop using gtk_widget_get_surface_allocation

The function is going away, and the computation
here was wrong anyway. Instead, add a helper that
properly computes the pointing-to rect in surface
coordinates and use it everywhere.

2 years agoDeprecate gtk_widget_translate_coordinates
Matthias Clasen [Sat, 25 Mar 2023 13:20:47 +0000 (09:20 -0400)]
Deprecate gtk_widget_translate_coordinates

Update all (non-deprecated) callers to use
gtk_widget_compute_point instead.

Fixes: #5697
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sat, 25 Mar 2023 13:59:06 +0000 (13:59 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

testsuite: Add some GL texture tests

See merge request GNOME/gtk!5715

2 years agoMerge branch 'popover-bounds-trouble' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 22:59:05 +0000 (22:59 +0000)]
Merge branch 'popover-bounds-trouble' into 'main'

textview: Give the magnifier correct coordinates

Closes #5695

See merge request GNOME/gtk!5716

2 years agomagnifier: Correct position of area
Matthias Clasen [Fri, 24 Mar 2023 19:30:27 +0000 (15:30 -0400)]
magnifier: Correct position of area

The widget paintable uses the widgets bounds
as intrinsic size, so we need to offset from
that to the allocation, which is what the
coordinates are relative to.

2 years agotexthandle: Correct placement of handles
Matthias Clasen [Fri, 24 Mar 2023 18:49:18 +0000 (14:49 -0400)]
texthandle: Correct placement of handles

Text handles had the same problem as popovers.
They were interpreting their pointing-to rectangle
relative to the widgets bounds, when it is meant
to be relative to the widgtets allocation.

While we touch this code, rewrite it to use
gtk_widget_compute_point.

2 years agopopover: Correct placement of popovers
Matthias Clasen [Fri, 24 Mar 2023 18:47:27 +0000 (14:47 -0400)]
popover: Correct placement of popovers

When we don't have a pointing-to rectangle, we want to place
the popover wrt to the parents bounds. But if we have a
pointing-to rectangle, it is relative to the widgets allocation,
which is different from the bounds.

We were not handling the second case correctly, leading to context
menus in the text view being mispositioned by the widgets CSS padding.

While we are touching this code, rewrite it to handle transforms.

Fixes: #5695
2 years agotestsuite: Add some GL texture tests
Matthias Clasen [Fri, 24 Mar 2023 17:56:06 +0000 (13:56 -0400)]
testsuite: Add some GL texture tests

Tests creation and upload/download of GL
textures in various contexts.

2 years agotestsuite: Cosmetics
Matthias Clasen [Fri, 24 Mar 2023 16:33:44 +0000 (12:33 -0400)]
testsuite: Cosmetics

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 15:53:55 +0000 (15:53 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

Fix up criticals from GdkGLTexture

See merge request GNOME/gtk!5712

2 years agoMerge branch 'alternative-fix-5685' into 'main'
Chun-wei Fan [Fri, 24 Mar 2023 15:30:01 +0000 (15:30 +0000)]
Merge branch 'alternative-fix-5685' into 'main'

GDK/Win32: Use wgl* functions directly as needed (fix #5685)

Closes #5685

See merge request GNOME/gtk!5702

2 years agoFix up criticals from GdkGLTexture
Matthias Clasen [Fri, 24 Mar 2023 15:29:38 +0000 (11:29 -0400)]
Fix up criticals from GdkGLTexture

I broke this in 4291f27b562f58.
I overlooked that there may not be a current context.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 14:45:35 +0000 (14:45 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

docs: Some updates

See merge request GNOME/gtk!5711

2 years agodocs: Improve markup for keys
Matthias Clasen [Fri, 24 Mar 2023 13:42:25 +0000 (09:42 -0400)]
docs: Improve markup for keys

Consistently use <kbd>x</kbd> to render keys in the docs
and use + for key combinations.

2 years agodocs: Some updates
Matthias Clasen [Fri, 24 Mar 2023 12:56:06 +0000 (08:56 -0400)]
docs: Some updates

Fix some links ot point to docs.gtk.org.

2 years agoinspector: Cosmetics
Matthias Clasen [Fri, 24 Mar 2023 12:17:51 +0000 (08:17 -0400)]
inspector: Cosmetics

2 years agogtkgstsink.c: Drop workarounds needed for Windows
Chun-wei Fan [Fri, 24 Mar 2023 10:16:35 +0000 (18:16 +0800)]
gtkgstsink.c: Drop workarounds needed for Windows

Since we are making GdkGLContext call the core wgl*() functions directly
instead of via libepoxy, drop the workarounds that we needed for notifying
libepoxy that wglMakeCurrent() outside of GDK/GTK was called.

This way, we clean up the code, and as a result, we can use the GstGL
APIs like the other platforms to query what GL api that is to be used.

For ensuring that things work between different threads, we now call
gdk_gl_context_clear_current() in place of calling wglMakeCurrent(xxx,
NULL), so that we make sure that there is no current GL context on a
thread outside of GstGL's thread, which Windows does not like.

2 years agoGDK-Win32: Add wrapper functions for calling core wgl* functions
Chun-wei Fan [Fri, 24 Mar 2023 03:08:26 +0000 (11:08 +0800)]
GDK-Win32: Add wrapper functions for calling core wgl* functions

We might be dealing with GL contexts from different threads, which have more
gotchas when we are using libepoxy, so in case the function pointers for
these are invalidated by wglMakeCurrent() calls outside of GTK/GDK, such as
in GstGL, we want to use these functions that are directly linked to
opengl32.dll provided by the system/ICD, by linking to opengl32.lib.

This will ensure that we will indeed call the "correct" wgl* functions that
we need.

This should help fix issue #5685.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Fri, 24 Mar 2023 05:18:08 +0000 (05:18 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

listview: Activatable means activate

See merge request GNOME/gtk!5709

2 years agocolumnview: Don't infloop when a cell is grab_focus()ed
Benjamin Otte [Fri, 24 Mar 2023 01:53:42 +0000 (02:53 +0100)]
columnview: Don't infloop when a cell is grab_focus()ed

Whoopsie.

Broken since 30d4629043f.

2 years agolistview: Activatable means activate
Benjamin Otte [Thu, 23 Mar 2023 19:37:57 +0000 (20:37 +0100)]
listview: Activatable means activate

Fix a typo that prevented activatable widgets from activating since the
refactoring in 608be08b0d6.

2 years agoMerge branch 'mipmap-tracking' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 03:43:21 +0000 (03:43 +0000)]
Merge branch 'mipmap-tracking' into 'main'

gsk: Avoid copying GL texture in more cases

See merge request GNOME/gtk!5704

2 years agogsk: Avoid copying GL texture in more cases
Matthias Clasen [Thu, 23 Mar 2023 12:47:54 +0000 (08:47 -0400)]
gsk: Avoid copying GL texture in more cases

When the GL texture already has a mipmap, we don't
have to download and reupload it to generate one.

We differentiate the handling for texture scale nodes,
where we do want to force the mipmap creation even if
it requires us to reupload the GL texture, and plain
texture nodes, where we just take advantage of a
preexisting mipmap to allow trilinear filtering for
downscaling, or create one if we have to upload the
texture anyway.

2 years agogl: Add a private way to query mipmap status
Matthias Clasen [Thu, 23 Mar 2023 12:44:26 +0000 (08:44 -0400)]
gl: Add a private way to query mipmap status

Make GdkGLTexture determine if the texture has
a mipmap, and provide private API to query this
information.

This check is done in gdkgltexture.c instead of
gskgldriver.c, since we're already binding the
texture here for other reasons, so it is easy
to query a few more things.

2 years agoMerge branch 'check-widget-on-destruction' into 'main'
Matthias Clasen [Fri, 24 Mar 2023 03:03:31 +0000 (03:03 +0000)]
Merge branch 'check-widget-on-destruction' into 'main'

gtkwidget: Do a type-check in gtk_widget_in_destruction()

See merge request GNOME/gtk!5708

2 years agogltexture: Try harder to determine the format
Matthias Clasen [Fri, 24 Mar 2023 02:56:06 +0000 (22:56 -0400)]
gltexture: Try harder to determine the format

We can query these things as long as the texture ID
is valid in the current context.

2 years agogtkwidget: Do a type-check in gtk_widget_in_destruction()
Marco Trevisan (Treviño) [Fri, 24 Mar 2023 02:29:53 +0000 (03:29 +0100)]
gtkwidget: Do a type-check in gtk_widget_in_destruction()

Given it can be called during a widget destruction, it's safer to do a
type-check before crashing.

See: https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1727

2 years agoUpdate Chinese (China) translation
Boyuan Yang [Thu, 23 Mar 2023 18:46:30 +0000 (18:46 +0000)]
Update Chinese (China) translation

2 years agoMerge branch 'fix-a11y-leak2' into 'main'
Emmanuele Bassi [Thu, 23 Mar 2023 11:07:18 +0000 (11:07 +0000)]
Merge branch 'fix-a11y-leak2' into 'main'

Don't leak all AT contexts

Closes #5690

See merge request GNOME/gtk!5700

2 years agoMerge branch 'wip/otte/listview-cleanups' into 'main'
Benjamin Otte [Thu, 23 Mar 2023 05:38:29 +0000 (05:38 +0000)]
Merge branch 'wip/otte/listview-cleanups' into 'main'

listview refactoring and new stuff

See merge request GNOME/gtk!5701

2 years agocolumnview: Handle focus movement properly
Benjamin Otte [Thu, 23 Mar 2023 03:37:29 +0000 (04:37 +0100)]
columnview: Handle focus movement properly

- grab_focus() on a row (happens with scroll_to()) keeps the focus
  column intact if possible.
- <Tab> and <Shift-Tab> move through the cells in order, and move
  to the next row when at the end.
- <Up> an <Down> move to the next/prev row, keeping the same column
  focused.
- <Left> and <Right> move to the prev/next cell, if one is available.
  If not, they stay where they are.

2 years agocolumnview: add a (private) focus-column
Benjamin Otte [Thu, 23 Mar 2023 02:35:04 +0000 (03:35 +0100)]
columnview: add a (private) focus-column

Make setting the focus column scroll to it, too.

2 years agocolumnviewrowwidget: Handle left/right arrow keys
Benjamin Otte [Tue, 21 Mar 2023 13:08:14 +0000 (14:08 +0100)]
columnviewrowwidget: Handle left/right arrow keys

Make it move focus just like GtkWindow would.

Otherwise the listview will (try to) handle it and move focus between
cells - which doesn't do anything for lists and only works with grids.

2 years agolistbase: Only grab_focus() if the cursor moved
Benjamin Otte [Tue, 21 Mar 2023 12:47:24 +0000 (13:47 +0100)]
listbase: Only grab_focus() if the cursor moved

If there is no movement, grab_focus() on the already focused widget
just causes weird inconsistencies and we don't want those.

2 years agocolumnviewrow: Handle focus movement properly
Benjamin Otte [Tue, 21 Mar 2023 12:43:35 +0000 (13:43 +0100)]
columnviewrow: Handle focus movement properly

Handle backwards tab properly and deal with left right arrows.

2 years agolistitemwidget: Only take a single child
Benjamin Otte [Wed, 15 Mar 2023 01:12:33 +0000 (02:12 +0100)]
listitemwidget: Only take a single child

2 years agocolumnviewrowwidget: Drop unneeded stuff
Benjamin Otte [Mon, 13 Mar 2023 16:39:52 +0000 (17:39 +0100)]
columnviewrowwidget: Drop unneeded stuff

Also remove the GtkColumnListItemFactory and GtkColumnViewLayout
objects by folding them into GtkColumnViewRowWidget.

2 years agocolumnview: Add GtkColumnViewRowWidget
Benjamin Otte [Mon, 13 Mar 2023 04:04:29 +0000 (05:04 +0100)]
columnview: Add GtkColumnViewRowWidget

This is a copy/paste of GtkListItemWidget for now.

Modifications will happen in future commits.

2 years agolistview: Add private GtkListFactoryWidget
Benjamin Otte [Mon, 20 Mar 2023 05:15:18 +0000 (06:15 +0100)]
listview: Add private GtkListFactoryWidget

This is a split of GtkListItemWidget into the generic parts of factory
using widgets.

On top of it there's GtkListItemWidget, which takes care of GtkListItem.

2 years agolistview: Move ::factory out of the item manager
Benjamin Otte [Sun, 12 Mar 2023 21:03:03 +0000 (22:03 +0100)]
listview: Move ::factory out of the item manager

It's a listitemwidget property, and the item manager manages the items,
not the widgets.

2 years agolistview: Move ::single-click-activate out of the item manager
Benjamin Otte [Sun, 12 Mar 2023 20:54:07 +0000 (21:54 +0100)]
listview: Move ::single-click-activate out of the item manager

It's a listitemwidget property, and the item manager manages the items,
not the widgets.

2 years agolistitemmanager: Create widgets via vfunc
Benjamin Otte [Sun, 12 Mar 2023 17:36:57 +0000 (18:36 +0100)]
listitemmanager: Create widgets via vfunc

We now have listitemmanager just create GtkListItemBase objects via
vfunc and use them.

2 years agolistitemwidget: split out GtkListItemBase
Benjamin Otte [Sun, 12 Mar 2023 04:05:48 +0000 (05:05 +0100)]
listitemwidget: split out GtkListItemBase

There's 2 reasons for this:

1. Adding a custom widget for columnview rows
2. Using this as base class for sections

2 years agoitemmananger: Remove the user data
Benjamin Otte [Sun, 12 Mar 2023 00:13:37 +0000 (01:13 +0100)]
itemmananger: Remove the user data

Use the widget instead. They're the same anyway.

2 years agolistbase: Privatize 2 functions
Benjamin Otte [Sat, 11 Mar 2023 16:22:36 +0000 (17:22 +0100)]
listbase: Privatize 2 functions

They're not used outside of GtkListBase, so no use to have them in the
header.

Requires moving one function up in the source now that the forward
declaration is missing.

2 years agolistitemmanager: Clean up header
Benjamin Otte [Sat, 11 Mar 2023 16:41:06 +0000 (17:41 +0100)]
listitemmanager: Clean up header

Remove all unused functions and an unused macro.

2 years agoDon't leak all AT contexts
Matthias Clasen [Thu, 23 Mar 2023 03:41:40 +0000 (23:41 -0400)]
Don't leak all AT contexts

create_at_context was confused - it stored a reference
to the newly created context in priv->context, but then
also returned a reference, and the caller stored that
in priv->context again.

Change it to only return a reference.

Fixes: #5690
2 years agoMerge branch 'texture-scale-test' into 'main'
Matthias Clasen [Thu, 23 Mar 2023 02:42:28 +0000 (02:42 +0000)]
Merge branch 'texture-scale-test' into 'main'

gsk: Add a test for scaled textures

See merge request GNOME/gtk!5686

2 years agoUpdate British English translation
Bruce Cowan [Wed, 22 Mar 2023 15:46:17 +0000 (15:46 +0000)]
Update British English translation

(cherry picked from commit d80cecec06c5196bad93be38cc11db86715cca77)

2 years agoMerge branch 'ebassi/ensure-file-chooser-types' into 'main'
Matthias Clasen [Wed, 22 Mar 2023 10:48:55 +0000 (10:48 +0000)]
Merge branch 'ebassi/ensure-file-chooser-types' into 'main'

Ensure GtkFileChooserCell's type

See merge request GNOME/gtk!5696

2 years agoEnsure GtkFileChooserCell's type
Emmanuele Bassi [Wed, 22 Mar 2023 10:23:28 +0000 (10:23 +0000)]
Ensure GtkFileChooserCell's type

Otherwise anything that dlopen()'s GTK will have a bad day.

See: https://discourse.gnome.org/t/strange-filechooserdialog-behaviour-in-gtk-4-10/14435

2 years agogsk: Improve slice handling
Matthias Clasen [Wed, 22 Mar 2023 03:26:55 +0000 (23:26 -0400)]
gsk: Improve slice handling

Upload slices in chunks, instead of copying
enormous amounts of memory.

2 years agogsk: Add more flexible texture upload
Matthias Clasen [Wed, 22 Mar 2023 02:55:03 +0000 (22:55 -0400)]
gsk: Add more flexible texture upload

Add a command queue function to create a
GL texture by uploading several GdkTextures
at given positions.
This lets us 'piece together' textures.

2 years agogsk: Tweak one test to pass
Matthias Clasen [Tue, 21 Mar 2023 02:43:35 +0000 (22:43 -0400)]
gsk: Tweak one test to pass

Clip away the problematic corners in this
artificial texture scaling test. The GL renderer
has problems getting them perfect.

2 years agogsk: Drop debug code
Matthias Clasen [Tue, 21 Mar 2023 01:49:42 +0000 (21:49 -0400)]
gsk: Drop debug code

2 years agogsk: Drop some unused arguments
Matthias Clasen [Tue, 21 Mar 2023 02:02:17 +0000 (22:02 -0400)]
gsk: Drop some unused arguments

All callers of the slice apis pass 0 for
min_rows and min_cols. So just drop these.

2 years agogsk: Use overlapping slices
Matthias Clasen [Mon, 20 Mar 2023 11:57:13 +0000 (07:57 -0400)]
gsk: Use overlapping slices

Store texture coordinates for each slice
instead of assuming 0,0,1,1, and generate
overlapping slices to allow for proper mipmaps.

This almost fixes trilinear filtering with
sliced textures.