Commit Graph

82565 Commits

Author SHA1 Message Date
Matthias Clasen
2557cbb984 text: Shrink error underlines
The 3 * underline thickness that Pango gives us for the height
of error underlines is just too big for the dotted line we use
now. Shrink it down.
2024-11-20 19:42:57 -05:00
Matthias Clasen
4f7b95c4b6 Merge branch 'portals-opt-out' into 'main'
Add gdk_display_set_no_portals

See merge request GNOME/gtk!7941
2024-11-20 22:15:21 +00:00
Matthias Clasen
13e3ac79cc Merge branch 'ebassi/issue-7171' into 'main'
a11y: Do not return a double for string values

Closes #7171

See merge request GNOME/gtk!7953
2024-11-20 22:08:32 +00:00
Matthias Clasen
dff55ca11e Add gdk_display_set_no_portals
This is a programmatic equivalent to GDK_DEBUG=no-portals,
for use in portal implementations and similar situations.
2024-11-20 16:39:16 -05:00
Matthias Clasen
2e62fadab3 docs: Expand environment variable docs
Advise against setting them programmatically.
2024-11-20 16:39:16 -05:00
Matthias Clasen
6cadd81503 contentdeserializer: Don't initialize needlessly
Avoid initalizing the deserializers for an empty content formats.

This is relevant under X11, where we for some reason claim the
clipboard with no formats during display opening.
2024-11-20 16:39:16 -05:00
Matthias Clasen
608ef5ddf0 contentformats: Add a utility api
It can be handy to quickly check if a GdkContentFormats is empty.
2024-11-20 16:39:16 -05:00
Matthias Clasen
007d36af8a Merge branch 'sizerequest-warnings' into 'main'
Add more size request checks & warnings

See merge request GNOME/gtk!7947
2024-11-20 20:07:29 +00:00
Matthias Clasen
ee28206884 Merge branch 'kotontrion-main-patch-07396' into 'main'
Reword flag types in GtkBuilder docs

Closes #7159

See merge request GNOME/gtk!7945
2024-11-20 20:05:51 +00:00
Emmanuele Bassi
0f5fee2b8b a11y: Do not return a double for string values
The atspi.Value:Text property is a string; if the valuetext property is
unset, we should return an empty string.

Fixes: #7171
2024-11-20 17:31:53 +00:00
Matthias Clasen
1114359c9f Merge branch 'emoji-chooser-margins' into 'main'
emojichooser: Add missing margins to placeholder

See merge request GNOME/gtk!7946
2024-11-20 14:48:15 +00:00
kotontrion
ccca1838b5 Add integer to the GtkBuilder flag types examples 2024-11-20 13:43:39 +00:00
Sergey Bugaev
403f6aceec sizerequest: Warn when measuring for less then min size
The parent widget should pass an acceptable size in the first place;
passing an overly small size indicates a bug in an ancestor widget.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-11-20 16:15:41 +03:00
Mat
40738bfd70 emojichooser: Add missing margins to placeholder
Since we're no longer requesting a fixed height for the emoji
chooser, we need to add top/bottom margins to the placeholder to
prevent it from touching the edges.
2024-11-20 15:15:25 +02:00
Sergey Bugaev
3e7ec4f9ba sizerequestcache: Warn on contradictory measurements
When committing the measurement for a widget to the cache, check if the
measurement contradicts a previous measurement in the opposite
orientation, and print a warning. Unfortunately, we don't have a
reference to the widget itself at this point in the code, so we can't
name the specific widget; nevertheless it should be easy to break on the
wanring and inspect the stack trace to see which measurement has
triggered the warning.

This helps debug complex layout issues by catching the contradictory
measurements in the deepest / most nested widget that reports them,
rather than in a some ancestor GtkBox that happens to break because its
children's measurements are contradictory.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2024-11-20 16:12:36 +03:00
Matthias Clasen
dec4faa3d7 Merge branch 'more-docs-improvements' into 'main'
launchers: Modernize the docs

See merge request GNOME/gtk!7943
2024-11-20 12:38:20 +00:00
Matthias Clasen
3ae83f93e4 Merge branch 'redundant-emoji-chooser-code' into 'main'
text/textview: Remove redundant code related to emoji chooser

Closes #3112

