Search Issue Tracker

Won't Fix

Votes

0

Found in

2020.1.0a5

2020.2

2020.2.1f1

2021.1

2021.2

Issue ID

1310730

Regression

Yes

Popup window will be drawn at a incorrect position when using PopupWindow.Show()

IMGUI

-

How to reproduce:
1. Open the attached project (case_1310730_PopupPosition)
2. Click Tools > Popup 00
3. Observe where the pop up is drawn
4. Click Popup MyWindow 00
5. Observe where the Popup is drawn

Expected result: Popup 00 is drawn at the top left corner of the Unity window. Popup MyWindow 00 is drawn at the top left corner of MyWindow window.
Actual result: Popup 00 is drawn below the top left corner. Popup MyWindow 00 is drawn either completely outside of MyWindow or below the top left corner of MyWindow.

Reproducible with: 2020.1.0a5, 2020.2.4f1, 2021.1.0b5, 2021.2.0a4
Not reproducible with: 2018.4.30f1, 2019.4.19f1, 2020.1.0a4

  1. Response avatar

    Resolution Note (2021.2.X):

    Restoring this legacy behavior has caused other regressions. The correct solution is either to only call PopupWindow.Show() inside OnGUI() calls as shown in the documentation: https://docs.unity3d.com/ScriptReference/PopupWindow.html

    Or to convert the screen space coordinate you desire into the current GUI space using GUIUtility.ScreenToGUIPoint()

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.