On Fri, 2 Jun 2023 08:42:45 GMT, Prasanta Sadhukhan <[email protected]>
wrote:
>> Alexander Zvegintsev has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> fix toolkit if condition
>
> src/java.desktop/unix/classes/sun/awt/X11/XDragSourceContextPeer.java line
> 410:
>
>> 408: Toolkit toolkit = Toolkit.getDefaultToolkit();
>> 409: if (!(toolkit instanceof SunToolkit)
>> 410: || !((SunToolkit) toolkit).isRunningOnWayland()) {
>
> Although it's not related to this fix, but `SunToolkit.isRunningOnWayland`
> does not have javadoc/comment, maybe we can think of adding one there since
> we added a javadoc-style comment for this private method in non-spec class
Sure, added.
> src/java.desktop/unix/classes/sun/awt/X11/XDragSourceContextPeer.java line
> 448:
>
>> 446: }
>> 447:
>> 448: if (isXWaylandDndAwareWindow(window)) {
>
> https://github.com/openjdk/jdk/blob/ec4493f5273746fdbc2a9c9451c15050d04730d2/src/java.desktop/unix/classes/sun/awt/X11/XDragSourceContextPeer.java#L441-L444
>
> Is it not required to do `win != 0 && isXWaylandDndAwareWindow()` since we
> are returning value from here too?
Not sure what is the purpose of `win != 0 && isXWaylandDndAwareWindow()`, it'll
change the behavior for the X11 session(isXWaylandDndAwareWindow is always
false in this case).
`findClientWindow` is a recursive function, and the `isXWaylandDndAwareWindow`
check is already performed within the call from line 442.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14266#discussion_r1214379664
PR Review Comment: https://git.openjdk.org/jdk/pull/14266#discussion_r1214412965