See merge request GNOME/gtk!7942
2024-11-20 12:34:59 +00:00
kotontrion
ac22dfe314 reword flag types in GtkBuilder docs. 2024-11-20 09:00:28 +00:00
Matthias Clasen
bf70449997 Merge branch 'renderer-cosmetics' into 'main'
renderer: Cosmetics

See merge request GNOME/gtk!7944
2024-11-20 05:47:08 +00:00
Matthias Clasen
80938ebca4 renderer: Cosmetics
Make the output for GSK_RENDERER=help align properly.
2024-11-19 21:18:07 -05:00
Matthias Clasen
fa62834bda launchers: Modernize the docs
Remove gtk-docisms, apply more gi-docgen syntax, and reword things
to be closer to the style recommended in

https://developer.gnome.org/documentation/guidelines/devel-docs.html
2024-11-19 20:50:56 -05:00
Mat
6841525bc0 text/textview: Remove redundant code related to emoji chooser
Code to grab focus when closing the chooser was added to fix #3112,
but it seems the issue has been fixed elsewhere since. Since this
code is now redundant, remove it.

Also reverts 1d1ef311e3, since it,
as far as I can tell, tried to fix a selection issue caused by the
explicit focus grab when closing the chooser. It no longer made
any difference in my testing.
2024-11-20 02:25:05 +02:00
Matthias Clasen
41d82c0271 Merge branch 'prefer-portals' into 'main'
Use portals by default when available

Closes #7164

See merge request GNOME/gtk!7932
2024-11-19 19:41:07 +00:00
Matthias Clasen
745fceb1a1 Merge branch 'for-main' into 'main'
printoperation: Cosmetics

See merge request GNOME/gtk!7938
2024-11-19 18:49:56 +00:00
Matthias Clasen
6a909948b6 Merge branch 'michaelweghorn/a11y_atspi_children_changed' into 'main'
a11y atspi: Fix issues with the object:children-changed event

Closes #63

See merge request GNOME/gtk!7935
2024-11-19 17:50:18 +00:00
Matthias Clasen
4301c4494f printdialog: Make portals not fall back
If gdk_display_should_use_portal tells us to use portals, do so.
And if it fails, show and error instead of falling back.
2024-11-19 11:40:35 -05:00
Matthias Clasen
d515311b59 filechoosernative: Make portals not fall back
If gdk_display_should_use_portal tells us to use portals, do so.
And if it fails, show and error instead of falling back.
2024-11-19 11:40:35 -05:00
Matthias Clasen
2d1c58f892 Refine gdk_should_use_portal()
Rename the function to gdk_display_should_use_portal().

We want to always use portals when we are in a sandbox.
Otherwise, it depends on whether the portal is available
and is a new enough version. Therefore, pass the portal
interface name and the required minimum version to
this function.

Update all callers.
2024-11-19 11:40:35 -05:00
Matthias Clasen
2ed95e542a filechoosernative: Drop the use_portal override
We are going to prefer portals when available anyway,
going forward, so there shouldn't be a need for this
anymore.
2024-11-19 11:40:35 -05:00
Matthias Clasen
a03109a7b9 printoperation: Cosmetics
No more tabs.
2024-11-19 11:20:27 -05:00
Matthias Clasen
0dd9805f38 Merge branch 'for-main' into 'main'
openuriportal: Avoid some extra warnings

See merge request GNOME/gtk!7937
2024-11-19 16:01:52 +00:00
Matthias Clasen
884843ae20 filetransfer: Respect gdk_should_use_portal
This was an overlooked portal use.
2024-11-19 09:35:25 -05:00
Matthias Clasen
b51fe937dc file/urilauncher: Respect gdk_should_use_portal
This was an oversight.
2024-11-19 09:35:25 -05:00
Matthias Clasen
7ce5fd7545 print dialog: Use gdk_should_use_portal
This is the one function we want to use for deciding about
portals, so don't second-guess it.
2024-11-19 09:28:14 -05:00
Matthias Clasen
c8f844d6ba openuriportal: Avoid some extra warnings
If we don't have a proxy, we're done.
2024-11-19 09:26:44 -05:00
Matthias Clasen
701c1a1122 Merge branch 'widget-docs-refresh' into 'main'
widget: Modernize the docs

