Closed Bug 1949890 Opened 1 day ago Closed 18 hours ago

Message header popups open outside the application

Categories

(Thunderbird :: Message Reader UI, defect, P1)

Tracking

(thunderbird_esr128 unaffected, thunderbird135 unaffected, thunderbird136 affected, thunderbird137 affected)

RESOLVED FIXED
137 Branch
Tracking Status
thunderbird_esr128 --- unaffected
thunderbird135 --- unaffected
thunderbird136 --- affected
thunderbird137 --- affected

People

(Reporter: aleca, Assigned: freaktechnik)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

STR:

  • Open a single message in the message pane (it doesn't matter if it's the about3Pane, a tab, or a standalone window)
  • Click on one of the recipients in the message header.

The menupopup opens at the bottom right of the monitor, outside the the application.

I've been seeing this for several days. It goes back to at least 2025-02-14 build

Calum, can you find the regression range?

Flags: needinfo?(calum.mackay)

I found out that event.screenX is actually returning the wrong value as it reports a bigger number than the correct value of the clicked event.
https://searchfox.org/comm-central/rev/7a274fcf6967456777f822a1f1f38d108a5ddb69/mail/base/content/msgHdrView.js#3005

I'm only seeing it on hi-dpi screens.

Emilio, are you aware of any m-c changes that might affect the screen size detection in HiDPI?
So weird that it only happens in the message header and nowhere else

Flags: needinfo?(emilio)

3:29.54 INFO: Last good revision: 7f6d0270a648c0332ffec5a4b64060ff3210ddd0
3:29.54 INFO: First bad revision: 1d991e4853051fdbbb490ef6eaacd52a2e91929a
3:29.54 INFO: Pushlog:
https://hg.mozilla.org/comm-central/pushloghtml?fromchange=7f6d0270a648c0332ffec5a4b64060ff3210ddd0&tochange=1d991e4853051fdbbb490ef6eaacd52a2e91929a

Flags: needinfo?(calum.mackay)

Backing out bug 1931692 seems to fix it for me locally.

Regressed by: 1931692

Setting flags based on regressor.

: --- → unaffected
: --- → affected

Gentle ping to Masayuki for some help on this.

Flags: needinfo?(masayuki)

Yeah so it seems this is only an issue if you query the event post dispatch, so a workaround could be getting it before the await in that function.

But it still seems there's a Gecko bug here. Masayuki can hopefully take a closer look. Thanks for finding it!

Flags: needinfo?(emilio)
Assignee: nobody → martin
Status: NEW → ASSIGNED
Target Milestone: --- → 137 Branch

Hmm. Here is the original code.

void UIEvent::DuplicatePrivateData() {
  mLayerPoint = GetLayerPoint();

  // GetScreenPoint converts mEvent->mRefPoint to right coordinates.
  // Note that mPresContext will be cleared by Event::DuplicatePrivateData().
  // Therefore, we need to use mPresContext before calling it.
  const CSSIntPoint screenPoint = RoundedToInt(
      Event::GetScreenCoords(mPresContext, mEvent, mEvent->mRefPoint)
          .valueOr(CSSIntPoint{0, 0}));
  const CSSToLayoutDeviceScale scale = mPresContext
                                           ? mPresContext->CSSToDevPixelScale()
                                           : CSSToLayoutDeviceScale(1);

  Event::DuplicatePrivateData();
  MOZ_ASSERT_IF(!mEventIsInternal, !mPresContext);

  mEvent->mRefPoint = RoundedToInt(screenPoint * scale);
}

scale is computed before Event::DuplicatePrivateData() clears mPresContext. Then, it's used when caching mRefPoint which is now screen point rather than relative offset in the widget. This meaning change must cause making me have misunderstood...

Flags: needinfo?(masayuki)

Pushed by john@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/e8bd76d274b2
Work around screen coordinates being wrong on HiDPI screens after await. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 18 hours ago
Resolution: --- → FIXED
See Also: → 1949949
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: