RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v3]

Alexey Ivanov aivanov at openjdk.org
Fri Oct 25 18:55:38 UTC 2024


On Fri, 25 Oct 2024 18:30:23 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

>> The updated test `bug6694823.java` works correctly on Windows and displays its popup over the Windows taskbar — it is expected.
>> 
>> The popup had to be moved if the security manager didn't allow to call `setAlwaysOnTop(true)`.
>> 
>>> There is a functional issue and for that reason I think it is better to retain this test. Details documented here - [JDK-8342012](https://bugs.openjdk.org/browse/JDK-8342012)
>> 
>> There's no functional issue. The `bug6694823.java` test was designed to pass **with the security manager**.
>> 
>> The `bug6694823.java` test fails without the security manager because the conditions don't hold any more.
>
> @aivanov-jdk 
> On macOS, popup is shifted up and does not cover the taskbar even without SM. 
> 
>> The updated test bug6694823.java works correctly on Windows and displays its popup over the Windows taskbar — it is expected.
>> Popup menus in stand-alone apps have their always-on-top flag set to true, therefore they can be displayed on top of the taskbar.
> 
> On native applications (eg. Word), popup menus don't overlap taskbar when clicked close to taskbar so do we consider this as expected behavior or the way it works currently (overlaps the taskbar)?

The pop is shifted up on macOS because `LWCToolkit` returns `false` in `canPopupOverlapTaskBar`:

https://github.com/openjdk/jdk/blob/36d71735e3554264e8d17f7e0e72999ac639e398/src/java.desktop/macosx/classes/sun/lwawt/macosx/LWCToolkit.java#L900-L902

On Windows, apps can control the area where they want a popmenu display or exclude an area of the screen. At the same time, Firefox displays its right-click menu over the taskbar if the menu fits when dropped down. A native Win32 app with a menu bar displays popup menus over the taskbar if it fits on the screen; some menus could open upwards if their items don't fit on the screen to display downwards (I attached a screenshot to JBS). Popup menus in Win32 Notepad (the version in Windows 10) displays it's right-click menu over the taskbar if it fits.

At the same time, right-click menu of a window title never displays over the taskbar, the menu opens upward if it doesn't fit without covering part of the taskbar.

I'm pretty sure the default return value of `true` from `SunToolkit.canPopupOverlapTaskBar` isn't something that was chosen accidentally.

Windows applications may avoid showing popup over the taskbar (confining the popups inside the work area, see [`SystemParametersInfoW`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfow) and `SPI_GETWORKAREA`). We can change the behaviour of the JDK.

Yet the failure of `bug6694823.java` without the security manager isn't a product bug in my opinion.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21498#discussion_r1817205444


More information about the nio-dev mailing list