accerciser merge requestshttps://gitlab.gnome.org/GNOME/accerciser/-/merge_requests2024-03-27T06:21:44Zhttps://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/55Some WinManager refactoring, take workspace into account for "Inspect under m...2024-03-27T06:21:44ZMichael WeghornSome WinManager refactoring, take workspace into account for "Inspect under mouse"* refactor and unify some `WinManager`/`KWinWinManager` methods (i.e. Wnck-based and KWin implementations)
* improve heuristics to find right window to highlight for `KWinWinManager` by reusing logic already implemented for Wnck-based `W...* refactor and unify some `WinManager`/`KWinWinManager` methods (i.e. Wnck-based and KWin implementations)
* improve heuristics to find right window to highlight for `KWinWinManager` by reusing logic already implemented for Wnck-based `WinManager`
* take into account the current workspace/virtual desktop when using the "Inspect under mouse" feature to avoid highlighting accessible from window on other workspace/virtual desktop rather than the one the mouse is actually over
(More details in in the individual commit messages.)
This also simplifies adding new `WinManager` implementations (like one for GNOME/Mutter) in the future that can reuse more of the existing code now.
Related issue: #41https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/54KWinWindowManager: Implement "Inspect under mouse"2024-03-23T15:08:33ZMichael WeghornKWinWindowManager: Implement "Inspect under mouse"Implement "Inspect under mouse" for `KWinWindowManager` by retrieving relevant information from KWin rather than Wnck, so this also works on Wayland.
Also, make the implementation more robust (address some issues encountered while using...Implement "Inspect under mouse" for `KWinWindowManager` by retrieving relevant information from KWin rather than Wnck, so this also works on Wayland.
Also, make the implementation more robust (address some issues encountered while using this new window manager in different setups).
See the individual commits for more details.
Related issue: #41https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/53quick_select: Port from deprecated gdk_display_get_pointer/gdk_window_get_poi...2024-03-21T23:03:59ZMichael Weghornquick_select: Port from deprecated gdk_display_get_pointer/gdk_window_get_pointer`gdk_display_get_pointer` and `gdk_window_get_pointer` are deprecated.
Drop/port to non-deprecated API instead.
(See single commits for details.)`gdk_display_get_pointer` and `gdk_window_get_pointer` are deprecated.
Drop/port to non-deprecated API instead.
(See single commits for details.)https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/52event_monitor: Fix jumping to object on click2024-03-21T23:02:48ZMichael Weghornevent_monitor: Fix jumping to object on clickThe source of an event in the event monitor
log is shown as a hyperlink.
Pressing Enter when the text cursor is on the
object would select the object in the tree view,
but doing the same on a left mouse click on the
hyperlink didn't wor...The source of an event in the event monitor
log is shown as a hyperlink.
Pressing Enter when the text cursor is on the
object would select the object in the tree view,
but doing the same on a left mouse click on the
hyperlink didn't work.
The `button` member of the `GdkEvent` is a
`GdkEventButton` [1], while the comparison
was using it as if it were an integer.
Use the button's own `button` property instead,
which is the `uint` that needs to be checked here [2]:
> `button`
>
> The button which was pressed or released, numbered from 1 to 5.
> Normally button 1 is the left mouse button, 2 is the middle button, and
> 3 is the right button. On 2-button mice, the middle button can often be
> simulated by pressing both mouse buttons together.
[1] https://docs.gtk.org/gdk3/union.Event.html
[2] https://docs.gtk.org/gdk3/struct.EventButton.htmlhttps://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/51Add a window manager that retrieves screen coords from KWin2024-03-29T09:05:21ZMichael WeghornAdd a window manager that retrieves screen coords from KWinAdd a `KWinWindowManager` that can be used to retrieve
window positions using the KWin window manager/Wayland
compositor that is used on KDE Plasma by default.
For now, the Wnck-based window manager (that doesn't
work on Wayland with na...Add a `KWinWindowManager` that can be used to retrieve
window positions using the KWin window manager/Wayland
compositor that is used on KDE Plasma by default.
For now, the Wnck-based window manager (that doesn't
work on Wayland with native Wayland apps, see
issue #41) remains the default.
Use of the KWin window manager can explicitly
be enabled by setting the environment variable
`ACCERCISER_WINDOW_MANAGER=kwin`.
This partly solves #41 by providing an initial
solution when KDE Plasma Wayland with KWin is used.
More work is needed to make the quick select feature
using the mouse position work as well.
A similar approach should generally be possible for
GNOME/Mutter.
(More details in the individual commit messages.)https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/50Use GtkGrid instead of deprecated GtkTable2024-03-15T23:16:11ZMichael WeghornUse GtkGrid instead of deprecated GtkTableGtkTable was deprecated in GTK 3.4 [1]. Replace uses
of GtkTable in the interface view with GtkGrid.
[1] https://docs.gtk.org/gtk3/class.Table.htmlGtkTable was deprecated in GTK 3.4 [1]. Replace uses
of GtkTable in the interface view with GtkGrid.
[1] https://docs.gtk.org/gtk3/class.Table.htmlhttps://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/49interface_view: Use GtkButtonBox instead of deprecated GtkHButtonBox2024-03-15T16:21:58ZMichael Weghorninterface_view: Use GtkButtonBox instead of deprecated GtkHButtonBoxGtkHButtonBox was deprecated in GTK 3.2 [1].
Use GtkButtonBox with orientation horizontal instead,
as suggested.
[1] https://docs.gtk.org/gtk3/ctor.HButtonBox.new.htmlGtkHButtonBox was deprecated in GTK 3.2 [1].
Use GtkButtonBox with orientation horizontal instead,
as suggested.
[1] https://docs.gtk.org/gtk3/ctor.HButtonBox.new.htmlhttps://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/48Support "Inspect under mouse" for Gtk 4 apps2024-03-11T22:39:27ZMichael WeghornSupport "Inspect under mouse" for Gtk 4 appsRefactor code handling coordinates a bit and adjust the "Inspect object under mouse" implementation to use window coordinates instead of desktop coordinates for Gtk 4 apps, where desktop coords are not supported.
Together with https://g...Refactor code handling coordinates a bit and adjust the "Inspect object under mouse" implementation to use window coordinates instead of desktop coordinates for Gtk 4 apps, where desktop coords are not supported.
Together with https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/47 and upstream Gtk fixes https://gitlab.gnome.org/GNOME/gtk/-/commit/1ff17f1a7ef5657c8c547bab7065b78633881d0b and https://gitlab.gnome.org/GNOME/gtk/-/commit/ea7ddc031c8ff6fb4efe74ce393b33e9bd090809 and https://gitlab.gnome.org/GNOME/gtk/-/commit/e6a4cc8ba239bb339ce8c2dec4704153678984a3, this makes the feature work for Gtk 4 apps, at least in my tests on Plasma X11 on Debian testing.
Sample screencast using gtk4-demo:
[2024-02-21_screencast_accerciser_gtk4_inspect_under_mouse.mkv](/uploads/2042230cafad9ca7ee520e29fcbe2f7f/2024-02-21_screencast_accerciser_gtk4_inspect_under_mouse.mkv)
(More details in the individual commit messages.)
Related: #41https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/47treeview: Avoid unnecessary event processing2024-03-01T01:55:04ZMichael Weghorntreeview: Avoid unnecessary event processing`AccessibleTreeview#selectNodeAtPath` lets
the GLib main loop process events to
ensure that the tree has been populated
before before selecting the node, added in
commit a092dc933985fafd5b1e2cc3374c7bbc0fb2d12e
Author: Michael W...`AccessibleTreeview#selectNodeAtPath` lets
the GLib main loop process events to
ensure that the tree has been populated
before before selecting the node, added in
commit a092dc933985fafd5b1e2cc3374c7bbc0fb2d12e
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Jul 14 09:38:57 2022 +0200
treeview: Populate path for bookmark right away
While experimenting with the "Inspect under mouse"
feature with Gtk 4 apps (where that feature doesn't work
yet), the feature would sometimes stop working altogether,
also for other apps where it works in general.
And Accerciser would not terminate properly any more
when closed, but had to be killed.
For some reason, it was still processing events here.
No longer process events until none are left, but
only until populating the tree is finished, which
is what is of interest.
To do so, add a new class member `isPopulating` to keep
track of whether the tree is currently being populated.https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/46Port from deprecated GtkAlignment and GtkTable in Python code2024-01-13T22:41:08ZMichael WeghornPort from deprecated GtkAlignment and GtkTable in Python codeGtkAlignment and GtkTable are both deprecated.
Port from using these in Python code.
(s. single commits for more details)GtkAlignment and GtkTable are both deprecated.
Port from using these in Python code.
(s. single commits for more details)https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/45Follow-up MR for the imp module2024-01-13T22:40:18ZNiels De Graefnielsdegraef@gmail.comFollow-up MR for the imp moduleAs I was trying to test my MR for Meson build support ( !44), I still got a lot of error messages related to the imp module, even after cherry-picking @tyrylu 's commits. Looking at the error messages, I found out we still had one usage ...As I was trying to test my MR for Meson build support ( !44), I still got a lot of error messages related to the imp module, even after cherry-picking @tyrylu 's commits. Looking at the error messages, I found out we still had one usage of `imp` in "plugins/validate.py", so I ported that too. Since I couldn't push to their branch, I just made this follow-up MR with the commit cherr-picked.https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/44Add meson build support2024-01-14T19:25:11ZNiels De Graefnielsdegraef@gmail.comAdd meson build supportAutotools is neither the most modern, nor the most user-friendly build system in this day and age anymore. The build fails with a _very_ helpful "missing separator" error message if you don't have `yelp-tools` installed for example.
Thi...Autotools is neither the most modern, nor the most user-friendly build system in this day and age anymore. The build fails with a _very_ helpful "missing separator" error message if you don't have `yelp-tools` installed for example.
This commit makes accerciser follow the rest of the GNOME world in porting to Meson [1](https://mesonbuild.com/), a modern Python3-based build system. Configuring, building, and installing accerciser can now be done with the following commands (where `_build` is a randomly-picked build directory):
```plaintext
$ meson setup -Dprefix=/usr _build
$ meson compile -C _build
$ meson install -C _build
```https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/43general: Don't use the imp module2024-01-13T22:39:50ZLukáš Tyrychtrgeneral: Don't use the imp moduleIt will be gone in Python 3.12, and is deprecated for a long time
Fixes #60It will be gone in Python 3.12, and is deprecated for a long time
Fixes #60https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/42event_monitor: Fix saving to file2023-12-31T10:07:33ZMichael Weghornevent_monitor: Fix saving to filePressing the "Save button" in the event monitor didn't work.
Traceback:
Traceback (most recent call last):
File "/home/michi/temp/accerciser/share/accerciser/plugins/event_monitor.py", line 477, in _onSave
save_dialog...Pressing the "Save button" in the event monitor didn't work.
Traceback:
Traceback (most recent call last):
File "/home/michi/temp/accerciser/share/accerciser/plugins/event_monitor.py", line 477, in _onSave
save_dialog = gtk.FileChooserDialog(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gi/overrides/__init__.py", line 319, in new_init
return super_init_func(self, **new_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 569, in __init__
self.add_buttons(*add_buttons)
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 603, in add_buttons
self.add_button(text, response)
TypeError: Must be string, not ButtonsType
Fix this. While at it, switch to `GtkFileChooserNative`
here as well, as
commit 990adc2f8c44659d2ebfd90185a92cf2c9b72e7f
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Fri Dec 22 11:37:22 2023 +0100
validate: Switch to GtkfileChooserNative
did for the AT-SPI validator plugin.
Also add the mandatory missing param for the
`gtk_text_buffer_get_text` call, since this otherwise
fails like this:
Traceback (most recent call last):
File "/home/michi/temp/accerciser/share/accerciser/plugins/event_monitor.py", line 488, in _onSave
self.monitor_buffer.get_text(self.monitor_buffer.get_start_iter(),
TypeError: Gtk.TextBuffer.get_text() takes exactly 4 arguments (3 given)
Traceback (most recent call last):
File "/home/michi/temp/accerciser/share/accerciser/plugins/event_monitor.py", line 488, in _onSave
self.monitor_buffer.get_text(self.monitor_buffer.get_start_iter(),
TypeError: Gtk.TextBuffer.get_text() takes exactly 4 arguments (3 given)
[1] https://docs.gtk.org/gtk3/method.TextBuffer.get_text.htmlhttps://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/41Port from stock properties etc. deprecated in GTK 3.10, use GtkfileChooserNative2023-12-30T06:44:03ZMichael WeghornPort from stock properties etc. deprecated in GTK 3.10, use GtkfileChooserNativeConstants and methods related to stock icons were deprecated in GTK 3.10.
Port away from these and use icon names to retrieve the icons from the theme instead.
While at it, also switch to `GtkfileChooserNative` for the AT-SPI validator ...Constants and methods related to stock icons were deprecated in GTK 3.10.
Port away from these and use icon names to retrieve the icons from the theme instead.
While at it, also switch to `GtkfileChooserNative` for the AT-SPI validator plugin.
(See individual commit messages for more details.)https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/40Don't add when cancelling "New Bookmark" dialog2023-12-22T12:37:52ZMichael WeghornDon't add when cancelling "New Bookmark" dialog`BookmarkStore#_onAddBookmark` first adds the
bookmark and then initializes the "New Bookmark"
dialog with the data of the bookmark.
When the dialog is cancelled, the bookmark
therefore needs to be completely removed again,
including it...`BookmarkStore#_onAddBookmark` first adds the
bookmark and then initializes the "New Bookmark"
dialog with the data of the bookmark.
When the dialog is cancelled, the bookmark
therefore needs to be completely removed again,
including its menu entry, not just the entry
from the list store.
This fixes the following use case:
1) select any node in the treeview
2) "Bookmarks" -> "Add Bookmark"
("New Bookmark" dialog shows up)
3) press the "Cancel" button in the dialog
Without this commit in place, an entry
for the bookmark would be present in the
menu despite cancelling, but that entry
would not be there anymore after restarting
Accerciser.
With this change in place, the entry is only
there when actually selecting "Add" in the
dialog.
(Issue unrelated to recent porting of the
menu in ea98703d7d9187d9eeb661b42e2832da912263f7,
already reproducible e.g. with tag 3.42.0).https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/39node: More reliably detect the right gtk4 window2023-12-21T16:18:48ZMichael Weghornnode: More reliably detect the right gtk4 windowSince Gtk 4 doesn't support global screen coords,
commit 238db8fbb85bb2b2bdb1f36a0fd502b3236051b6
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Oct 5 18:22:13 2023 +0200
node: Calculate screen coords for...Since Gtk 4 doesn't support global screen coords,
commit 238db8fbb85bb2b2bdb1f36a0fd502b3236051b6
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Oct 5 18:22:13 2023 +0200
node: Calculate screen coords for gtk4 apps
introduced a mechanism to calculate screen coords
from the window-relative coords and the window
coords retrieved via Wnck.
Refine the logic to find the correct window:
When multiple windows with the same name exist, prefer
the (first) one whose size matches that of the
accessible toplevel object.
This e.g. makes highlighting for the following
case work as expected:
* start gtk4-demo
* run the "Hypertext" example
-> a second window with window title
"Hypertext" shows up for the actual example
* click on the a11y object of that second window in
Accerciser's tree view of the a11y hierarchy
Now, the correct area is highlighted on screen
(at least on KDE Plasma X11).
Previously, the first gtk4-sample window (that also
has "Hypertext" as window title) was considered the
top-level window used for the calculation of the
object's screen position.
Use a regex when matching the window names to handle 2
special cases seen at least on KDE Plasma X11 with the
gtk4-demo use case described above:
* When matching the name, also consider windows for which
libwnck/the window manager (?) has appended a specific suffix to
distinguish multiple windows with the same name.
For the above "Hypertext" example, libwnck reported
"Hypertext" for the first window, but "Hypertext <2>" for
the second window, while both were using "Hypertext" in the
a11y hierarchy, so the correct window wouldn't be found otherwise.
* Accept an additional trailing Left-to-Right Mark (U+200E) in the
application name, as that was seen in the libwnck-reported name, too.https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/38Port from deprecated Gtk menu classes2023-12-21T13:40:57ZMichael WeghornPort from deprecated Gtk menu classes`GtkAction` `GtkUIManager` etc. were deprecated in Gtk 3.10.
Port the menu bar and the treeview context menu to use the recommended classes/interfaces like `GMenu`, `GMenuModel` and `GAction` instead.
See the individual commit messages...`GtkAction` `GtkUIManager` etc. were deprecated in Gtk 3.10.
Port the menu bar and the treeview context menu to use the recommended classes/interfaces like `GMenu`, `GMenuModel` and `GAction` instead.
See the individual commit messages for more details.https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/37Port from deprecated GtkVPaned and GtkAlignment in .ui files2023-11-17T12:05:17ZMichael WeghornPort from deprecated GtkVPaned and GtkAlignment in .ui filesGtkVPaned and GtkAlignment are deprecated. Port away from using them in .ui files.GtkVPaned and GtkAlignment are deprecated. Port away from using them in .ui files.https://gitlab.gnome.org/GNOME/accerciser/-/merge_requests/36Replace deprecated GtkVBox and GtkHBox2023-11-16T23:05:48ZMichael WeghornReplace deprecated GtkVBox and GtkHBoxPort from using the deprecated `GtkVBox` and `GtkHBox` to `GtkBox`.
(See single commits for more details.)Port from using the deprecated `GtkVBox` and `GtkHBox` to `GtkBox`.
(See single commits for more details.)