Problematic (XUL) Pop-ups

45 views
Skip to first unread message

Geoff Lankow

unread,
May 2, 2022, 5:43:45 AM5/2/22
to dev-pl...@mozilla.org
Hi all, I keep coming across this problem when writing Mochitests for Thunderbird. It seems to affect only Linux but I can't be sure of that.

If I open a window then click on an element that would open a pop-up (such a menulist), the click event happens but the pop-up doesn't open. So my test code waiting it to appear times out.

(Also, on my machine I frequently see a rendering glitch on the new window when this happens, but I'm not sure if it's related. Parts of the window aren't drawn properly and instead I can see other things that are already on my screen.)

What I think is happening is that the code that talks to the OS about the pop-up isn't ready so soon after the window opens. Usually I can mitigate it by waiting 500ms before the click, but this feels bad and it doesn't always work. Is there something I can listen for to be sure that everything is ready to handle the click?

GL

Emilio Cobos Álvarez

unread,
May 2, 2022, 7:25:44 AM5/2/22
to dev-pl...@mozilla.org
On 5/2/22 11:43, Geoff Lankow wrote:
> If I open a window then click on an element that would open a pop-up
> (such a menulist), the click event happens but the pop-up doesn't open.
> So my test code waiting it to appear times out.

Does the behavior change if you run the test with MOZ_ENABLE_WAYLAND=0?

> (Also, on my machine I frequently see a rendering glitch on the new
> window when this happens, but I'm not sure if it's related. Parts of the
> window aren't drawn properly and instead I can see other things that are
> already on my screen.)

Does this happen only on startup, or also when running the test?
OpenPGP_0xE1152D0994E4BF8A.asc

Andrew Sutherland

unread,
May 2, 2022, 12:05:54 PM5/2/22
to dev-pl...@mozilla.org
On 5/2/22 5:43 AM, Geoff Lankow wrote:
> If I open a window then click on an element that would open a pop-up
> (such a menulist), the click event happens but the pop-up doesn't
> open. So my test code waiting it to appear times out.

Historically I'd found this being due to focus issues, either due to
running the tests against my local X session where I was changing focus,
or when running under a virtual display the window manager was not being
helpful.  For example
https://www.visophyte.org/blog/2011/03/02/teaser-rich-contextual-information-for-thunderbird-mozmill-failures/
describes a Thunderbird failure (with pretty logs!) where that happened
exactly, but that was before we had `--headless`.

Andrew

Geoff Lankow

unread,
May 2, 2022, 8:27:58 PM5/2/22
to dev-pl...@mozilla.org
Gah, of course it's a focus problem! Last time I came across this problem I tried a number of focus things and failed, so decided it wasn't a focus problem. Now, the first thing I try succeeds and I look silly.

> Does the behavior change if you run the test with MOZ_ENABLE_WAYLAND=0?

No, and without Wayland I still see the rendering weirdness sometimes just running the program. It's no big deal, but good to rule out a likely cause.

GL
Reply all
Reply to author
Forward
0 new messages