Commit Graph

36894 Commits

Author SHA1 Message Date
Matthias Clasen
9d43e5bd59 Don't pass NULL to g_variant_new_string
That does not work.
2020-10-12 15:10:40 -04:00
Matthias Clasen
edfc55ae89 atspi utils: Fix an oversight
gtk_accessible_role_to_atspi_role must always return
an atspi role. The fallback was returning an aria
role.
2020-10-12 15:10:40 -04:00
Matthias Clasen
d6b64b5e29 Fixup: Add a forgotten #pragma once 2020-10-12 15:10:40 -04:00
Emmanuele Bassi
9ce790032d a11y: Convenience API for referencing ATSPI root node
We turn the root node into a reference fairly often, so it's worth it to
have a utility function that does this for us.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
35163bd7cc a11y: Add utility function for null refs
ATSPI was written for CORBA, which allows passing around "nil"
as valid object references.
2020-10-12 16:19:32 +01:00
Matthias Clasen
9d0952bd7f atspicontext: Implement GetState
Translate the aria states to at-spi's interpretation
of atk states.
2020-10-12 16:19:32 +01:00
Matthias Clasen
e189ccc8ed atspiroot: Fix GetState implementation
When the GetState signature says 'au', it actually
means a bitset that is sent as a pair of 32bit integers.
2020-10-12 16:19:32 +01:00
Matthias Clasen
762fbf34fc atspiroot: Implement GetIndexInParent
Just for good measure
2020-10-12 16:19:32 +01:00
Matthias Clasen
9f73638d43 atspicontext: Implement GetIndexInParent
This is needed for ATs to take our tree seriously.
2020-10-12 16:19:32 +01:00
Matthias Clasen
057b447137 atspicontext: Implement more accessible api
Implement GetChildAtIndex, GetChildren and ChildCount.
2020-10-12 16:19:32 +01:00
Matthias Clasen
78690845b1 atspiroot: Implement GetChildren
No surprises here.
2020-10-12 16:19:32 +01:00
Matthias Clasen
2ea338a8cf atspiroot: Don't leak references
The reffing getter trap, lurking behind g_list_model_get_item().
2020-10-12 16:19:32 +01:00
Matthias Clasen
e2f3039663 atspiroot: Implement GetLocale 2020-10-12 16:19:32 +01:00
Matthias Clasen
8f20133769 atspicontext: Print out the a11y bus address
Make our debug spew useful: Having the bus address
makes it easy to jump on the a11y bus to look around
with dbus tools.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
55b1fbd0f3 a11y: Localise the role name of the root node 2020-10-12 16:19:32 +01:00
Emmanuele Bassi
b57f1588df a11y: Register the Accessible interface on all AtSpiContext instances
This is not a complement implementation.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
60acdb9cad a11y: Implement more ATSPI methods on the root node 2020-10-12 16:19:32 +01:00
Emmanuele Bassi
07759b158a a11y: Add method to extract desktop data
We are going to need the desktop name and path to populate the parent
property of AtSpiContexts associated to top level widgets.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
9511c8273a a11y: Validate the DBus context path
UUIDs use dashes to separate the various blocks; unfortunately, this
results in an invalid DBus object path. Replace the dashes with an
underscore.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
b85b1f5b51 a11y: Turn accessible roles to string
Add a simple utility function to turn GtkAccessibleRole values into the
appropriate string, including localization.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
716024d882 a11y: Convert GTK roles to ATSPI ones
There's not a precise, 1:1 mapping between the newer ARIA roles and the
older ATSPI ones. We make do with what we have.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
21482e8264 a11y: Compute the label for a GtkATContext
The ARIA spec defines the mechanism for determining the name of an
accessible element—see §4.3 of the WAI-ARIA spec.

We follow the specification as much as it makes sense for GTK to do
so:

 1. if the element is hidden, return an empty string
 1. if the element has a labelled-by relation set, retrieve the
    label of the related element
 2. if the element has a label property set, use the value of
    the property
 3. if neither labelled-by nor label attributes are set, we use
    the role to compute the name:
   - for a `range` role, we return the contents of the value of
     the `value-text` or `value-now` properties
   - for any other role, we return a textual representation of
     the GtkAccessibleRole enumeration value
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
e6c5d57ffe a11y: Return the ATSPI role for the root element 2020-10-12 16:19:32 +01:00
Emmanuele Bassi
d7ebf18723 a11y: Add AT-SPI cache object
Right now, the cache is unused, and we still need to implement the
serialisation method and emit the signals.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
658d910967 a11y: Ignore widgets during destruction
There's no point in creating a GtkATContext when a widget is getting
destroyed.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
bd43e9cfc5 a11y: Register the accessible root object
When we create the first AT-SPI context we also need to register the
accessible root on the accessibility bus. The accessible root object is
the main entry point of an accessible application, and it holds the
global state to present to the ATs that connect to the bus.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
8c18480092 a11y: Add a display to GtkATContext
Since we need to check at run time what kind of AT context to use, we
need a hook into the whole GDK backend machinery. The display connection
seems to be the best choice, in this case, as it allows us to determine
whether we're running on an X11 or Wayland system, and thus whether we
should create a GtkAtSpiContext.

This requires some surgery to fix the GtkATContext creation function, in
order to include a GdkDisplay instance.
2020-10-12 16:19:32 +01:00
Emmanuele Bassi
8f19bb0832 a11y: Add dummy AT-SPI context
Does not do anything, at the moment, but it's going to get filled out
soon.

The backend is selected depending on the platform being compiled in;
since we're using AT-SPI on X11 and Wayland, and we don't have other
accessibility implementations, we currently don't care about run time
selection, but we're going to have to deal with that.
2020-10-12 16:19:31 +01:00
Emmanuele Bassi
c50916d27b a11y: Add the AT-SPI DBus descriptions
And generate the code for the DBus interfaces.

