Closed Bug 1894952 Opened 15 days ago Closed 4 days ago

[x11] XULPopupElement::GetOuterScreenRect sometimes returns the previous location and dimensions after reopen

Categories

(Core :: Widget: Gtk, defect)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: nordzilla, Unassigned)

References

Details

Description

When implementing Bug 1894575 I noticed a peculiar behavior on Linux where calling getOuterScreenRect() on Linux would sometimes return the previous dimensions and location of an arrowpanel after reopening.

I also noticed that calling getBoundingClientRect() before calling getOuterScreenRect() seems to update whatever state is necessary to have getOuterScreenRect() return the most up-to-date location.


Steps to Reproduce

This can be reproduced on Linux when commenting out the call to getBoundingClientRect() in the SelectTranslationsPanel. I will update this to a searchfox link if/when the code lands and update this bug description accordingly.

Essentially, you need to open the panel in one location, resize it, then open it in a new location, resize it, etc. perhaps while also logging the rect returned by getBoundingClientRect() and see that the values sometimes pertain to the previous popup open, rather than the current popup open.

Summary: XULPopupElement::GetOuterScreenRect sometimes returns the previous location and dimensions after reopen → [x11] XULPopupElement::GetOuterScreenRect sometimes returns the previous location and dimensions after reopen

https://searchfox.org/mozilla-central/rev/386c7f17b2421374930a447c9f424910551b659d/dom/xul/XULPopupElement.cpp#284 is the reason why getBoundingClientRect "helps". If you change that line to FlushType::Layout then it should return always up-to-date values, I believe? But that means that you're calling it in an dirty state.

That's so odd! The FlushTypes were my first guess as to what would be going wrong there, but I jumped all the way down to FlushType:Display for the sake of debugging and I was going to work my way backward to find the right spot, but it still didn't work.

It's possible that something happened, such as I forgot to build the changes, or some stupid mistake like that.

Let me try again right now.


Edit: I am unable to reproduce this time, even with keeping FlushType::Frames.

Blocks: 1895036

I am going to close this for now, because I have been unable to reproduce this since I had the issue.

Status: NEW → RESOLVED
Closed: 4 days ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.