gtk4.git
2 years agoinspector: Be safer when handling actions
Matthias Clasen [Fri, 7 Apr 2023 12:52:51 +0000 (08:52 -0400)]
inspector: Be safer when handling actions

Those query apis are serious about not ignoring
their return value, and may not set their our
arguments to anything if they return FALSE.

2 years agoactionmuxer: Make the compiler warn
Matthias Clasen [Fri, 7 Apr 2023 12:02:44 +0000 (08:02 -0400)]
actionmuxer: Make the compiler warn

Warn when the boolean return isn't used, since we
may not initialize the out arguments in the FALSE
case (see the previous commits).

2 years agotextview: Handle a return value
Matthias Clasen [Fri, 7 Apr 2023 11:56:16 +0000 (07:56 -0400)]
textview: Handle a return value

2 years agoMerge branch '5729_fix_inspector_crash' into 'main'
Matthias Clasen [Fri, 7 Apr 2023 12:01:22 +0000 (12:01 +0000)]
Merge branch '5729_fix_inspector_crash' into 'main'

inspector: fix crash caused by uninitialized GVariant

Closes #5729

See merge request GNOME/gtk!5799

2 years agoinspector: fix crash caused by uninitialized GVariant
Nelson Benítez León [Thu, 6 Apr 2023 22:45:59 +0000 (18:45 -0400)]
inspector: fix crash caused by uninitialized GVariant

we were not checking the return gboolean of
gtk_action_muxer_query_action() which was
returning FALSE for the crash case, meaning
it didn't set the passed in GVariant, but
we were still using it as it was non-null.

Fixes #5729

2 years agoMerge branch 'media-controls' into 'main'
Matthias Clasen [Thu, 6 Apr 2023 17:59:54 +0000 (17:59 +0000)]
Merge branch 'media-controls' into 'main'

mediacontrols: Add tooltip text to play button

See merge request GNOME/gtk!5794

2 years agoMerge branch 'alert_dialog_role_mapping_fix' into 'main'
Matthias Clasen [Thu, 6 Apr 2023 17:59:05 +0000 (17:59 +0000)]
Merge branch 'alert_dialog_role_mapping_fix' into 'main'

a11y: Map GTK_ACCESSIBLE_ROLE_ALERT_DIALOG to ATSPI_ROLE_ALERT

See merge request GNOME/gtk!5796

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Thu, 6 Apr 2023 15:06:26 +0000 (15:06 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

glarea: Fix property notification

See merge request GNOME/gtk!5797

2 years agoglarea: Fix property notification
Matthias Clasen [Thu, 6 Apr 2023 14:37:58 +0000 (10:37 -0400)]
glarea: Fix property notification

This was broken in 9c26262e3e083006.

2 years agomediacontrols: Add tooltip text to play button
Maximiliano Sandoval R [Thu, 6 Apr 2023 10:10:11 +0000 (12:10 +0200)]
mediacontrols: Add tooltip text to play button

This makes the button accessible.

2 years agoa11y: Map GTK_ACCESSIBLE_ROLE_ALERT_DIALOG to ATSPI_ROLE_ALERT
Lukáš Tyrychtr [Thu, 6 Apr 2023 11:55:16 +0000 (13:55 +0200)]
a11y: Map GTK_ACCESSIBLE_ROLE_ALERT_DIALOG to ATSPI_ROLE_ALERT

By doing this, alert dialogs will be read automatically, or at least
they should be, because a screen reader know that these are special.

2 years agoMerge branch 'wip/exalm/centerlayout-shrink' into 'main'
Matthias Clasen [Wed, 5 Apr 2023 22:23:19 +0000 (22:23 +0000)]
Merge branch 'wip/exalm/centerlayout-shrink' into 'main'

centerlayout/box: Add :shrink-center-last

See merge request GNOME/gtk!5790

2 years agoMerge branch 'wip/exalm/shortcuts' into 'main'
Matthias Clasen [Wed, 5 Apr 2023 22:05:33 +0000 (22:05 +0000)]
Merge branch 'wip/exalm/shortcuts' into 'main'

Add style classes to standard dialogs

See merge request GNOME/gtk!5791

2 years agopagesetupunixdialog: Add "pagesetup" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:11:48 +0000 (00:11 +0400)]
pagesetupunixdialog: Add "pagesetup" style class

2 years agofontchooserdialog: Add "fontchooser" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:11:31 +0000 (00:11 +0400)]
fontchooserdialog: Add "fontchooser" style class

2 years agofilechooserdialog: Add "filechooser" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:10:54 +0000 (00:10 +0400)]
filechooserdialog: Add "filechooser" style class