See merge request GNOME/gtk!7930
2024-11-19 12:31:38 +00:00
Matthias Clasen
d3167a707e Merge branch 'wip/fix-text-tablet-cursor-obscuring' into 'main'
gdk: check timestamps from tools for obscuring cursors

Closes #6763

See merge request GNOME/gtk!7909
2024-11-19 12:16:53 +00:00
Matthias Clasen
29edc0aed3 Merge branch 'for-main' into 'main'
atspi: Fix sandbox check

See merge request GNOME/gtk!7933
2024-11-19 12:16:11 +00:00
Michael Weghorn
0749f968f4 a11y atspi: Send ChildrenChanged with correct DBus signature
The DBus XML spec for the "ChildrenChanged"
AT-SPI signal (see gtk/a11y/atspi/Event.xml)
is the following:

    <signal name="ChildrenChanged">
      <arg name="operation" type="s"/>
      <arg name="index_in_parent" type="i"/>
      <arg type="i"/>
      <arg name="child" type="v"/>
      <arg name="properties" type="a{sv}"/>
      <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QSpiEvent"/>
    </signal>

Adhere to that when sending such a DBus signal:
Use "(siiva{sv})" instead of "(siiv@(so))"
for the GVariant type spec and pass a null
array of properties instead of sending a
reference to the sender as an argument.
(The sender is already known because it is
the event source.)

