Closed Bug 1962688 Opened 1 year ago Closed 1 year ago

Dragging tab a small amount detaches it into a new window when the parent window is not maximized

Categories

(Firefox :: Tabbed Browser, defect, P1)

Firefox 137
Unspecified
Linux
defect

Tracking

()

VERIFIED FIXED
140 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox137 --- wontfix
firefox138 --- wontfix
firefox139 --- verified
firefox140 --- verified

People

(Reporter: ke5trel, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(3 files)

STR:

  1. Unmaximize the window on Ubuntu 25.04.
  2. Make sure there are at least two tabs.
  3. Drag a tab sideways a small amount and release just before it starts moving without leaving tab strip.
  4. Repeat a few times.

Expected:
Tab remains in tab strip.

Actual:
Tab detaches into a new window.

Does not happen for maximized windows.

Still happens with:
browser.tabs.hoverPreview.enabled = false
nglayout.enable_drag_images = false

Easy to reproduce with Wayland but more difficult with XWayland.

Workaround is to change browser.tabs.allowTabDetach = false.

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=ff5432cc7e7c0d223330a7c8f09a89d797793f83&tochange=9efb94e533503b0cd1309c16d01d488a69941059

Regressed by Bug 581863.

:emilio, since you are the author of the regressor, bug 581863, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

I think I can repro this... I'm not super familiar with our tab dragging code to know off the top of my head, but I looked at this and I think the event coordinates look off.

I think this code is now wrong. The coordinates of the event are supposed to be relative to the client area.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

Hmmm actually I was wrong... I think the code is correct, it's just the front-end which is wrong.

Blocks: linuxdad
Priority: -- → P3

This is more visible on Linux because the decorations there are bigger, but I
believe this also fixes issues on windows specially if you have the titlebar
checkbox on.

You need to use mozInnerScreen* coords in order to get the screen coordinates
of the client area.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Flags: needinfo?(emilio)

Noticed this while going through this code. The end should be all the
way to the right, not left...

Component: Widget: Gtk → Tabbed Browser
Product: Core → Firefox
No longer blocks: linuxdad

The product::component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit BugBot documentation.

Priority: P3 → --
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ea19d60a97e9 Fix tab drop zone calculation to account for window decorations correctly. r=tabbrowser-reviewers,nsharpley https://hg.mozilla.org/integration/autoland/rev/5eaadf8976dc Fix vertical tabs on right drop zone calculation. r=tabbrowser-reviewers,nsharpley
Severity: -- → S3
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch

Verified as fixed in our latest Nightly 140.0a1 (2025-04-29)

QA Whiteboard: [qa-investig-needed-c140/b139
QA Whiteboard: [qa-investig-needed-c140/b139 → [qa-investig-needed-c140/b139]

Thanks Rares! Let's get this uplifted to Beta?

Flags: needinfo?(emilio)

Comment on attachment 9481325 [details]
Bug 1962688 - Fix tab drop zone calculation to account for window decorations correctly. r=#tabbrowser-reviewers

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: comment 0
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: Yes
  • If yes, steps to reproduce: comment 0
  • List of other uplifts needed: none
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Simple coordinate space fixes.
  • String changes made/needed: none
  • Is Android affected?: No
Flags: needinfo?(emilio)
Attachment #9481325 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Attachment #9481326 - Flags: approval-mozilla-beta?
See Also: → 1962799
See Also: → 1961435

Comment on attachment 9481325 [details]
Bug 1962688 - Fix tab drop zone calculation to account for window decorations correctly. r=#tabbrowser-reviewers

Approved for 139.0b2.

Attachment #9481325 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9481326 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [qa-investig-needed-c140/b139] → [uplift] [qa-ver-needed-c140/b139]
QA Contact: rdoghi

This issue is verified as fixed in our latest Beta 139.0b2 20250430022719

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift] [qa-ver-needed-c140/b139] → [uplift] [qa-ver-done-c140/b139]
Flags: qe-verify+
See Also: 1962799 →
See Also: → 1962484
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: