After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 751267 - Support the use of suffixes for signals in jaw_add_global_event_listener()
Support the use of suffixes for signals in jaw_add_global_event_listener()
Status: RESOLVED FIXED
Product: java-atk-wrapper
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Magdalen Berns (irc magpie)
java-atk-wrapper maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-06-20 20:14 UTC by Magdalen Berns (irc magpie)
Modified: 2015-07-07 19:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
JNI: remove custom implementation of util listeners (4.85 KB, patch)
2015-07-07 17:04 UTC, Magdalen Berns (irc magpie)
committed Details | Review

Description Magdalen Berns (irc magpie) 2015-06-20 20:14:06 UTC
In a similar was as has been done to resolve the issue in bug 686801 this is also an issue for the global jaw listener in jawutil.c.[1]

[1] https://git.gnome.org/browse/java-atk-wrapper/tree/jni/src/jawutil.c#n276
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2015-06-21 20:51:19 UTC
(In reply to Magdalen Berns (irc magpie) from comment #0)
> In a similar was as has been done to resolve the issue in bug 686801 this is
> also an issue for the global jaw listener in jawutil.c.[1]
> 
> [1] https://git.gnome.org/browse/java-atk-wrapper/tree/jni/src/jawutil.c#n276

As far as I see that method is just to be used here:
https://git.gnome.org/browse/java-atk-wrapper/tree/jni/src/jawutil.c#n118

and that one is mostly a C&P from what gtk+ or clutter had in the past. 

After the addition of the AtkWindow interface, it was concluded that, in general, it was not needed a custom per-atk-implementor implementation of atk_add_global_event_listener (that also applies to atk_remove_global_event_listener). So a default implementation was added on atk, and the custom implementation started to be removed from several toolkits.

That is properly explained on atk_add_global_event_listener documentation:
https://developer.gnome.org/atk/unstable/AtkUtil.html#atk-add-global-event-listener
Specifically: "Toolkit implementor note: ATK provides a default implementation for this virtual method. ATK implementors are discouraged from reimplementing this method."

So my suggestion is that JAW custom implementation should be also removed. As a reference, the following links show the links of that removal on gtk+ and clutter:
https://git.gnome.org/browse/gtk+/commit/?id=4cfe2a38bf32520001b9836433915713d248f04a
https://git.gnome.org/browse/clutter/commit/?id=a8c829019f6d659489d1155ca545b38837b105ea
Comment 2 Magdalen Berns (irc magpie) 2015-07-07 17:04:11 UTC
Created attachment 307027 [details] [review]
JNI: remove custom implementation of util listeners

(In reply to Alejandro Piñeiro Iglesias (IRC: infapi00) from comment #1)
> (In reply to Magdalen Berns (irc magpie) from comment #0)
> > In a similar was as has been done to resolve the issue in bug 686801 this is
> > also an issue for the global jaw listener in jawutil.c.[1]
> > 
> > [1] https://git.gnome.org/browse/java-atk-wrapper/tree/jni/src/jawutil.c#n276
> 
> As far as I see that method is just to be used here:
> https://git.gnome.org/browse/java-atk-wrapper/tree/jni/src/jawutil.c#n118
> 
> and that one is mostly a C&P from what gtk+ or clutter had in the past. 
> 
> After the addition of the AtkWindow interface, it was concluded that, in
> general, it was not needed a custom per-atk-implementor implementation of
> atk_add_global_event_listener (that also applies to
> atk_remove_global_event_listener). So a default implementation was added on
> atk, and the custom implementation started to be removed from several
> toolkits.
> 
> That is properly explained on atk_add_global_event_listener documentation:
> https://developer.gnome.org/atk/unstable/AtkUtil.html#atk-add-global-event-
> listener
> Specifically: "Toolkit implementor note: ATK provides a default
> implementation for this virtual method. ATK implementors are discouraged
> from reimplementing this method."
> 
> So my suggestion is that JAW custom implementation should be also removed.
> As a reference, the following links show the links of that removal on gtk+
> and clutter:
> https://git.gnome.org/browse/gtk+/commit/
> ?id=4cfe2a38bf32520001b9836433915713d248f04a
> https://git.gnome.org/browse/clutter/commit/
> ?id=a8c829019f6d659489d1155ca545b38837b105ea

OK, thanks for the advice, explanation and references.

I had wondered why these implementors weren't there in other examples so this has cleared that up too.

I have not pushed the proposed patch, since I want to test this quite carefully first. At the moment, the wrapper still has not got shot of jaw_window_signals which seem to use this.[1] I'll have another look at the discussion on bug 751183 about that if I find any problems with it.

[1] https://git.gnome.org/browse/java-atk-wrapper/tree/jni/src/jawobject.c#n62
Comment 3 Magdalen Berns (irc magpie) 2015-07-07 19:41:01 UTC
Review of attachment 307027 [details] [review]:

Great thanks again for your help with this Alejandro.

I have had a chance to triple check this a few times now and it does seem to work well (with the added bonus that it also seems to fix bug 751053) so I have pushed it to master.