summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Accessibility/Accessibility/P2P.mdwn24
1 files changed, 24 insertions, 0 deletions
diff --git a/Accessibility/Accessibility/P2P.mdwn b/Accessibility/Accessibility/P2P.mdwn
new file mode 100644
index 00000000..7d695f56
--- /dev/null
+++ b/Accessibility/Accessibility/P2P.mdwn
@@ -0,0 +1,24 @@
+# idea for wayland p2p dbus accessibility
+
+## for assistive technology providers:
+
+* AT connects to wayland compositor and requests permission for a11y. Each permission has to be approved by the user as usual, xdg portals are a good solution here perhaps
+* if the permission is granted, the AT gets a serial code, which should be used for identifying itself if required
+* the AT registers, using the wayland protocol, interest for specific events, or all events. However, registering interest is required at all times, even if all events is what the AT wants, explicit is better than implicit. Furthermore, if this is not done in a timely manner, the serial will be deallocated, the AT will get an error event, the socket connection will be broken, and the AT will have to start all over again
+* the AT calls a method indicating it's done with registering interest for events, so it's ready to recieve what it configured
+* on events like new app is in focus, the event body will contain an ID corresponding to the application in question, as well as a file descriptor for p2p dbus, but can also be any other transport method in the future, as long as both at clients and servers agree on details
+* for events like window resized, moved, etc that pertain to the focused application, the compositor will append the serial number of that application in the event body, so the AT knows where it's from
+* for global events like mouse moved, they will be reported like inside a normal wayland surface, but it'll be done on a per AT bases, not per window or surface like before. Also, if the AT configured interest for this event, it surely wants absolute screen coordinates, so give it that
+* if the AT requested support for absolute screen positioning, it will also get events about when a window is moved, resized, or changed position in any way. In this event, there will also be a touple containing coordinates of the new position of the top-left corner of the affected window. Combined with the fact that toolkits can report positions of individual controls in the window coordinate space, the AT can calculate absolute positions for all controls it's interested in, as long as it keeps listening for events and updates calculations every time accurately
+
+## for accessible applications:
+
+* application connects to the compositor
+* it uses a protocol to register itself as an accessible application, with optional metadata about number of controlls, at-spi specification version it supports, etc
+* on the returned object that represents a successful registration, the application calls a set_descriptor method, passing it a file descriptor. When this method finishes in the compositor, it emits the mirror event, new application in focus, with the same file descriptor registered in this step. Of course, assistive technologies registered in the same session will recieve the event, as well as the file descriptor, then connections should be able to happen normally.
+* normal atspi interactions can happen from there
+
+## footnotes
+
+* The dbus information is recieved out of band, which means the compositor doesn't care if the AT has an open file descriptor to an application which is not in focus, in fact it can't provide that guarantee at all. Alternatively, applications can choose to close the socket once they aren't in focus, to prevent abuse like that from happening, but it's generally not recommended because some ATs may have special requirements for which it does this
+* The file descriptor can transport anything in the future, as long as both the AT server and client agree on details, it's agnostic to the mechanism described above, it's just that dbus is being used right now and there's no better alternatives we're aware of. In the future, it could even be shared memory, the compositor won't care and therefore the sky is the limit