2 years agocolorchooserdialog: Add "colorchooser" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:10:36 +0000 (00:10 +0400)]
colorchooserdialog: Add "colorchooser" style class

2 years agoappchooserdialog: Add "appchooser" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:10:25 +0000 (00:10 +0400)]
appchooserdialog: Add "appchooser" style class

2 years agoshortcutswindow: Add "shortcuts" style class
Alexander Mikhaylenko [Wed, 5 Apr 2023 20:10:09 +0000 (00:10 +0400)]
shortcutswindow: Add "shortcuts" style class

2 years agocenterbox: Expose GtkCenterLayout:shrink-center-last
Alexander Mikhaylenko [Wed, 5 Apr 2023 12:05:03 +0000 (16:05 +0400)]
centerbox: Expose GtkCenterLayout:shrink-center-last

2 years agocenterlayout: Add :shrink-center-last
Alexander Mikhaylenko [Wed, 5 Apr 2023 12:03:48 +0000 (16:03 +0400)]
centerlayout: Add :shrink-center-last

Allow to prioritize start and end children and have them keep their natural
size instead of center child if possible.

See https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5552#note_1708864

2 years agoMerge branch 'ebassi/listbox-dispose' into 'main'
Matthias Clasen [Wed, 5 Apr 2023 02:35:20 +0000 (02:35 +0000)]
Merge branch 'ebassi/listbox-dispose' into 'main'

listbox: Unbind the model before removing children

See merge request GNOME/gtk!5789

2 years agolistbox: Unbind the model before removing children
Emmanuele Bassi [Tue, 4 Apr 2023 12:40:49 +0000 (13:40 +0100)]
listbox: Unbind the model before removing children

Calling gtk_list_box_remove_all() is a no-op with a bound model; after
the introduction of the remove_all() method in 49e56fc7, we were left
with row widgets after the dispose() call chained up.

We could restore the explicit unparenting inside dispose() instead of
calling remove_all(), but since the bound list model is provided by the
user of GtkListBox, it's more appropriate to unbind it in the dispose()
implementation, to avoid any potential reference cycle (especially in
higher level languages that have no explicit reference acquisition).

We clean up the bound model, and its associated state, if any; and then
we remove all the row widgets that are left.

2 years agoMerge branch 'glarea-allowed-apis' into 'main'
Matthias Clasen [Tue, 4 Apr 2023 03:14:21 +0000 (03:14 +0000)]
Merge branch 'glarea-allowed-apis' into 'main'

glarea: Add GtkGLArea::allowed-apis

Closes #5330

See merge request GNOME/gtk!5786

2 years agogtk-demo: Update the GLArea examples
Matthias Clasen [Mon, 3 Apr 2023 23:26:12 +0000 (19:26 -0400)]
gtk-demo: Update the GLArea examples

2 years agoglarea: Add GtkGLArea::allowed-apis
Matthias Clasen [Mon, 3 Apr 2023 23:24:58 +0000 (19:24 -0400)]
glarea: Add GtkGLArea::allowed-apis

Add api that mirrors the new GdkGLContext api
for selecting OpenGL variants, and deprecate
the old use_es api.

