IgnorantGuru / spacefm

SpaceFM File Manager
http://ignorantguru.github.com/spacefm/
GNU General Public License v3.0
487 stars 73 forks source link

Accessibility / ATK support for icons and desktop view #620

Open pvagner opened 8 years ago

pvagner commented 8 years ago

I am using Space FM on a gnome desktop for several months now. I would like to move to something lighter e.g. xfce or just a window manager e.g. ratpoison and let Space FM manage the desktop. What I am missing is accessibility support for the desktop view. As I am blind and am relying on accessibility support working. It's awesome that the Space FM inherited a lot of accessibility support from GTK and exo. However icons view and desktop view are two places where accessibility support is missing. I started looking at what can be done in order to try to address this however it appears I am not clever enough to manage this my-self. What I think is that for the icons view we need to implement an ATK accessible support. I am not sure if desktop view uses the same icon view or whether this is seperate the same way up to date pcmanfm uses. What is worth noting is the fact exo icons view gained ATK support (see these commits: 1, 2)). PCManFM has ATK support for the desktop window (commits 1, 2, 3). By looking a bit on all three codebases I am afraid Space FM has diverged a lot from pcmanfm and it's built-in exo is too different from upstream exo as currently found inside xfce. Can you please take a look into this? How do you see it? Is it likely we might see it implemented in foreseable future please? I think @vojtapolasek has reached a while ago to you regarding this as well, however as I think there is more interest I tried to post it here so it's recorded and we can see a possible progress.

IgnorantGuru commented 8 years ago

Hi, This is the first I've heard of this issue - thanks for bringing it to our attention. You're probably correct that SpaceFM's built-in exo icon view is responsible due to it not following upstream. The desktop manager does use the same exo icon view as the Icon file list in the file manager uses.

I do know that the keyboard can be used to navigate through the desktop manager currently (afaik that's working). But I'm not familiar with the ATK support.

This will require some research before I can say how feasible it is. Do be advised that SpaceFM is undergoing slow development during this period, but I am putting this in the 'near' milestone to give it priority, at least to assess the feasibility. Thanks for the research you provided - that will help.

pvagner commented 8 years ago

Thank you very much for accepting it. I'll also keep tinkering with it trying to back port exo icon view ATK support if I'll be able to. I can confirm that the keyboard navigation part is working fine in both icons view and also on the desktop. Currently I'm using it a bit ugly way. When viewing files I am using list view rather than icon view. And on the desktop I'm pressing F2 to rename an icon to get its name from the rename window canceling the rename. I know it's not straight forward, but at least it's a workaround.

IgnorantGuru commented 8 years ago

Yeah if you can hack it in, I'll certainly consider your code for inclusion. Even if you get part way, be sure to share your results here.

pvagner commented 8 years ago

These commits (1, 2, 3, 4, 5, 6) from libfm have something to do with accessibility and exo as well. This might be easier to back port than the exo stuff from xfce based exo. This is just some initial research I have nothing usefull yet.

pvagner commented 8 years ago

Woohoo! I have half working implementation now. It turned out libfm changes can be more or less cleanly applied. Currently I do receive proper ATK events such as focus changes and selection changes. I have no accessible names and icon texts so far. I'm planning to get it working and then I'll post a patch.

IgnorantGuru commented 8 years ago

Thanks, sounds good. When ready, I can apply your patch to the alpha branch for a testing period.

pvagner commented 8 years ago

yet another little update. I've reimplemented the part where retrieving icon's text and icon view in the file manager window is now fully accessible. The desktop window is not accessible, perhaps because the parent window should also have implemented some basic accessibility support. I need to look that up and learn how to make it work. I'm still not posting a patch not to clutter this place with multiple patches which may lead to confusion. If someone is really keen on getting this to work the same way I am then let me know and I'll create a fork so you can watch what I'm trying to do.

pvagner commented 8 years ago

ooops, I've just noticed what I have implemented works as intended with GTK2 only. So I need to find out how to make it work with GTK3 as well.

pvagner commented 8 years ago

@IgnorantGuru I'm half way through my work. After some huge delay I have realized I need help. Up to now I was able to backport exoview accessibility related changes from pcmanfm. There is very little I had to reimplement my-self, it was possible to just copy'n'paste most of the code. There are two major issues with the current state and I can't figure out how to make it work the way I would like it to. These exoview changes I have backported from pcmanfm are only working when spacefm is built with GTK+ 2. When Spacefm is built with GTK+ 2, there are two accessibility related issues with the main window menu bar - the menu that comes up when pressing F10 when the main window with pannel is in the foreground can't be navigated using the keyboard. A workaround is to bring up the menubar by using mnemonics for example press alt+f to bring up the File menu directly. When a menu has been shown at least once this way, it is later possible to open it by pressing F10 key and use keyboard to navigate over the menus. Second even more serious issue is that when accessibility is turned on, there appear to be some incorrect events fired when navigating in this menu using the keyboard. Accessibility apps such as orca are missing selection change notifications thus it is not possible to present all the menu items as they are selected. Right click menu on the listview or iconsview is working fine in this regard. This is what I'm getting in the terminal when emitting what I assume are those incorrect events I am speculating about. (spacefm:14252): GLib-GObject-WARNING **: gsignal.c:3486: signal name 'selection_changed' is invalid for instance '0x11f0600' of type 'GailMenuItem' I have grepped through the code and I have found no evidence that there is something that might be firing selection_changed events on a menu item objects. So most likelly it's that there is a lot of things I might be missing and I don't know what to look for. I even did not come up with this assumption my-self as I've also asked posting to the orca-list first. I am also attaching the current patch. I know spacefm is not in rapid development currently but I a11y.patch.txt

would at least like to get some hints so hopefully I'll be able to do something more on my own then.