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.
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>
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.
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>
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.
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.
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.
`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]
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
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