Absolute and relative positions of Atspi.Component of Gtk.MenuItem have values (-MAX_INT, -MAX_INT)

As the above screenshot of Accerciser shows the absolute and relative positions of Atspi.Component of all Gtk.MenuItem’s in my Gtk3 application have the values -2147483648, -2147483648 (i.e. -INT_MAX).

The size is 1x1 but initializes when clicked. Positions however remain (-MAX_INT, -MAX_INT). Is this by design?

Background
These -INT_MAX are picked up by while simulating mouse clicks with dogtail, and cause the tests to fail.

It seems that if you first activate the parent menu, so the items have showing and visible states, at least window relative coordinates start making sense, and the sizes as well.

If you browse with Accerciser you’ll see that most UI element do not behave this way. Their sizes and positions are preinitialized before they are activated. Menu items seem to be an exception.

Positions and sizes are not valid unless an object has states SHOWING and VISIBLE, that’s by design. They might be there, but there’s no guarantee.

This said, it indeed seems that there is a bug somewhere, because what I see is the following:

  • if I select a menu item inside a closed menu in Accerciser and then open the menu for the first time, I get properly updated values
  • if I then move the window and re-open the menu, the (absolute) values don’t update until I hover the item
  • if I select an item inside a menu that already poped up, values are not updated until I hover the item.

So it seems there is indeed a bug.

It could either be a problem in updating the value (the value itself is not updated in GTK), or missing notification (the value is correct in GTK, but Atspi doesn’t known it changed). Playing with the cache seems to suggest it is the former and GTK should update the values earlier (when the menu is shown again).
What puzzles me is that the values is correct the first time but only if Accerciser asks for it… but I guess that’s gonna be clearer once the bug itself is found.

Additionally, note that under Wayland it’s likely there won’t be any absolution positions available, due to GTK not knowing those.

You could report a bug about this (if it doesn’t already exist), but it being on GTK3 you might have little luck unless you provide a sufficiently safe patch (and convince the right people), given it’s not in active development anymore.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.