RFR: 8251862: Wrong position of Popup windows at the intersection of 2 screens

Andy Goryachev angorya at openjdk.org
Wed Dec 7 22:02:32 UTC 2022


On Wed, 7 Dec 2022 20:12:56 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

> On Windows platforms with more than one screen, a PopupWindow created for a Stage that straddles two windows will be drawn with an incorrect position and screen scale if the majority of the Stage is on one screen, and the popup is positioned on the other screen. In this case, the Stage is drawn using the screen scale of the screen that most of the window is on, while the popup is drawn using the scale of the screen that it is (typically entirely) on.
> 
> The most common way this can happen is when you have two screens of a different scale with the secondary screen on the left or above the primary screen. If you position the Stage such that most of it is still on the primary screen (thus the Stage is drawn using the scale of the primary screen), with a menu, a control with a context menu, or a control with a Tooltip now on the secondary screen, the popup window for the menu or Tooltip will be drawn using the screen scale of the secondary window and thus won't be positioned or sized correctly relative to the menu bar, or control in the main window.
> 
> The fix implemented by this PR is to always use the screen of the owner window, including the screen scales, when rendering a popup window. This matches the behavior of native Windows apps, such as Notepad.

Tried PopupControlTest with two monitors on Mac; the secondary non-retina monitor is above the primary (retina).  Most of the window is on top (secondary).  Curiously, the window is shown on both monitors which seems to be a new functionality on Mac (mine is Monterey 12.5.1) - previously it would always show a clipped window on one monitor.

Invoking the content menu popup by right-clicking on the last visible text line on the top monitor, actually expecting the popup to be visible on the top monitor.  It does, however, appear on the primary screen, sharp, while the underlying portion of the application is rendered a bit fuzzy, see the screenshot.

Questions:
- isn't the popup expected to be shown on top where the right click happened?
- should the bottom portion of the application be rendered using retina quality?
- 
<img width="517" alt="Screen Shot 2022-12-07 at 13 52 33" src="https://user-images.githubusercontent.com/107069028/206305788-1daffbaf-a215-4bd1-be16-5bd529586792.png">

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

PR: https://git.openjdk.org/jfx/pull/971


More information about the openjfx-dev mailing list