Fixes: #5330
2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Tue, 4 Apr 2023 02:50:08 +0000 (02:50 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

expander: Fix the css docs

Closes #5723

See merge request GNOME/gtk!5787

2 years agoMerge branch 'node-editor-things' into 'main'
Matthias Clasen [Tue, 4 Apr 2023 02:47:39 +0000 (02:47 +0000)]
Merge branch 'node-editor-things' into 'main'

Revert "rendernodepaintable: Provide accurate aspect ratio"

See merge request GNOME/gtk!5788

2 years agonode-editor: Improve the scaling
Matthias Clasen [Tue, 4 Apr 2023 02:32:31 +0000 (22:32 -0400)]
node-editor: Improve the scaling

We only want to scale the main rendering, not whats
shown in the sidebar. Also, make the scale logarithmic.

2 years agorendernodepaintable: Preserve aspect ratio in snapshot()
Matthias Clasen [Tue, 4 Apr 2023 02:19:39 +0000 (22:19 -0400)]
rendernodepaintable: Preserve aspect ratio in snapshot()

This is the better fix.

2 years agoRevert "rendernodepaintable: Provide accurate aspect ratio"
Matthias Clasen [Tue, 4 Apr 2023 02:16:43 +0000 (22:16 -0400)]
Revert "rendernodepaintable: Provide accurate aspect ratio"

This reverts commit 52a849288793e7eede878798a88760c058266f60.

It turned out to be the wrong fix.

2 years agoexpander: Fix the css docs
Matthias Clasen [Mon, 3 Apr 2023 23:33:31 +0000 (19:33 -0400)]
expander: Fix the css docs

The docs were not matching reality since the
css node names were changed in 6d20fe0b.

Fixes: #5723
2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Mon, 3 Apr 2023 18:14:51 +0000 (18:14 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

rendernode: Remove instance_init() function

See merge request GNOME/gtk!5785

2 years agoMerge branch 'bilelmoussaoui/return-fix' into 'main'
Matthias Clasen [Mon, 3 Apr 2023 18:04:08 +0000 (18:04 +0000)]
Merge branch 'bilelmoussaoui/return-fix' into 'main'

gtk: Fix *_get_tab_behaviour return type

See merge request GNOME/gtk!5784

2 years agorendernode: Cosmetics
Benjamin Otte [Mon, 3 Apr 2023 14:44:03 +0000 (16:44 +0200)]
rendernode: Cosmetics

Simplify a function.

2 years agorendernode: Get rid of GskRenderNodeTypeInfo
Benjamin Otte [Mon, 3 Apr 2023 14:39:52 +0000 (16:39 +0200)]
rendernode: Get rid of GskRenderNodeTypeInfo

Instead, use class_init functions.

2 years agorendernode: Remove instance_init() function
Benjamin Otte [Mon, 3 Apr 2023 13:00:29 +0000 (15:00 +0200)]
rendernode: Remove instance_init() function

It's not used.

2 years agogtk: Fix *_get_tab_behaviour return type
Bilal Elmoussaoui [Mon, 3 Apr 2023 16:55:04 +0000 (18:55 +0200)]
gtk: Fix *_get_tab_behaviour return type

2 years agoPost-release version bump
Matthias Clasen [Mon, 3 Apr 2023 14:54:11 +0000 (10:54 -0400)]
Post-release version bump

2 years ago4.11.1
Matthias Clasen [Mon, 3 Apr 2023 14:40:16 +0000 (10:40 -0400)]
4.11.1

2 years agoNEWS: Updates
Matthias Clasen [Mon, 3 Apr 2023 14:36:40 +0000 (10:36 -0400)]
NEWS: Updates

2 years agoAdd comment on versions
Matthias Clasen [Mon, 3 Apr 2023 10:50:52 +0000 (06:50 -0400)]
Add comment on versions

Some versions are specfied in multiple places.
Add a reminder to update all places.

2 years agoMerge branch 'gbsneto/vulkan-layout-fixes' into 'main'
Benjamin Otte [Mon, 3 Apr 2023 14:27:24 +0000 (14:27 +0000)]
Merge branch 'gbsneto/vulkan-layout-fixes' into 'main'

Vulkan fractional scale support, image layout and clip region fixes, cleanups

See merge request GNOME/gtk!5783

2 years agovulkan: Support fractional scaling
Georges Basile Stavracas Neto [Mon, 3 Apr 2023 13:39:25 +0000 (10:39 -0300)]
vulkan: Support fractional scaling

Basically what GL does, but without any debug or feature flag
to gatekeep it, since the Vulkan backend itself is experimental
already.

Ceil surface sizes, and floor coordinates, to the fractional scale
value.

2 years agogsk/vulkan/renderpass: Don't scale scissor and render area
Georges Basile Stavracas Neto [Mon, 3 Apr 2023 13:06:18 +0000 (10:06 -0300)]
gsk/vulkan/renderpass: Don't scale scissor and render area

The rects passed to the clip region are in buffer coordinates, and
must not be scaled. Consider the following scenario: Wayland, with
a 1024x768@2 window. That gives us a 2048x1536 raw image. To setup
the Vulkan render pass code, we'd scale 2048x1536 *again*, to an
unreasonable 4196x3072, which is (1) incorrect and (2) really
incorrect and (3) can lead to crashes at best, full GPU resets
at worst - and a GPU reset is incredibly not fun!

Now that we pass the right clip regions at the right coordinates
at all times, remove the extra scaling from the render pass.

2 years agogsk/vulkan: Cosmetics
Georges Basile Stavracas Neto [Mon, 3 Apr 2023 11:54:34 +0000 (08:54 -0300)]
gsk/vulkan: Cosmetics

No functional changes. Use a variable that already exists instead
of calling gdk_draw_context_get_surface() again. Cleanup some
newlines.

2 years agogsk/vulkan/renderer: Pass appropriate clip region
Georges Basile Stavracas Neto [Sun, 2 Apr 2023 22:18:24 +0000 (19:18 -0300)]
gsk/vulkan/renderer: Pass appropriate clip region

This part of the Vulkan renderer is almost exactly equal to the GL
renderer, and the GL renderer already does that since at least
2a38cecd3351. Copy that into the Vulkan renderer.

A nice side effect from this commit is that resizing a window now
actually works again.

Sneak in a trivial cleanup by using a variable to hold the draw
index.

2 years agogsk/vulkan/buffer: Pass aligned memory value
Georges Basile Stavracas Neto [Sun, 2 Apr 2023 21:23:21 +0000 (18:23 -0300)]
gsk/vulkan/buffer: Pass aligned memory value

This was a tricky one to figure out, but it's pretty simple to
understand (I hope!).

So, this AMD card I'm using requires buffer memory sizes to be
aligned to 16 bytes. Intel is aligned to 4 bytes I think, but
AMD - or at least this AMD model in particular - uses 16 bytes
for alignment.

When creating a a particular texture (I did not determin which one
specifically!) a buffer of size 1276 bytes is requested.

1276 / 16 = 79.75, which is clearly not aligned to the required
16 bytes.

We request Vulkan to create a buffer of 1276 bytes for us, it
figures out that it's not aligned, and creates a buffer of 1280
bytes, which is aligned. The extra 4 bytes are wasted, but that's
okay. We immediately query this buffer for this exact information,
using vkGetBufferMemoryRequirements(), and proceed to create actual
memory to back this buffer up.

The buffer tells us we must use 1280 bytes, so we pass 1280 bytes
and everyone is happy, right? Of course not. We pass 1276 bytes,
and Vulkan is subtly unhappy at us.

Fix that by passing the value that Vulkan asks us to use, i.e.,
the size returned by vkGetBufferMemoryRequirements().

2 years agogsk/vulkan/glyphcache: Ceil glyph surface size
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 19:09:06 +0000 (16:09 -0300)]
gsk/vulkan/glyphcache: Ceil glyph surface size

This is what GL does, and for a reason: it can lead to width or
height for very small glyphs. Also, switch to dividing by a float
(1024.0) instead of an integer (1024).

2 years agogsk/vulkanimage: Set buffer row length and height
Georges Basile Stavracas Neto [Thu, 23 Mar 2023 02:01:10 +0000 (23:01 -0300)]
gsk/vulkanimage: Set buffer row length and height

This doesn't make any difference now, but will allow us to copy
subregions more easily. This is not obvious, but here's a quick
explanation:

Leaving 'bufferRowLength' and 'bufferImageHeight' implies that
Vulkan will assume the size passed in the 'imageExtent' field.
Right now, this assumption is correct - the only user of this
function is the glyph cache, and it only copies and uploads
exact rects. Next commits will change that assumption, so we
must pass 'buffer*' fields, and tell Vulkan, "this part of the
buffer represents an image of width x height, and I want the
subregion (x, y, smallerWidth, smallerHeight) of this image".

2 years agogsk/vulkan/image: Use UNDEFINED for initial layout
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 18:33:10 +0000 (15:33 -0300)]
gsk/vulkan/image: Use UNDEFINED for initial layout

