rotorgames / Rg.Plugins.Popup

Xamarin Forms popup plugin
MIT License
1.15k stars 337 forks source link

Popup content not appearing on second monitor/display #669

Open CMarcher opened 3 years ago

CMarcher commented 3 years ago

🐛 Bug Report

Some interesting heavier is going on, where when I drag my macOS application to my second screen (recently purchased) and launch a Popup, the dark transparent background appears, but the actual content of the Popup does not. When it is returned to the primary, built-in laptop screen, the popups work and appear as normal. I can tell the Popup is launching, as the background fades in and out, since I'm using an activity indicator that blocks screen input until an important task is done.

Expected behavior

Popup content appears

Reproduction steps

With a second screen connected to your macOS device, with the display settings set to extend (not mirror), drag an application that pushes a popup to the secondary screen. Ensure that the popup displays on the primary screen first.

Cause the popup to be pushed while on this screen. Observe.

Configuration

Version: 2.0.0.11

Platform:

CMarcher commented 3 years ago

This issue is critical to my application, as I use the popup layouts to perform actions like creating and updating significant objects.

LuckyDucko commented 3 years ago

@CMarcher have you checked #634 as this seems remarkably similar to that issue there.

Are you able to provide a test example project so we can see what is happening?

CMarcher commented 3 years ago

I'll get a sample, but based on my actual project, here are screenshots of on the laptop versus full-screen second display. It seems the content is being positioned incorrectly on the second screen, but it is visible. I'll try with system padding off as described in the aforementioned issue.

Screen Shot 2021-05-04 at 3 21 21 PM Screen Shot 2021-05-04 at 3 22 05 PM
CMarcher commented 3 years ago

Yes, it works fine if HasSystemPadding is set to false. Do you still want a sample project to demonstrate this @LuckyDucko ?

LuckyDucko commented 3 years ago

Hmmm, I am trying to remember what the issue was last time around.

From memory, it could be because we determine the system padding based on the internal Mac screen? or the primary display. and since the internal screen resolution of Mac laptops is unlikely to be the same ratio, that's where issues arise.

If you have two displays with the exact same ratio, you could try testing it with the laptop closed and seeing what happens?

Sample project shouldn't be needed now, as I believe I can recreate what you have mentioned with the demo project, but I would be very interested in the results of testing the questions I have above.

CMarcher commented 3 years ago

@LuckyDucko sorry for the delay, just been a bit busy. With the laptop lid closed, and HasSystemPadding set to true, the 1080p monitor at 100% scaling has the popup appear fine. However, the 4k monitor, scaled to 2560 x 1440, the popup still doesn't appear correctly. When I tried different scales, including the full 4k, the same issue is taking place. Both monitors are the same ratio.

I'm thinking whatever determines the position of the popup content is not based on per-screen values, but simply taking the first's (primary display).

LuckyDucko commented 3 years ago

@CMarcher no worries about delay.

The primary display does seem to make sense. What happens if you put the 4k monitor at 1080p?

I remember running similar tests and with enough fiddling, I came across the popup being right at the top/bottom of the screen.

I think the height/width of the primary display (in pixels) determine the system padding (when its transformed into pixel amounts).

Once we get to the bottom recreating the issue and understanding how it works, I think a solutions shouldn't be too difficult (hopefully!)

CMarcher commented 3 years ago

@LuckyDucko I tried on the 4k monitor when set to 1080p scaling (no actual resolution change), popup doesn't appear correctly. I couldn't set it to actual 1080p res, but I tried 2048 x 1152, and the same effect is taking place.