We don't want the full object manager experience, here, because we're
going to have a single object responding to various interfaces and
remote method calls. For this reason, we're not using the gnome module
in Meson to call gdbus-codegen for us: we need to use the interface info
command line arguments, and those are not available from Meson.
2020-10-12 16:19:31 +01:00
Emmanuele Bassi
daac36ea4c Generate introspection for GdkWayland API
Like we do for GdkX11. We can't use all of the public C API, but we can
expose enough type information to allow non-C developers to actually
check if they are running the Wayland GDK backend or not—plus some
additional Wayland-specific API.
2020-10-12 14:07:26 +01:00
Matthias Clasen
035e303f83 Merge branch 'wip/chergert/gdk-macos-fixes' into 'master'
various build fixes for GDK/GTK on macos

See merge request GNOME/gtk!2680
2020-10-10 11:55:01 +00:00
Christian Hergert
07bb07abbe macos: port gtk to GDK_WINDOWING_MACOS
For the various uses of GDK_WINDOWING_QUARTZ, we need to use
alternatives from GDK_WINDOWING_MACOS.

Some minor loss of functionality is here, such as icons sent with
application menus. That can certainly be added back at a future
point.
2020-10-09 20:08:23 -07:00
Christian Hergert
41101673c3 gtk: use GDK_WINDOWING_MACOS in gentypefuncs.py 2020-10-09 20:05:20 -07:00
Matthias Clasen
115ed005e6 Send focus events to the root
We are not propagating focus change events, and that is the only
place where we are listening for focus change events. If GtkWindow
does not see focus-in events for its popovers, we end up with
inadvertendly inactive windows.

Fixes: #3240
2020-10-09 07:43:40 -04:00
Matthias Clasen
6a0704aeb4 window: Be more careful when looking for focus
When passing focus up to a parent, make sure the
newly chosen focus widget actually accepts the focus.
2020-10-09 07:43:25 -04:00
Benjamin Otte
bc5723a846 Merge branch 'wip/otte/for-master' into 'master'
textbuffer: Don't serialize the \0 byte

See merge request GNOME/gtk!2672
2020-10-07 20:33:25 +00:00
Benjamin Otte
0fdb33e82a textbuffer: Don't serialize the \0 byte
... when converting to text/plain.
2020-10-07 22:14:18 +02:00
Matthias Clasen
cfb316799a colorchooser: Bring color names back
These are useful for accessibility.

Fixes: #3237
2020-10-07 15:56:11 -04:00
Jan Alexander Steffens (heftig)
fb0c062506 gtkplacessidebar: Disconnect and unref cloud_manager in dispose
The manager's providers-changed signal can fire after the sidebar has
been freed. Make sure we disconnect the sidebar from the manager.

https://bugs.archlinux.org/task/57984
https://bugs.archlinux.org/task/68123
2020-10-07 15:16:31 -04:00
Matthias Clasen
043207133d Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3235

See merge request GNOME/gtk!2667
2020-10-06 18:25:48 +00:00
Matthias Clasen
490163efcd Merge branch 'aboutwindow' into 'master'
gtkaboutdialog: Directly specialize GtkWindow

See merge request GNOME/gtk!2666
2020-10-06 18:25:27 +00:00
Matthias Clasen
44fd0c18c8 aboutdialog: Fix updating license tab
We need to update the license button visibility
whenever the license type changes.
2020-10-06 12:53:46 -04:00
Adrien Plazas
a17f33b1fe gtkaboutdialog: Directly specialize GtkWindow
As it doesn't act as a dialog, there is no point specializing GtkDialog,
so his makes it specialize GtkWindow directly.
2020-10-06 18:46:48 +02:00
Matthias Clasen
22eac2f407 window: Fix setting min size
We were inadvertedly setting the windows min size
to the default size, making it so that you can never
shrink a window below its default size.

Fixes: #3235
2020-10-06 11:06:36 -04:00
Matthias Clasen
7698b4dd63 treelistrowsorter: Add a bandaid
The GtkTreeListRowSortKeys implementation doesn't
know how it wants to cache its keys, and just crashes.

Since that is not cool, add a bandaid fix that forces
it to recreate its keys instead. Extra work, but hey,
no crash.

Related: #3228
2020-10-06 07:58:01 -04:00
Matthias Clasen
b6d4067717 Merge branch 'wip/carlosg/for-master' into 'master'
gtkpopover: Revert focus to parent on hide()

Closes #3214

See merge request GNOME/gtk!2653
2020-10-06 02:14:54 +00:00
Matthias Clasen
ac164d240b Cosmetic
Don't call gtk_root_get_focus when we already have
the GtkWindowPrivate struct at hand. And use
gtk_window_set_focus to update the focus, like the
old code did.
2020-10-05 21:53:05 -04:00
Carlos Garnacho
38547120b2 gtkwindow: Ensure to revert focus to a parent on hide()
When a widget is hidden, check harder for the keyboard focus being
contained in that widget, in order to reset it. Portions of the
focus child hierarchy may be outdated at the time, so it is more
reliable to check GtkRoot::focus (i.e. the property we intend to
update here).

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3214
2020-10-06 03:29:13 +02:00
Matthias Clasen
20fb7812df window: Fix window size snapping back
We were not updating the remembered size at all when
the window is interactively resized, causing it to
snap back to its default size the next time we call
gdk_toplevel_present().

This is a bandaid fix to prevent very broken resizing
behavior, until we have properly redone toplevel sizing.

Fixes: #3076
2020-10-05 20:24:19 -04:00
Matthias Clasen
5d5625dec8 Update script names to Unicode 13
It would be better if this was provided elsewhere...
2020-10-04 16:15:09 -04:00