On Fri, 23 Dec 2022 14:46:25 GMT, Kevin Rushforth <k...@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.
>
> Kevin Rushforth has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains two additional 
> commits since the last revision:
> 
>  - Merge remote-tracking branch 'origin/master' into 
> 8251862-multi-screen-popup
>  - 8251862: Wrong position of Popup windows at the intersection of 2 screens

I noticed some wrong position of menu popup when tested with 2 external 
monitors.
I have a monitors configured in portrait mode as:
![Screenshot 2022-12-09 
145806](https://user-images.githubusercontent.com/11330676/210305749-d5073945-bfaa-44cc-98eb-172f6b344e22.png)

Screenshots of some observations:
1. 
![Screenshot 2022-12-09 
144504](https://user-images.githubusercontent.com/11330676/210305790-61530649-eaec-441b-8262-ebd9f7bb877c.png)
2.
![Screenshot 2022-12-09 
144624](https://user-images.githubusercontent.com/11330676/210305822-6b3aa883-bb2f-496d-9a0a-6f95fcffdddb.png)
3.
![Screenshot 2022-12-09 
145645](https://user-images.githubusercontent.com/11330676/210305861-5249ee28-3898-4d5b-8b52-d3e1b3389af2.png)
4.
![Screenshot 2022-12-09 
144722](https://user-images.githubusercontent.com/11330676/210305838-711ddcfa-a3ee-4b35-8b02-f1a510d080f9.png)

Similar behavior can also be observed if monitors are in landscape mode:
![Screenshot 2022-12-09 
150231](https://user-images.githubusercontent.com/11330676/210305945-ba171790-4767-4cd2-96c4-2f6fb57b7e50.png)

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

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

Reply via email to