When creating an image using gsk_vulkan_image_new_for_framebuffer(),
it passes VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL.

However, this is a mistake. The spec demands that the initial
layout must be either VK_IMAGE_LAYOUT_UNDEFINED or
VK_IMAGE_LAYOUT_PREINITIALIZED.

Apparently this was an oversight from commit b97fb751469, since the
commit message even documents that, and all other calls pass either
VK_IMAGE_LAYOUT_UNDEFINED or VK_IMAGE_LAYOUT_PREINITIALIZED.

Create framebuffer images using VK_IMAGE_LAYOUT_UNDEFINED, which is
what was originally expected.

2 years agoMerge branch 'listbox-remove-all' into 'main'
Matthias Clasen [Mon, 3 Apr 2023 10:29:13 +0000 (10:29 +0000)]
Merge branch 'listbox-remove-all' into 'main'

gtklistbox: Add remove_all()

See merge request GNOME/gtk!5779

2 years agoMerge branch 'zbrown/bump-protocols' into 'main'
Matthias Clasen [Mon, 3 Apr 2023 10:28:44 +0000 (10:28 +0000)]
Merge branch 'zbrown/bump-protocols' into 'main'

build: We need wayland-protocols 1.31

See merge request GNOME/gtk!5780

2 years agoUpdate Russian translation
Aleksandr Melman [Mon, 3 Apr 2023 07:29:46 +0000 (07:29 +0000)]
Update Russian translation

2 years agobuild: We need wayland-protocols 1.31
Zander Brown [Mon, 3 Apr 2023 01:12:54 +0000 (01:12 +0000)]
build: We need wayland-protocols 1.31

https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5767

2 years agogtkflowbox: Add remove_all()
Christopher Davis [Wed, 29 Sep 2021 22:20:37 +0000 (15:20 -0700)]
gtkflowbox: Add remove_all()

