mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
265 stars 143 forks source link

Accessible "object:state-changed:focused" event missing when renaming a file or folder #1778

Open joanmarie opened 2 months ago

joanmarie commented 2 months ago

Steps to reproduce -- note the order matters.

  1. Quit Caja
  2. Launch focused.py.txt in a terminal (after first removing the ".txt" extension Github made me add).
  3. Launch Caja
  4. Arrow to a file or folder
  5. Press F2

Expected results: An object:state-changed:focused accessibility event would be printed in the terminal.

Actual results: Only a focus: accessibility event is printed in the terminal.

Sample annotated output from icon view:

# I arrowed to "Desktop"
[icon | Desktop] is now focused (object:state-changed:focused)
# I arrowed to "checkout"
[icon | checkout] is now focused (object:state-changed:focused)
# I pressed F2
[text | checkout] is now focused (focus:) <-- This is the wrong event.
# I pressed Escape
[layered pane | Icon View] is now focused (object:state-changed:focused)

Sample annotated output from list view:

[table cell | ] is now focused (object:state-changed:focused)
[text | ] is now focused (focus:) <-- This is the wrong event.
[tree table | List View] is now focused (object:state-changed:focused)

Notes:

  1. With the icon view, this seems to only happen when you first launch Caja and attempt to rename a file or folder. Subsequent attempts seem to work as expected, HOWEVER with the list view, the bug seems persistent.
  2. The focus: accessibility event was deprecated over 10 years ago. As a result, I (the maintainer of Orca) have recently removed the handlers from Orca's main branch.
  3. As a result of this, when an Orca user launches Caja arrows to a folder, and presses F2 Orca says absolutely nothing. I think my having kept support in Orca for a deprecated event for over a decade is long enough. :grinning: Let's get this fixed properly (please and thank you).
  4. This is probably a Gtk bug. See https://gitlab.gnome.org/GNOME/gtk/-/issues/454
  5. I happen to use Fedora 40 with Caja 1.28.0. But this issue was reported to me by an Orca user. I think he uses Debian.

@cwendling: Could you please take a look at this one when you have a spare moment? Thanks!

joanmarie commented 1 month ago

This appears to be fixed by https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/7239. Let's hope that lands and lands soon!

cwendling commented 1 month ago

@joanmarie I just tested GTK 3.24.42, and it indeed has the initial object:state-changed:focused in place of the focus: one :tada: However, it seems to duplicate several object:state-changed:focused: basically, whenever you had both object:state-changed:focused and focus:, you seem to get object:state-changed:focused twice. Not sure if it's an issue, but it could possibly be improved.

joanmarie commented 1 month ago

While technically duplicate events should not be fired, Orca should already be handling that. How it handles it depends on the version of Orca (I've done a lot of work on identifying redundant events as efficiently as possible). So unless Orca is double speaking things, not firing the redundant event seems like a nice-to-have.