The incorrect signature could e.g. be seen
with an at-spi2-core version (git main
as of commit 422cac4bd657ce783164324e6ae4b3d54a8aa761)
with this additional local change on top:

    --- a/atspi/atspi-event-listener.c
    +++ b/atspi/atspi-event-listener.c
    @@ -28,6 +28,8 @@
     #include <string.h>
     #include <strings.h>

    +#include <stdio.h>
    +
     /**
      * AtspiEventListener:
      *
    @@ -1110,6 +1112,8 @@ _atspi_dbus_handle_event (DBusMessage *message)

       g_assert (strncmp (category, "org.a11y.atspi.Event.", 21) == 0);

    +  printf("sender: %s, signature: %s\n", sender, signature);
    +
       if (strcmp (signature, "siiv(so)") != 0 &&
           strcmp (signature, "siiva{sv}") != 0)
         {

and a corresponding pyatspi script:

    #!/usr/bin/python3
    import pyatspi
    def listener(e):
        print(f'toolkit: {e.source.get_toolkit_name()} {e.source.get_toolkit_version()}')
        print(e)
    pyatspi.Registry.registerEventListener(listener, "object:children-changed")
    pyatspi.Registry.start()

Corresponding output generated by this script without this change
in place when starting the "Entry" -> "Completion"
example from gtk4-demo:

    sender: :1.68, signature: siiv(so)
    toolkit: GTK 4.17.1
    object:children-changed:add(1, 0, [frame | Completion])
            source: [application | gtk4-demo]
            host_application: [application | gtk4-demo]
            sender: [application | gtk4-demo]

Output with this change in place:

    sender: :1.70, signature: siiva{sv}
    toolkit: GTK 4.17.1
    object:children-changed:add(1, 0, [frame | Completion])
            source: [application | gtk4-demo]
            host_application: [application | gtk4-demo]
            sender: [application | gtk4-demo]

This also matches the output seen for GTK 3's gtk3-demo:

    sender: :1.71, signature: siiva{sv}
    toolkit: gtk 3.24.43
    object:children-changed:add(1, 0, [frame | Entry Completion])
            source: [application | gtk3-demo]
            host_application: [application | gtk3-demo]
            sender: [application | gtk3-demo]

The other events (in gtk/a11y/gtkatspicontext.c) already
use the correct DBus signature.
2024-11-19 11:45:44 +01:00
Michael Weghorn
f7f158b675 a11y atspi: Send added/removed window as child arg
`gtk_at_spi_emit_children_changed` takes the added/removed
child as the 5th parameter, and the sender as the 6th
parameter.

`gtk_at_spi_root_child_changed` was passing these in
the wrong order.

As a result, the "object:children-changed:add" AT-SPI
signal was sent incorrectly.

Example event seen in Accerciser's Event Monitor without
this fix in place when starting the "Entry" -> "Completion"
example in gtk4-demo:

    50.5 object:children-changed:add(1, 0, [application | gtk4-demo])
        source: [application | gtk4-demo]
        application: [application | gtk4-demo]

The application itself is shown as both, the event source
and the new child.

With this commit in place, the new window/frame is now
shown as the new child as expected:

    1.0 object:children-changed:add(1, 0, [frame | Completion])
        source: [application | gtk4-demo]
        application: [application | gtk4-demo]

This also matches the behavior with GTK 3's gtk3-demo:

    91.6 object:children-changed:add(1, 0, [frame | Entry Completion])
        source: [application | gtk3-demo]
        application: [application | gtk3-demo]
2024-11-19 11:45:31 +01:00
Michael Weghorn
ee687cef38 a11y atspi: Update Event.xml with current upstream version
GTK's copy of the file was based on the obsolete
upstream version as of at-spi2-core commit
7e19ba4dad1639f23b9704187e8790b125936b43 [1]
from 2020.

That version of the XML spec doesn't have the
Announcement Event yet, and the documented
DBus signatures were still incorrect see e.g. these
later at-spi2-core commits:

    commit f0781465a75595f74b8cbcd582b7b35b46ee6349
    Author: Mike Gorse <mgorse@suse.com>
    Date:   Fri Aug 26 13:22:55 2022 -0500

        Event xml fixes

        Helps #74

    commit ab979c443ac11375a6baecfca897b0a44acdf861
    Author: Mike Gorse <mgorse@suse.com>
    Date:   Sat Aug 6 09:21:09 2022 -0500

        xml: fix Event arguments to correspond with what the code expects

    commit 26835da29918be2c0da6c08fb70d893de22891d2
    Author: Mike Gorse <mgorse@suse.com>
    Date:   Thu Aug 4 12:38:27 2022 -0500

            Add an "announcement" event/signal to allow objects to send notifications

            Fixes #63

    commit c52e6341518e74020a5c697ce1fb16f15f24d9f9
    Author: Federico Mena Quintero <federico@gnome.org>
    Date:   Fri Jul 1 13:32:17 2022 -0500

        Event.xml: note about having to fix all the signatures later

Update this with the current upstream version
(current at-spi2-core git main as of commit
422cac4bd657ce783164324e6ae4b3d54a8aa761).

[1] 7e19ba4dad
[2] 422cac4bd6
2024-11-19 09:27:12 +01:00
Matthias Clasen
39a30d7ad2 atspi: Fix sandbox check
We only want to check if we are running in a sandbox here, so
use the proper api for that.
2024-11-18 22:31:30 -05:00
Martin
fc1d18af61 Update Slovenian translation 2024-11-18 20:16:35 +00:00
Matthias Clasen
109971abc7 Merge branch 'for-main' into 'main'
testsuite: Don't use g_assert

See merge request GNOME/gtk!7929
2024-11-18 18:28:38 +00:00
Matthias Clasen
3574224375 Merge branch 'wip/nacho/gdk-macos-gir' into 'main'
Generate GdkMacos gir

See merge request GNOME/gtk!7911
2024-11-18 18:21:45 +00:00
Peter Hutterer
71adf3b47e gtk/textview: Use the event's timestamp for (un)obscuring cursors
Where available use the timestamp of the current event to obscure and
unobscure the cursor. Previously we'd only use the timestamp of
the logical pointer but that omitted events from tablet tool, resulting
in the tablet tool's cursor getting hidden on key press but never
re-appearing.

In the case of obscuring triggered by the GtkImContext we resort
to the previous approach of checking the core pointer's timestamp.

Closes #6763
2024-11-18 15:10:21 +10:00
Matthias Clasen
6e2c5d6f09 docs: Refer to the developer documentation guide
Link to this great resource.
2024-11-17 10:39:02 -05:00
Matthias Clasen
af9ac563a4 widget: Modernize the docs
Remove gtk-docisms, apply more gi-docgen syntax, and reword things
to be closer to the style recommended in

https://developer.gnome.org/documentation/guidelines/devel-docs.html
2024-11-16 20:50:52 -05:00
Matthias Clasen
235bef28d0 inspector: Make object tree resizable
The content of the name column frequently gets cut off, so make
the columns resizable.
2024-11-16 08:11:18 -05:00
Matthias Clasen
9a42e5fb5c testsuite: Plug a memory leak
g_dir_open must be paired with g_dir_close.
2024-11-15 19:41:15 -05:00