gtk4.git
2 years agoMerge branch 'backports-for-4-10' into 'gtk-4-10'
Matthias Clasen [Fri, 21 Apr 2023 07:58:08 +0000 (07:58 +0000)]
Merge branch 'backports-for-4-10' into 'gtk-4-10'

Accumulated backports for 4.10

This branch has my cherry-picks from main since we branched after 4.10.1.
Two inscription reftests are failing, but they were also failing before.

See merge request GNOME/gtk!5856

2 years agogdk/win32: drop some unused variables
Marc-André Lureau [Sun, 16 Apr 2023 17:23:49 +0000 (21:23 +0400)]
gdk/win32: drop some unused variables

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk: drop libangle GLES minimum version
Marc-André Lureau [Sat, 15 Apr 2023 10:33:20 +0000 (14:33 +0400)]
gdk: drop libangle GLES minimum version

GLES 2.0 version is fine now with current gtk according to B. Otte.
Let's use the same minimum requirement for all implementations.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk: use GLES when on win32/ANGLE
Marc-André Lureau [Thu, 13 Apr 2023 15:22:21 +0000 (19:22 +0400)]
gdk: use GLES when on win32/ANGLE

When using GDK_DEBUG=gl-egl, we end up using GL, but that is not well supported:

Creating EGL context version 3.0 (debug:no, forward:no, legacy:yes, es:no)
Created EGL context[0000000000000004]
OpenGL version: 0.0 (legacy)
* GLSL version: (NULL)
* Max texture size: -1059701680
* Extensions checked:
 - GL_KHR_debug: no
 - GL_EXT_unpack_subimage: yes
 - OES_vertex_half_float: no

** (gtk4-demo.exe:14324): WARNING **: 19:16:41.468: Compile failure in
vertex shader:
ERROR: 0:7: 'gl_Position' : undeclared identifier
---8<---

Use GLES when EGL implementation is ANGLE.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agogdk: drop unused vertex_array_object
Marc-André Lureau [Sat, 15 Apr 2023 10:35:04 +0000 (14:35 +0400)]
gdk: drop unused vertex_array_object

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2 years agoglrenderer: Don't try to use float framebuffers on GLES2
Benjamin Otte [Mon, 17 Apr 2023 03:41:34 +0000 (05:41 +0200)]
glrenderer: Don't try to use float framebuffers on GLES2

GLES doesn't know what that is.

2 years agotestsuite: Skip focus tests when necessary
Matthias Clasen [Sun, 16 Apr 2023 18:58:26 +0000 (20:58 +0200)]
testsuite: Skip focus tests when necessary

If our window does not get focus, we can't reliably
test things that depend on widgets being focused.

2 years agoTry harder to fix focus tests
Matthias Clasen [Sun, 16 Apr 2023 18:07:13 +0000 (20:07 +0200)]
Try harder to fix focus tests

The focus test now asserts that its window is active.
So we should not run them in parallel with other tests,
since those might steal the focus.

2 years agotestsuite: Fix broken test to not unref surfaces twice
Benjamin Otte [Sun, 16 Apr 2023 14:57:48 +0000 (16:57 +0200)]
testsuite: Fix broken test to not unref surfaces twice

The test doesn't hold 2 references, it holds only one.

The reason one unref can cause a leak is that some backends - like X11 -
only destroy the surface once the DestroyNotify event from the X server
has come in.

2 years agowayland: Don't leak all surfaces
Benjamin Otte [Fri, 21 Apr 2023 07:26:23 +0000 (09:26 +0200)]
wayland: Don't leak all surfaces

X11 does add an extra reference to surfaces that gets released when the
DestroyNotify event arrives.
Wayland doesn't ave such an event, so that reference never gets
released.

This fixes a copy/paste error introduced in commit 590f3dfa1fcb.

2 years agowayland: Don't insta-crash when a surface gets disposed
Benjamin Otte [Sun, 16 Apr 2023 02:36:12 +0000 (04:36 +0200)]
wayland: Don't insta-crash when a surface gets disposed

