Open Bug 1725979 Opened 4 years ago Updated 1 year ago

[wayland] Dragging a tab from a window's tab strip incorrectly places and sizes new window

Categories

(Core :: Widget: Gtk, defect, P3)

defect

Tracking

()

People

(Reporter: nika, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

When dragging a tab out from the current window, the newly created window seems to be incorrectly placed and sized on Wayland. I'm guessing that this may be related to bug 1718727, which apparently disabled sizing & placement for popups, which I believe are currently used to implement this feature.

STR:

  • Enable Wayland (MOZ_ENABLE_WAYLAND=1) and widget.wayland.async-clipboard.enabled (to avoid bug 1719894)
  • Drag a tab from the current window down and to the right

ER: The window opens with the same dimensions with the upper-left-hand corner roughly where the tab was dragged to.

AR: The window is opened with what appear to be default dimensions at an arbitrary location on the screen.

I've attached a video which shows the difference in behaviour between wayland and xwayland on Fedora 34.

The new window placement is controlled by compositor, not by Firefox itself. We can only control window size but it may be changed by compositor too, for instance when you drop window on screen edge or so.

Blocks: wayland

Please run with MOZ_LOG="Widget:5" to see if the window size change is initiated by Firefox itself or by Wayland compositor.

Priority: -- → P3

(In reply to Martin Stránský [:stransky] (ni? me) from comment #2)

Please run with MOZ_LOG="Widget:5" to see if the window size change is initiated by Firefox itself or by Wayland compositor.

I've attached with both Widget:5 and WidgetDrag:5 for dragging a tab out of a window. It ended up being placed at (0,0) on one of my monitors AFAICT.

(In reply to Martin Stránský [:stransky] (ni? me) from comment #1)

The new window placement is controlled by compositor, not by Firefox itself. We can only control window size but it may be changed by compositor too, for instance when you drop window on screen edge or so.

This seems really unfortunate, and like a hole in the Wayland APIs if this is impossible to implement. When dragging a tab out of a window it seems like a very user-unfriendly behaviour for it to be created in a completely different location on the screen than where the user dragged the tab to. I personally would find this extremely jarring to switch to, at least.

Is there no way to e.g. specify that we are creating the new window in response to the given drag action so that the compositor can prefer placing the window under the cursor's location?

Flags: needinfo?(stransky)

Better D&D needs Wayland protocol extension, see https://bugs.chromium.org/p/chromium/issues/detail?id=896640

Flags: needinfo?(stransky)

Martin, is this still something we need to fix? I could not see to which wayland extension you were referring in that link (it's a bit of a long bug :))

Flags: needinfo?(stransky)

Yes, it's still valid, see https://blogs.igalia.com/max/fallback-tab-dragging/
Recent Wayland D&D protocol fails to deliver drop event if we perform the drop "nowhere" - so if we want to create a new window by detaching the browser tab, we get "failed" although we want to detach the window. Also we don't get drop coordinates so we can't open new window on drop target location.

Flags: needinfo?(stransky)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: