RFR: 8325435: [macos] Menu or JPopupMenu not closed when main window is resized [v2]
Alexey Ivanov
aivanov at openjdk.org
Tue Jun 4 11:30:12 UTC 2024
On Mon, 3 Jun 2024 06:07:37 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> src/java.desktop/macosx/native/libawt_lwawt/awt/AWTWindow.m line 1031:
>>
>>> 1029: (p.x >= (frame.origin.x + contentRect.size.width - 3)) ||
>>> 1030: (fabs(frame.origin.x - p.x) < 3) ||
>>> 1031: (fabs(frame.origin.y - p.y) < 3)) {
>>
>> Does `fabs` use float? It makes code more compact but it may be imprecise and less performant than integer arithmetics.
>
> Yes..https://man7.org/linux/man-pages/man3/fabs.3.html and [CGFLoat ](https://developer.apple.com/documentation/corefoundation/cgfloat?language=objc) can be double/float and fabs can accomodate both, in this case it uses double...We have tested on 3 different systems without any issue so would keep it for now until we find any adverse effect and also it is better to accommodate double in hi-dpi environment which is the case in OSX
I see, the coordinates are floats, then it's perfectly fine. I assumed the coordinates were integers.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19474#discussion_r1625831262
More information about the client-libs-dev
mailing list