Closed Bug 1730203 Opened 10 months ago Closed 10 months ago

[Linux] D&D fails sometimes

Categories

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

defect

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

D&D fails sometimes, especially when Firefox main loop is busy.

It's because we reply to drag_motion callback too late (we reply from scheduled timer event) and Gtk fails to deliver / commit reply to Wayland compositor. We definitely violate D&D protocol here.

Depends on: 1731737
Depends on: 1731197

Primary cause of this bug is missing reply from drag_motion handler while we're reading data from D&D and routing it to child process.

Wayland/Gtk sets drag state right after drag_motion event only. We're getting 'drag_motion' events from nested loop (while reading data for child process) and we don't know the final D&D state yet as we need reply from the child process. When we set the D&D state latter, it's ignored by Gtk and D&D is considered as canceled by compositor.

Right now we explicitly state 'drag denied' after D&D start until we have a reply from child process. We may change it to 'drag accepted' on Wayland. It does not change final D&D state - we get the data only when child process requests it.

When we get data from D&D operation by nsWindow::OnDragDataReceivedEvent, speed up data transfer to child process by
WindowDragMotionHandler() call.

Wayland/Gtk sets drag state right after drag_motion event only.

While we're reading data for child process we're getting 'drag_motion' events from nested loop.
We don't know the final D&D state yet as we need reply from the child process.
When we set the D&D state latter, it's ignored by Gtk and D&D is considered as
canceled by client.

Right now we explicitly state 'drag denied' after D&D start until we have a reply from child process.
We're changing it to 'drag accepted' on Wayland until we have a reply from child process
and we also send the reply in WindowDragMotionHandler() to fulfill Wayland protocol needs.

It does not change final D&D state - we get the data only when child process requests it.

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/b0abd344cf28
[Linux] Call WindowDragMotionHandler() from nsWindow::OnDragDataReceivedEvent, r=emilio

Let's skip this one.

Flags: needinfo?(stransky)
Attachment #9242240 - Attachment is obsolete: true
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/11250511cdb8
[Wayland] Reply to drag_motion from Gtk handler, r=emilio
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch

Backed out along with Bug 1731197 for drag and drop of tabs causing duplicates (Bug 1732116).

backout: https://hg.mozilla.org/mozilla-central/rev/ba378c62cecf6a3048baddde1f9c7d61b45a2914

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 94 Branch → ---

No need to backout that, a fix is already at Bug 1732116

Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/ea39b67162eb
[Wayland] Reply to drag_motion from Gtk handler, r=emilio
Status: REOPENED → RESOLVED
Closed: 10 months ago10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
Regressions: 1735744
You need to log in before you can comment on or make changes to this bug.