We want to remove the event queue from the list of event queues, not the
surface.
Otherwise the freed queue stays in the list and the next time an event
comes in, we access invalid memory.

Fixes thinko introduced in commit 7fafa5133b5.

Luckily, we leak all surfaces, so this problem never occured.

2 years agotestsuite: Actually wait for focus
Matthias Clasen [Sun, 16 Apr 2023 07:11:24 +0000 (09:11 +0200)]
testsuite: Actually wait for focus

We were failing to properly iterate the main
context here. Oops.

2 years agotests: Check is-focus instead of has-focus
Matthias Clasen [Sun, 16 Apr 2023 06:50:35 +0000 (08:50 +0200)]
tests: Check is-focus instead of has-focus

We are not presenting windows here.

2 years agotext: Fix fallout from focus changes
Matthias Clasen [Sun, 16 Apr 2023 06:49:20 +0000 (08:49 +0200)]
text: Fix fallout from focus changes

We don't get proper notification for when the toplevel
is-active property changes, so monitor has-focus, and
update cursor blinking.

2 years ago| method ...
Cam Cook [Sun, 16 Apr 2023 01:48:27 +0000 (21:48 -0400)]
| method                                                                                | current                                                         | suggestion                                                           |
|---------------------------------------------------------------------------------------|-----------------------------------------------------------------|----------------------------------------------------------------------|
| [get_attributes](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3242) | "use`pango_layout_get_attribute (gtk_label_get_layout (self))`" | "use`pango_layout_get_attributes (gtk_label_get_layout (self))`" [1] |
| [set_yalign](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L5897)     | "(attributes org.gtk.Method.get_property=yalign)"               | "(attributes org.gtk.Method.set_property=yalign)"                    |
| [get_yalign](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L5923)     | "(attributes org.gtk.Method.set_property=yalign)"               | "(attributes org.gtk.Method.get_property=yalign)"                    |
| [set_ellipsize](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3892)  | "to ellipsizei"                                                 | "to ellipsize"                                                       |
| [get_attributes](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtklabel.c#L3239) | "from the labels markup"                                        | "from the label's markup"                                            |

[1] https://docs.gtk.org/Pango/method.Layout.get_attributes.html

2 years ago| method ...
Cam Cook [Sat, 15 Apr 2023 16:41:13 +0000 (12:41 -0400)]
| method                                                                                          | current                                                    | suggestion                                                |
|-------------------------------------------------------------------------------------------------|------------------------------------------------------------|-----------------------------------------------------------|
| [Entry/set_invisible_char](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkentry.c#L2101) | "(attributes org.gtk.Method.sets_property=invisible-char)" | "(attributes org.gtk.Method.set_property=invisible-char)" |
| [FlowBox::activate](https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gtk/gtkflowbox.c#L541)       | "This can be happen either by"                             | "This can happen either by"                               |

2 years agogles: Don't use vertex array objects
Benjamin Otte [Sat, 15 Apr 2023 15:50:18 +0000 (17:50 +0200)]
gles: Don't use vertex array objects

They're not needed and GLES doesn't technically support them, even
though GTK had been using them via epoxy sneakily using the
GL_OES_vertex_array_object extension behind our back.

2 years agotext: Only claim primary when focused
Matthias Clasen [Sat, 15 Apr 2023 13:02:09 +0000 (15:02 +0200)]
text: Only claim primary when focused

It does not make sense otherwise, and has unfortunate
side-effects on Wayland.

2 years agowayland: Improve logging for primary selection
Matthias Clasen [Sat, 15 Apr 2023 13:00:53 +0000 (15:00 +0200)]
wayland: Improve logging for primary selection

2 years agowindow: Don't mark widget prematurely as has-focus
Matthias Clasen [Sat, 15 Apr 2023 12:58:57 +0000 (14:58 +0200)]
window: Don't mark widget prematurely as has-focus

has-focus is defined is-focus && toplevel::is-active.
We were forgetting to look at is_active when handling
focus widget changes.

2 years agogtk: Improve documentation on returned nodes for snapshot
Marco Trevisan (Treviño) [Fri, 14 Apr 2023 16:05:21 +0000 (18:05 +0200)]
gtk: Improve documentation on returned nodes for snapshot

Closes: #5747
2 years agoopenuriportal: Detect if the interface isn't there
Matthias Clasen [Thu, 13 Apr 2023 05:23:06 +0000 (07:23 +0200)]
openuriportal: Detect if the interface isn't there

Check the portal version number before trying to use
it. Most importantly, this will detect the case where
the interface isn't supported at all, since the proxy
will report a version of 0 in that case.

Fixes: #5733
2 years agoprintunixdialog: Remove a redundant style class
Alexander Mikhaylenko [Wed, 12 Apr 2023 17:05:23 +0000 (21:05 +0400)]
printunixdialog: Remove a redundant style class

.view does absolutely nothing in Default style since the whole box is
covered with a GtkNotebook which has its own background, and adds an
unwanted background onto the tab strip in Adwaita.

2 years agogtk/dialogs: Destroy the window promptly on finish async function
Marco Trevisan (Treviño) [Tue, 11 Apr 2023 22:41:20 +0000 (00:41 +0200)]
gtk/dialogs: Destroy the window promptly on finish async function

Some bindings (GJS!) could add temporary references to the GAsyncResult
argument that we return, and thus to the GTask, which may cause the
dialog not to close when the finish function is called (but at garbage
collection instead!).

To prevent this, just manually destroy the window (by removing the task
data), so that we are not bound to the GTask lifetime anymore.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5741
2 years agofilechooserentry: Plug a memory leak
Matthias Clasen [Wed, 12 Apr 2023 10:08:14 +0000 (12:08 +0200)]
filechooserentry: Plug a memory leak

2 years agofilechooserentry: Make filtering work again
Matthias Clasen [Wed, 12 Apr 2023 10:07:30 +0000 (12:07 +0200)]
filechooserentry: Make filtering work again

We need to look at the filchooser::filtered-out
attribute to know which files the filesystem model
has filtered away.

Fixes: #5743
2 years agotextview: Reset press counter if double/triple clicking on a different line
Carlos Garnacho [Wed, 12 Apr 2023 09:24:46 +0000 (11:24 +0200)]
textview: Reset press counter if double/triple clicking on a different line

If we click close enough between lines, and with the maximum distances applied
by GtkGestureClick we could jump between lines when handling double/triple
click for word/line selection.

Ensure that the whole operation stays in the same line and reset the
gesture/counter if we do move between lines, so we start from scratch in the
new line.

2 years agoscalebutton: fix orientation not applied to scale
G.Willems [Tue, 11 Apr 2023 21:53:35 +0000 (23:53 +0200)]
scalebutton: fix orientation not applied to scale

2 years agoscalebutton: fix CSS name in documentation
G.Willems [Tue, 11 Apr 2023 20:06:09 +0000 (22:06 +0200)]
scalebutton: fix CSS name in documentation

2 years agoscrolledwindow: Avoid a critical
Matthias Clasen [Mon, 10 Apr 2023 04:22:20 +0000 (00:22 -0400)]
scrolledwindow: Avoid a critical

When setting the child property to NULL, we also need
to unset auto_added_viewport, to avoid triggering a
critical when setting it again.

2 years agogtk-demo: Add a keyword
Matthias Clasen [Sun, 9 Apr 2023 11:32:25 +0000 (07:32 -0400)]
gtk-demo: Add a keyword

Make the demo using the 'bluroverlay' come up when you type 'blur'.

2 years agogesture stylus: Fix condition
Matthias Clasen [Sun, 9 Apr 2023 12:33:15 +0000 (08:33 -0400)]
gesture stylus: Fix condition

Now that the paint demo lets us test this, it has
become apparent that this condition is wrong, and
we don't get the expected events if stylus-only is
FALSE.

2 years agogtk-demo: Work without stylus
Matthias Clasen [Sun, 9 Apr 2023 12:28:26 +0000 (08:28 -0400)]
gtk-demo: Work without stylus

In the paint demo, don't assume that the event
backlog contains pressure. It won't, if we are
working with a plain old mouse.

2 years agogtk-demo: Test stylus-only mode
Matthias Clasen [Sun, 9 Apr 2023 12:13:46 +0000 (08:13 -0400)]
gtk-demo: Test stylus-only mode

Add a checkbutton to toggle the stylus-only
mode of GtkGestureStylus, so we can test this.

2 years agorange: Fix a copy-paste error
Matthias Clasen [Sat, 8 Apr 2023 23:50:16 +0000 (19:50 -0400)]
range: Fix a copy-paste error

This was showing up as the alpha popup in
the color editor not being positioned correctly.

2 years agogestureclick: Use drag threshold for updates
Matthias Clasen [Fri, 7 Apr 2023 21:44:27 +0000 (17:44 -0400)]
gestureclick: Use drag threshold for updates

2 years agogestureclick: Don't use threshold for touch
Matthias Clasen [Thu, 6 Apr 2023 19:31:03 +0000 (15:31 -0400)]
gestureclick: Don't use threshold for touch

When determining double-clicks, don't use the distance
threshold for touch events. It is very hard to double
touch reliably within a few pixels of the same position.

Fixes: #5580
2 years agogtkpopover: Move GTK grabs to map/unmap
Carlos Garnacho [Fri, 7 Apr 2023 19:42:10 +0000 (21:42 +0200)]
gtkpopover: Move GTK grabs to map/unmap

Typically, a popover gets mapped when shown and unmapped when
hidden. A situation there that breaks is where the popover gets
recursively unmapped/unrealized when its root is destroyed.

In that situation, the popover does however unmap (without being
hidden first), moving the GTK grab from show/hide to map/unmap
will handle the previous situations, plus this one.

Fixes things being unclickable if e.g. a modal dialog got a
popover popped up, then got closed via Alt-F4.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5730
2 years agoinspector: Redo the actions list
Matthias Clasen [Fri, 7 Apr 2023 17:14:51 +0000 (13:14 -0400)]
inspector: Redo the actions list

Make the actions list implement GtkActionObserver
for the muxer case, and make updates work.

2 years agoinspector: Simplify the action editor
Matthias Clasen [Fri, 7 Apr 2023 16:58:10 +0000 (12:58 -0400)]
inspector: Simplify the action editor

No need to listen for changes, the actions list
code will do so and tell us to update.

2 years agoinspector: Add ActionHolder::changed
Matthias Clasen [Fri, 7 Apr 2023 17:14:07 +0000 (13:14 -0400)]
inspector: Add ActionHolder::changed

We will use this signal to communicate
action changes to the action list widgetry.

2 years agoinspector: Cosmetics
Matthias Clasen [Fri, 7 Apr 2023 17:15:34 +0000 (13:15 -0400)]
inspector: Cosmetics

Make the variant editor use a checkbutton
instead of a togglebutton.

2 years agoactionmuxer: Add a precondition
Matthias Clasen [Fri, 7 Apr 2023 16:53:57 +0000 (12:53 -0400)]
actionmuxer: Add a precondition

This helps with debugging the inspectors action
handling.

2 years agoinspector: Be more careful
Matthias Clasen [Fri, 7 Apr 2023 13:16:21 +0000 (09:16 -0400)]
inspector: Be more careful

Tweak the variant-editor code to handle some
cases more explicitly.

2 years agoinspector: Plug a memory leak
Matthias Clasen [Fri, 7 Apr 2023 12:55:40 +0000 (08:55 -0400)]
inspector: Plug a memory leak

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 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 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 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 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 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 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 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 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 agoinspector: Update some misc info rows
Matthias Clasen [Sat, 1 Apr 2023 18:18:27 +0000 (14:18 -0400)]
inspector: Update some misc info rows

2 years agogsk/gl/renderjob: Decompose matrix for 3D transforms
Georges Basile Stavracas Neto [Sat, 1 Apr 2023 14:38:22 +0000 (11:38 -0300)]
gsk/gl/renderjob: Decompose matrix for 3D transforms

While this can be more expensive, it's also correct.

2 years agoinspector: Improve display of paths
Matthias Clasen [Sat, 1 Apr 2023 13:45:58 +0000 (09:45 -0400)]
inspector: Improve display of paths

The values in the path section are long and generally
ellipsized. It does not make sense to reserve extra
space that the labels don't need.

2 years agodocs: Improve GtkLabel rendering
Bilal Elmoussaoui [Sat, 1 Apr 2023 12:06:11 +0000 (12:06 +0000)]
docs: Improve GtkLabel rendering

By adding some missing links & avoid the browser
from rendering the entities as their equivalent symbols

2 years agolistitem: Fix a notification problem
Matthias Clasen [Thu, 30 Mar 2023 18:12:54 +0000 (14:12 -0400)]
listitem: Fix a notification problem

We were notifying ::item when ::child is
changed. Oops

2 years agoa11y: Set ATSPI_STATE_SHOWING for all widgets, not only for windows
Lukáš Tyrychtr [Tue, 28 Mar 2023 13:07:03 +0000 (15:07 +0200)]
a11y: Set ATSPI_STATE_SHOWING for all widgets, not only for windows

According to the at-spi2 docs, for a widget to be considered visible,
it needs both the showing and visible states. Many applications rely on that,
for example the flat review functionality of Orca.

this fixes #5194

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 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 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 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 agofix crash with gtk_accessible_role_to_name and GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON
Caolán McNamara [Tue, 21 Mar 2023 15:04:12 +0000 (15:04 +0000)]
fix crash with gtk_accessible_role_to_name and GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON

presumably since:

commit de80f503e4db282a7343aa16d2803967d4179739
Date:   Thu Feb 23 14:22:20 2023 +0100

    a11y: Introduce a dedicated role for toggle buttons

2 years agocheckbutton: Only andle arrow focus if we're in a group
Benjamin Otte [Tue, 21 Mar 2023 13:06:33 +0000 (14:06 +0100)]
checkbutton: Only andle arrow focus if we're in a group

If there is no other widget in the group that we can focus, don't focus
and activate ourselves.

Otherwise the arrow keys on checkbuttons toggle the checkbutton.

2 years agotheme: Use 0.5 opacity for disabled pictures
Marco Trevisan (Treviño) [Mon, 20 Mar 2023 22:38:35 +0000 (23:38 +0100)]
theme: Use 0.5 opacity for disabled pictures

If a GtkImage is using an icon we use a gtk-icon-filter to se the icon
opacity when in insensitive state, however when using other kinds of
pictures we do not apply the same style leading to an inconsistent
result.

Closes: #5683
2 years agogsk: Use explicit switches
Matthias Clasen [Wed, 19 Apr 2023 07:19:12 +0000 (09:19 +0200)]
gsk: Use explicit switches

This makes it harder to forget to add new
node types here.

2 years agogsk: Mask nodes support 2d transforms
Matthias Clasen [Wed, 19 Apr 2023 06:13:55 +0000 (08:13 +0200)]
gsk: Mask nodes support 2d transforms

When adding mask nodes, I overlooked that
we have two separate functions for determining
what transforms a node supports without offlines.

Since we claim that mask nodes support general
transform, they must certainly support 2d transforms
as well.

2 years agoStop binding textdomain for -properties
Matthias Clasen [Sat, 18 Mar 2023 03:35:45 +0000 (23:35 -0400)]
Stop binding textdomain for -properties

We don't have these translations anymore.

2 years agogtk-demo: Reset properties when the image changes
Matthias Clasen [Fri, 17 Mar 2023 15:48:44 +0000 (11:48 -0400)]
gtk-demo: Reset properties when the image changes

2 years agobroadway: Don't cause traffic when disconnecting
Matthias Clasen [Fri, 17 Mar 2023 14:59:05 +0000 (10:59 -0400)]
broadway: Don't cause traffic when disconnecting

The recently added transient-for support was causing
roundtrips when a client with transients disconnects,
leading to assertion failures. Avoid that.

2 years agodocs: Update broadway docs
Matthias Clasen [Fri, 17 Mar 2023 12:56:23 +0000 (08:56 -0400)]
docs: Update broadway docs

Using Broadway without broadwayd hasn't worked since 2013...

Fixes: #5662
2 years agogldriver: Quick workaround for filter mismatch
Benjamin Otte [Thu, 16 Mar 2023 22:36:00 +0000 (23:36 +0100)]
gldriver: Quick workaround for filter mismatch

We should really use texture views or samplers to handle this case for
shared textures, but this at least makes NEAREST not break.

2 years agolabel: Use GtkFileLauncher for file URI
Matthias Clasen [Thu, 16 Mar 2023 20:06:49 +0000 (16:06 -0400)]
label: Use GtkFileLauncher for file URI

The GtkUriLauncher calls into the openuri portal, which distinguishes
between files, directories, and URI. The GtkFileLauncher contains logic
to deal with this, because it can already handle the file and folder
differences.

If we have a file:// URI it's easier to create a GFile out of it, and
use the GtkFileLauncher API, while leaving the GtkUriLauncher API for
every other URI scheme.

Same fix as de3c1d0c73987225869908, for GtkLabel.

Fixes: #5671
2 years agolinkbutton: Use GtkFileLauncher for file URI
Emmanuele Bassi [Thu, 16 Mar 2023 12:09:55 +0000 (12:09 +0000)]
linkbutton: Use GtkFileLauncher for file URI

The GtkUriLauncher calls into the openuri portal, which distinguishes
between files, directories, and URI. The GtkFileLauncher contains logic
to deal with this, because it can already handle the file and folder
differences.

If we have a file:// URI it's easier to create a GFile out of it, and
use the GtkFileLauncher API, while leaving the GtkUriLauncher API for
every other URI scheme.

Fixes: #5671
2 years agotheme: Port .boxed-list style from libadwaita
Alexander Mikhaylenko [Thu, 9 Jun 2022 18:42:45 +0000 (22:42 +0400)]
theme: Port .boxed-list style from libadwaita

Consistently use it for boxed lists in inspector and gtk-demo.

Fixes issues like https://gitlab.gnome.org/GNOME/gtk/-/issues/3145

2 years agoMerge branch 'fix-410-tests' into 'gtk-4-10'
Matthias Clasen [Fri, 21 Apr 2023 05:55:14 +0000 (05:55 +0000)]
Merge branch 'fix-410-tests' into 'gtk-4-10'

testsuite: Fix broken test

See merge request GNOME/gtk!5855

2 years agoMerge branch 'cherry-pick-03b71a97' into 'gtk-4-10'
Matthias Clasen [Fri, 21 Apr 2023 05:42:51 +0000 (05:42 +0000)]
Merge branch 'cherry-pick-03b71a97' into 'gtk-4-10'

Merge branch 'wip/otte/for-main' into 'main'

See merge request GNOME/gtk!5854

2 years agotestsuite: Fix broken test
Benjamin Otte [Wed, 29 Mar 2023 01:52:44 +0000 (03:52 +0200)]
testsuite: Fix broken test

The test was referencing a nonexisting image.

Plus, node parsing cannot reference relative URLs.

2 years agoMerge branch 'wip/otte/for-main' into 'main'
Benjamin Otte [Thu, 20 Apr 2023 21:50:44 +0000 (21:50 +0000)]
Merge branch 'wip/otte/for-main' into 'main'

testsuite: Be less verbose in accessor-apis test

Closes #5763

See merge request GNOME/gtk!5851

(cherry picked from commit 03b71a97599bedcc4203b6d12cdce88131167b99)

be5f2250 testsuite: Be less verbose in accessor-apis test
39583e40 testsuite: Allow accessors in interfaces
e47c0760 adjustment: Split out a function
75c47755 adjustment: sanity-check values when setting them
f393f70e listbase: Don't warn on scroll in empty list

2 years agoUpdate Turkish translation
Sabri Ünal [Wed, 19 Apr 2023 12:59:55 +0000 (12:59 +0000)]
Update Turkish translation

2 years agoMerge branch 'cherry-pick-faac2f78' into 'gtk-4-10'
Matthias Clasen [Tue, 11 Apr 2023 06:02:23 +0000 (06:02 +0000)]
Merge branch 'cherry-pick-faac2f78' into 'gtk-4-10'

filesystemmodel: Notify correct position removed in remove_file()

See merge request GNOME/gtk!5816

2 years agofilesystemmodel: Notify correct position removed in remove_file()
Corey Berla [Mon, 10 Apr 2023 19:56:08 +0000 (12:56 -0700)]
filesystemmodel: Notify correct position removed in remove_file()

32247bc50e63b709ae738a95a2ec71345b5fad75 made several changes to account for the
fact that we no longer have a NULL editable at the beginning of the list
model.  The commit mistakenly left out one change in remove_file(),
which causes the wrong file to be removed.

(cherry picked from commit faac2f7894608eef7e3884897b6a38da854e0fa8)

2 years agoUpdate Bulgarian translation
Alexander Shopov [Fri, 7 Apr 2023 16:26:55 +0000 (16:26 +0000)]
Update Bulgarian translation

2 years agoMerge branch 'cherry-pick-515f39f1' into 'gtk-4-10'
Matthias Clasen [Sat, 1 Apr 2023 12:48:49 +0000 (12:48 +0000)]
Merge branch 'cherry-pick-515f39f1' into 'gtk-4-10'

Merge branch 'wip/otte/for-main' into 'main'

See merge request GNOME/gtk!5760

2 years agoMerge branch 'cherry-picks-for-4-10' into 'gtk-4-10'
Matthias Clasen [Sat, 1 Apr 2023 01:23:44 +0000 (01:23 +0000)]
Merge branch 'cherry-picks-for-4-10' into 'gtk-4-10'

scrolledwindow: Disconnect the right handler

See merge request GNOME/gtk!5762

2 years agorendernodeparser: Emit error when failing to resolve URL
Benjamin Otte [Wed, 29 Mar 2023 00:28:01 +0000 (02:28 +0200)]
rendernodeparser: Emit error when failing to resolve URL

2 years agorendernodeparser: Failing to parse a string is an error
Benjamin Otte [Tue, 28 Mar 2023 19:09:01 +0000 (21:09 +0200)]
rendernodeparser: Failing to parse a string is an error

Testcase included.

2 years agowayland: Comply with protocol requirements
Matthias Clasen [Sun, 26 Mar 2023 13:47:46 +0000 (09:47 -0400)]
wayland: Comply with protocol requirements

If you send a bad anchor rect to mutter, it crashes.
Thats not great, so lets not do that.

2 years agogdk: Avoid a pointless indirection
Matthias Clasen [Tue, 28 Mar 2023 01:56:41 +0000 (21:56 -0400)]
gdk: Avoid a pointless indirection

Don't use g_fprintf if GLib is using system printf
anyway.

2 years agoImprove an error message
Matthias Clasen [Tue, 28 Mar 2023 01:44:56 +0000 (21:44 -0400)]
Improve an error message

We were producing a misleading error message
when gtk_init() fails.

Fixes: #5704
2 years agogdk: Improve logging for backends
Matthias Clasen [Tue, 28 Mar 2023 01:32:19 +0000 (21:32 -0400)]
gdk: Improve logging for backends

Log more when trying backends.

2 years agoenums: Move G_END_DECLS to the end of the file
Benjamin Otte [Sat, 25 Mar 2023 22:57:17 +0000 (23:57 +0100)]
enums: Move G_END_DECLS to the end of the file