Removing all items from containers is a common use case.
Without this applications needed to implement this manually.
It makes senses to handle it here.

2 years agogtklistbox: Add remove_all()
Christopher Davis [Wed, 29 Sep 2021 21:26:49 +0000 (14:26 -0700)]
gtklistbox: Add remove_all()

Adds a function to remove all children from
a GtkListBox. This way app developers don't need to
implement this themselves.

2 years agogsk/vulkan/image: Cosmetics
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 18:27:43 +0000 (15:27 -0300)]
gsk/vulkan/image: Cosmetics

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Sun, 2 Apr 2023 19:14:05 +0000 (19:14 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

tooltipwindow: Cast the correct object

See merge request GNOME/gtk!5774

2 years agoMerge branch 'docs-updates' into 'main'
Matthias Clasen [Sun, 2 Apr 2023 18:43:55 +0000 (18:43 +0000)]
Merge branch 'docs-updates' into 'main'

docs: Document new environment variables

See merge request GNOME/gtk!5777

2 years agotooltipwindow: Cast the correct object
Benjamin Otte [Sun, 2 Apr 2023 12:06:11 +0000 (14:06 +0200)]
tooltipwindow: Cast the correct object

the tooltipwindow is in the userdata.

2 years agoMerge branch 'scale-factor-cleanup' into 'main'
Matthias Clasen [Sun, 2 Apr 2023 18:09:26 +0000 (18:09 +0000)]
Merge branch 'scale-factor-cleanup' into 'main'

wayland: Be more careful about scale-factor

See merge request GNOME/gtk!5775

2 years agoNEWS: Updates
Matthias Clasen [Sun, 2 Apr 2023 17:54:42 +0000 (13:54 -0400)]
NEWS: Updates

2 years agodocs: Document new environment variables
Matthias Clasen [Sun, 2 Apr 2023 17:52:56 +0000 (13:52 -0400)]
docs: Document new environment variables

Add GSK_MAX_TEXTURE_SIZE and GDK_DEBUG=gl-fractional
to the docs.

2 years agoMerge branch 'ccook/gtkiter-doc-changes' into 'main'
Matthias Clasen [Sun, 2 Apr 2023 17:43:03 +0000 (17:43 +0000)]
Merge branch 'ccook/gtkiter-doc-changes' into 'main'

Documentation corrections for GtkTextIter

See merge request GNOME/gtk!5776

2 years agowayland: Be more careful about scale-factor
Matthias Clasen [Sun, 2 Apr 2023 17:23:19 +0000 (13:23 -0400)]
wayland: Be more careful about scale-factor

Only emit notify::scale-factor if it actually
changes. This potentially avoids a lot of work
in GTK (reloading icons, etc).

2 years agodocs: Add some details
Matthias Clasen [Sun, 2 Apr 2023 17:17:36 +0000 (13:17 -0400)]
docs: Add some details

2 years agoDocumentation corrections for GtkTextIter
Cam Cook [Sun, 2 Apr 2023 17:12:21 +0000 (13:12 -0400)]
Documentation corrections for GtkTextIter

| method                                                                                                     | current                                                       | suggestion                                                      |
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|-----------------------------------------------------------------|
| [backward_visible_cursor_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3785) | "Moves @iter forward to the previous visible cursor position" | "Moves @iter backward to the previous visible cursor position." |
| [get_offset](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L595)                        | "Use [method@Gtk,TextBuffer.get_iter_at_offset]"              | "Use [method@Gtk.TextBuffer.get_iter_at_offset]"                |
| [starts_tag](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L1201)                       | "returns %TRUE, [method@Gtk.TextIter.has_tag"                 | "returns %TRUE, [method@Gtk.TextIter.has_tag] "                 |

| method                                                                                                 | current                                             | suggestion                                                |
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------------|
| [backward_cursor_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3715)     | "Like gtk_text_iter_forward_cursor_position()"      | "Like [method@Gtk.TextIter.forward_cursor_position]"      |
| [backward_find_char](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L4483)           | "Same as gtk_text_iter_forward_find_char()"         | "Same as [method@Gtk.TextIter.forward_find_char]"         |
| [backward_search](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L5295)              | "Same as gtk_text_iter_forward_search()"            | "Same as [method@Gtk.TextIter.forward_search]"            |
| [backward_sentence_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3611)     | "Calls gtk_text_iter_backward_sentence_start()"     | "Calls [method@Gtk.TextIter.backward_sentence_start]"     |
| [backward_visible_word_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3421) | "Calls gtk_text_iter_backward_visible_word_start()" | "Calls [method@Gtk.TextIter.backward_visible_word_start]" |
| [backward_word_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3345)         | "Calls gtk_text_iter_backward_word_start()"         | "Calls [method@Gtk.TextIter.backward_word_start]"         |
| [forward_sentence_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3591)        | "Calls gtk_text_iter_forward_sentence_end()"        | "Calls [method@Gtk.TextIter.forward_sentence_end]"        |
| [forward_to_end](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L4131)               | "gtk_text_iter_get_char() called on"                | "[method@Gtk.TextIter.get_char] called on"                |
| [forward_visible_word_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3403)    | "Calls gtk_text_iter_forward_visible_word_end()"    | "Calls [method@Gtk.TextIter.forward_visible_word_end]"    |
| [forward_word_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3327)            | "Calls gtk_text_iter_forward_word_end()"            | " Calls [method@Gtk.TextIter.forward_word_end]"           |
| [is_end](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L1664)                       | "gtk_text_iter_is_end() is the most efficient"      | "[method@Gtk.TextIter.is_end] is the most efficient"    |
| [set_line_index](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3900)               | "Same as gtk_text_iter_set_line_offset()"           | "Same as [method@Gtk.TextIter.set_line_offset]"         |
| [set_visible_line_index](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3987)       | "Like gtk_text_iter_set_line_index()"               | "Like [method@Gtk.TextIter.set_line_index]"             |
| [set_visible_line_offset](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3946)      | "Like gtk_text_iter_set_line_offset()"              | "Like [method@Gtk.TextIter.set_line_offset]"            |

2 years agoNEWS: Updates
Matthias Clasen [Sun, 2 Apr 2023 17:05:34 +0000 (13:05 -0400)]
NEWS: Updates

2 years agoMerge branch 'dropdown-inertness' into 'main'
Benjamin Otte [Sun, 2 Apr 2023 16:59:10 +0000 (16:59 +0000)]
Merge branch 'dropdown-inertness' into 'main'

dropdown: Fix to work with recent listview changes

See merge request GNOME/gtk!5773

2 years agoDocumentation corrections for GtkTextIter
Cam Cook [Sun, 2 Apr 2023 16:51:29 +0000 (12:51 -0400)]
Documentation corrections for GtkTextIter

| method                                                                                                     | current                                                       | suggestion                                                      |
|------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------|-----------------------------------------------------------------|
| [backward_visible_cursor_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3785) | "Moves @iter forward to the previous visible cursor position" | "Moves @iter backward to the previous visible cursor position." |
| [get_offset](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L595)                        | "Use [method@Gtk,TextBuffer.get_iter_at_offset]"              | "Use [method@Gtk.TextBuffer.get_iter_at_offset]"                |
| [starts_tag](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L1201)                       | "returns %TRUE, [method@Gtk.TextIter.has_tag"                 | "returns %TRUE, [method@Gtk.TextIter.has_tag] "                 |

| method                                                                                                 | current                                             | suggestion                                                |
|--------------------------------------------------------------------------------------------------------|-----------------------------------------------------|-----------------------------------------------------------|
| [backward_cursor_position](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3715)     | "Like gtk_text_iter_forward_cursor_position()"      | "Like [method@Gtk.TextIter.forward_cursor_position]"      |
| [backward_find_char](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L4483)           | "Same as gtk_text_iter_forward_find_char()"         | "Same as [method@Gtk.TextIter.forward_find_char]"         |
| [backward_search](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L5295)              | "Same as gtk_text_iter_forward_search()"            | "Same as [method@Gtk.TextIter.forward_search]"            |
| [backward_sentence_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3611)     | "Calls gtk_text_iter_backward_sentence_start()"     | "Calls [method@Gtk.TextIter.backward_sentence_start]"     |
| [backward_visible_word_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3421) | "Calls gtk_text_iter_backward_visible_word_start()" | "Calls [method@Gtk.TextIter.backward_visible_word_start]" |
| [backward_word_starts](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3345)         | "Calls gtk_text_iter_backward_word_start()"         | "Calls [method@Gtk.TextIter.backward_word_start]"         |
| [forward_sentence_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3591)        | "Calls gtk_text_iter_forward_sentence_end()"        | "Calls [method@Gtk.TextIter.forward_sentence_end]"        |
| [forward_to_end](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L4131)               | "gtk_text_iter_get_char() called on"                | "[method@Gtk.TextIter.get_char] called on"                |
| [forward_visible_word_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3403)    | "Calls gtk_text_iter_forward_visible_word_end()"    | "Calls [method@Gtk.TextIter.forward_visible_word_end]"    |
| [forward_word_ends](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3327)            | "Calls gtk_text_iter_forward_word_end()"            | " Calls [method@Gtk.TextIter.forward_word_end]"           |
| [is_end](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L1664)                       | "gtk_text_iter_is_end() is the most efficient"      | "[method@Gtk.TextBuffer.is_end] is the most efficient"    |
| [set_line_index](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3900)               | "Same as gtk_text_iter_set_line_offset()"           | "Same as [method@Gtk.TextBuffer.set_line_offset]"         |
| [set_visible_line_index](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3987)       | "Like gtk_text_iter_set_line_index()"               | "Like [method@Gtk.TextBuffer.set_line_index]"             |
| [set_visible_line_offset](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtktextiter.c#L3946)      | "Like gtk_text_iter_set_line_offset()"              | "Like [method@Gtk.TextBuffer.set_line_offset]"            |

2 years agodropdown: Fix to work with recent listview changes
Matthias Clasen [Sun, 2 Apr 2023 16:36:03 +0000 (12:36 -0400)]
dropdown: Fix to work with recent listview changes

Introduce our own 'inertness' for the list item widget
that shows the selected value inside the button.

2 years agoMerge branch 'gl-fractional-scale' into 'main'
Matthias Clasen [Sun, 2 Apr 2023 15:29:32 +0000 (15:29 +0000)]
Merge branch 'gl-fractional-scale' into 'main'

Make fractional scaling work with the GL renderer

See merge request GNOME/gtk!5770

2 years agoMake fractional scaling for GL opt-in
Matthias Clasen [Sun, 2 Apr 2023 14:24:37 +0000 (10:24 -0400)]
Make fractional scaling for GL opt-in

Fractional scaling with the GL renderer is
experimental for now, so we disable it unless
GDK_DEBUG=gl-fractional is set.

This will give us time to work out the kinks.

2 years agoMerge branch 'matthiasc/for-main' into 'main'
Matthias Clasen [Sun, 2 Apr 2023 15:02:24 +0000 (15:02 +0000)]
Merge branch 'matthiasc/for-main' into 'main'

examples: Update for deprecations

See merge request GNOME/gtk!5772

2 years agoUse fractional scale for the GL renderer
Matthias Clasen [Sun, 2 Apr 2023 02:52:13 +0000 (22:52 -0400)]
Use fractional scale for the GL renderer

This commit combines changes in the Wayland backend,
the GL context frontend, and the GL renderer to switch
them all to use the fractional scale.

In the Wayland backend, we now use the fractional scale
to size the EGL window.

In the GL frontend code, we use the fractional scale to
scale the damage region and surface in begin/end_frame.

And in the GL renderer, we replace gdk_surface_get_scale_factor()
with gdk_surface_get_scale().

2 years agogsk: Cosmetics
Matthias Clasen [Sun, 2 Apr 2023 02:54:19 +0000 (22:54 -0400)]
gsk: Cosmetics

Rename scale_factor to scale in various places,
now that it is no longer an int but a float.

2 years agogsk: Pass scale as float to the command queue
Matthias Clasen [Sun, 2 Apr 2023 02:48:38 +0000 (22:48 -0400)]
gsk: Pass scale as float to the command queue

2 years agoexamples: Update for deprecations
Matthias Clasen [Sun, 2 Apr 2023 13:06:02 +0000 (09:06 -0400)]
examples: Update for deprecations

Stop using gdk_surface_create_similar_surface here.

2 years agoMerge branch 'deprecate-similar-surface' into 'main'
Matthias Clasen [Sun, 2 Apr 2023 10:55:15 +0000 (10:55 +0000)]
Merge branch 'deprecate-similar-surface' into 'main'

popover: Stop using gdk_surface_create_similar_surface

See merge request GNOME/gtk!5771

2 years agoUpdate Ukrainian translation
Yuri Chornoivan [Sun, 2 Apr 2023 06:19:55 +0000 (06:19 +0000)]
Update Ukrainian translation

2 years agoDeprecate gdk_surface_create_similar_surface
Matthias Clasen [Sun, 2 Apr 2023 03:09:19 +0000 (23:09 -0400)]
Deprecate gdk_surface_create_similar_surface

This function is part of the cairo drawing API and
we are moving away from that. Update all callers.

2 years agopopover: Stop using gdk_surface_create_similar_surface
Matthias Clasen [Sun, 2 Apr 2023 03:08:36 +0000 (23:08 -0400)]
popover: Stop using gdk_surface_create_similar_surface

Just create the cairo image surface ourselves.

2 years agoMerge branch 'inspector-fractional-scale' into 'main'
Matthias Clasen [Sat, 1 Apr 2023 23:31:39 +0000 (23:31 +0000)]
Merge branch 'inspector-fractional-scale' into 'main'

Add gdk_surface_get_scale

See merge request GNOME/gtk!5769

2 years agoinspector: Show surface scale
Matthias Clasen [Sat, 1 Apr 2023 18:09:23 +0000 (14:09 -0400)]
inspector: Show surface scale

For Wayland surfaces, show the fractional scale
if we have it.

2 years agoAdd gdk_surface_get_scale
Matthias Clasen [Sat, 1 Apr 2023 18:51:11 +0000 (14:51 -0400)]
Add gdk_surface_get_scale

Add a scale property to GdkSurface and use the
fractional scale for it on Wayland.

2 years agoMerge branch 'wip/otte/listitem-focus' into 'main'
Benjamin Otte [Sat, 1 Apr 2023 19:33:00 +0000 (19:33 +0000)]
Merge branch 'wip/otte/listitem-focus' into 'main'

GtkColumnView factories and focus rework

See merge request GNOME/gtk!5728

2 years agoinspector: Show the viewporter too
Matthias Clasen [Sat, 1 Apr 2023 17:02:53 +0000 (13:02 -0400)]
inspector: Show the viewporter too

2 years agogtk-demo: Port to GtkColumnViewCell
Benjamin Otte [Fri, 31 Mar 2023 12:17:44 +0000 (14:17 +0200)]
gtk-demo: Port to GtkColumnViewCell

2 years agofilechooserwidget: Port to ColumnViewCell
Benjamin Otte [Fri, 31 Mar 2023 12:05:57 +0000 (14:05 +0200)]
filechooserwidget: Port to ColumnViewCell

2 years agotestcolumnview: Port to GtkColumnViewCell
Benjamin Otte [Fri, 31 Mar 2023 11:24:59 +0000 (13:24 +0200)]
testcolumnview: Port to GtkColumnViewCell

2 years agocolumnview: Add GtkColumnViewCell
Benjamin Otte [Thu, 30 Mar 2023 11:18:15 +0000 (13:18 +0200)]
columnview: Add GtkColumnViewCell

This splits GtkListItem into 2 objects.

It is fully backwards compatible.

Using GtkListItem for GtkColumnView is now de-facto deprecated.

2 years agobuilderlistitemfactory: Allow subclasses
Benjamin Otte [Fri, 31 Mar 2023 11:10:27 +0000 (13:10 +0200)]
builderlistitemfactory: Allow subclasses

It's going to be used with the new GtkColumnViewCell objects, so that
it's backwards compatible with ui file factories that use GtkListItem.

2 years agobuilder: Allow template parsing to be used with subclasses
Benjamin Otte [Fri, 31 Mar 2023 11:01:47 +0000 (13:01 +0200)]
builder: Allow template parsing to be used with subclasses

Whenn setting gtk_builder_set_allow_template_parents(), the builder
instance will accept
  <template class="GtkWidget">
for a GtkBox instance.

It's going to be used with the new GtkColumnViewCell objects, so that
it's backwards compatible with ui file factories that use GtkListItem.

2 years agocolumnviewcell: Ignore ::activatable and ::selectable for cells
Benjamin Otte [Thu, 30 Mar 2023 10:26:01 +0000 (12:26 +0200)]
columnviewcell: Ignore ::activatable and ::selectable for cells

This is a row property, not a cell property.

2 years agocolumnviewcellwidget: Untangle from GtkListItemWidget
Benjamin Otte [Thu, 30 Mar 2023 09:40:05 +0000 (11:40 +0200)]
columnviewcellwidget: Untangle from GtkListItemWidget

This is step 1 in switching cells to their own ListItem subclass.

2 years agotestdatatable: Add a --pages option
Benjamin Otte [Thu, 30 Mar 2023 05:43:12 +0000 (07:43 +0200)]
testdatatable: Add a --pages option

That way, local scrolling is available and the scrolling isn't random.

Recycling should now involve reordering the recycled widgets instead of
just keeping their order because all of them got recycled.

2 years agocolumnviewcellwidget: Ensure for_size is large enough
Benjamin Otte [Thu, 30 Mar 2023 06:51:19 +0000 (08:51 +0200)]
columnviewcellwidget: Ensure for_size is large enough

When clipping, we still need to do proper size requests.

2 years agocolumnviewcellwidget: Rewrite width unadjusting
Benjamin Otte [Thu, 30 Mar 2023 04:58:40 +0000 (06:58 +0200)]
columnviewcellwidget: Rewrite width unadjusting

Use GtkCssBoxes for that purpose. No more scary CSS math necessary in
the widget.

2 years agofilechooser: Set a row-factory
Benjamin Otte [Wed, 29 Mar 2023 08:39:11 +0000 (10:39 +0200)]
filechooser: Set a row-factory

This way, we can toggle per-row selectability and ensure files are not
selectable in select-folder mode.