[Wayland] Re-implement back Wayland custom/specific clipboard and D&D handlers
Categories
(Core :: Widget: Gtk, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: stransky, Assigned: stransky)
References
(Blocks 4 open bugs)
Details
Attachments
(18 files, 5 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
Bug 1752503 removed Wayland specific D&D and clipboard handlers. We'd need to re-implement that (D&D at lead) to support toplevel D&D operations.
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 1•5 months ago
|
||
| Assignee | ||
Comment 2•5 months ago
|
||
Updated•5 months ago
|
| Assignee | ||
Comment 3•5 months ago
|
||
| Assignee | ||
Comment 4•4 months ago
|
||
Updated•4 months ago
|
Updated•4 months ago
|
| Assignee | ||
Comment 5•4 months ago
|
||
There are some try failures here:
https://treeherder.mozilla.org/jobs?repo=try&revision=e4b5cf61860f2bba5671bfbf8a01805eea0fe152
./mach test dom/events/test/clipboard/test_paste_image.html
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Comment 6•4 months ago
|
||
Updated•4 months ago
|
| Assignee | ||
Comment 7•4 months ago
|
||
| Assignee | ||
Comment 8•4 months ago
|
||
This is re-implementation of gtk3/filetransferportal.c code to Mozilla codebase.
| Assignee | ||
Comment 9•4 months ago
|
||
| Assignee | ||
Comment 10•4 months ago
|
||
| Assignee | ||
Comment 11•4 months ago
|
||
| Assignee | ||
Comment 12•4 months ago
|
||
Implement base AsyncClipboardRequest to get data from clipboard and move platform specific code to DataRequestGtk / DataRequestWayland classes.
Wayland code uses the same data read logic/functions as gtk3 clipboard implementation.
| Assignee | ||
Comment 13•4 months ago
|
||
Use AsyncClipboardRequest to implement Wayland specific clipboard.
As Wayland uses the same wl_data_offer struct for clipboard and D&D the implementation is also used by D&D code.
| Assignee | ||
Comment 14•4 months ago
|
||
Move clipboard target cache from nsClipboard to nsClipboardX11 as X11/Gtk uses clipboard query to get targets.
We don't use the cache on Wayland as targets are provided in advance here.
| Assignee | ||
Comment 15•4 months ago
|
||
| Assignee | ||
Comment 16•4 months ago
|
||
| Assignee | ||
Comment 17•4 months ago
|
||
| Assignee | ||
Comment 18•4 months ago
|
||
| Assignee | ||
Comment 19•4 months ago
|
||
| Assignee | ||
Comment 20•4 months ago
|
||
Updated•4 months ago
|
| Assignee | ||
Updated•4 months ago
|
| Assignee | ||
Comment 21•4 months ago
|
||
Landing Bug 2025329 [Wayland] Add widget/gtk/WUniquePtr.h to use smart pointers with Wayland objects r?emilio to use it on other patches.
Comment 22•4 months ago
|
||
Comment 23•4 months ago
|
||
| bugherder | ||
| Assignee | ||
Updated•3 months ago
|
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
Comment 24•3 months ago
|
||
Comment 25•3 months ago
|
||
Backed out for causing build bustages @ nsDragService.cpp
Backout link: https://hg.mozilla.org/integration/autoland/rev/86fad357abff4ea57d036ed1de3af70b9a7e86c2
Comment 27•3 months ago
|
||
Comment 28•3 months ago
|
||
Comment 29•3 months ago
|
||
Revert for causing failures on test_bug1247483.html.
| Assignee | ||
Comment 30•3 months ago
|
||
Looks like there's missing gap when clipboard data is set by us by Gtk interface - we're quick enough to ear the data before it goes back to us via. event loop in the test.
| Assignee | ||
Comment 31•3 months ago
|
||
We're hitting Bug 1857075 variant here. We may also round-trip after data set to make sure they're there.
| Assignee | ||
Comment 32•3 months ago
|
||
Gtk solves that by implementing data cache for such cases. We have data cache for D&D so we may also re-use it here.
| Assignee | ||
Comment 34•2 months ago
|
||
./mach test editor/libeditor/tests/ is the failing test command.
| Assignee | ||
Comment 35•2 months ago
|
||
./mach test dom/events/test/clipboard/test_paste_image.html also fails.
| Assignee | ||
Comment 36•2 months ago
|
||
./mach test widget/tests/
| Assignee | ||
Comment 37•2 months ago
|
||
./mach test widget/tests/test_clipboard_owner_chrome.html
| Assignee | ||
Comment 38•2 months ago
|
||
Don't use RetrievalContextWayland on Wayland as Gtk/Wayland doesn't work correctly together when a data is set by Gtk but retrieved by Wayland.
Rather use Gtk backend (as we did before) to set/get clipboard data.
| Assignee | ||
Comment 39•2 months ago
|
||
Don't use RetrievalContextWayland on Wayland as Gtk/Wayland doesn't work correctly together when a data is set by Gtk but retrieved by Wayland.
Rather use Gtk backend (as we did before) to set/get clipboard data.
Updated•2 months ago
|
Updated•2 months ago
|
| Assignee | ||
Comment 40•2 months ago
|
||
| Assignee | ||
Comment 41•2 months ago
|
||
| Assignee | ||
Comment 42•2 months ago
|
||
! In D305175#10592779, @emilio wrote:
I'm confused about that change, is it really needed? Can you comment on it if so?
Putting the reply here to make it more visible.
Yes. This change is result of investigation of various clipboard failures like:
https://treeherder.mozilla.org/logviewer?job_id=569031835&repo=autoland&task=Fy-c0XhKTh6qrUXiBu-HXg.0&lineNumber=15719
Generally we use Gtk to set clipboard data but we use Wayland to retrieve it. Gtk caches the clipboard data and process them somehow, makes internal data cache and so. And then (after some time) sends it to system (X11/Wayland).
It doesn't matter much if it's used by 'regular' scenario like user interaction - copy/paste - with long delay between the ops.
But that gap breaks the Mozilla automation - we set/get clipboard data quickly and Gtk fails to send clipboard data to OS in the time we're requesting it. So we see various clipboard inconsistency and random bugs.
Also Gtk caches the clipboard data (and MIME types) so set/get clipboard by the same app may not get to OS at all - it's retrieved from Gtk cache.
So the Gtk->Wayland clipboard data path contains various bumps/breaks which may or may not affect the data transfer.
I tried various approaches (add display flush/roundtrips after gtk data set) but it still's fails in some cases like clipboard clearing (that's more Gtk internal thing that Wayland compositor one).
The best approach is to use Gtk for X11 and native Wayland for Wayland. But that will need to implement Wayland data set which is not trivial.
So as the intermediate step I decided to put back the clipboard Gtk/Gtk path for Wayland and use Gtk/Wayland for D&D only where the most issues are visible (various wayland protocol error crashes due to obsoleted wayland object). The Wayland D&D handler will also help us to implement toplevel D&D.
The final state should be:
- Use Gtk for clipboard/D&D on X11
- Use Wayland for clipboard (set/get)
- Use Wayland for D&D (set/get)
- Integrate Wayland clipboard and D&D data caches
Comment 43•2 months ago
|
||
Comment 44•2 months ago
|
||
Comment 45•2 months ago
|
||
Backed out for causing lint failures
- Backout link
- Push with failures
- Failure Log
- Failure line: TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/widget/gtk/RetrievalContextGtk.h:0 | invalid header guard RetrievalContextGtk_h, leading underscore followed by a capital letter in a macro name is reserved (header-guards)
Comment 46•2 months ago
|
||
| Assignee | ||
Updated•2 months ago
|
Comment 47•2 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/a16ae311a516
https://hg.mozilla.org/mozilla-central/rev/954ecebcc58e
https://hg.mozilla.org/mozilla-central/rev/d29f4626c7ce
https://hg.mozilla.org/mozilla-central/rev/51d5f649637e
https://hg.mozilla.org/mozilla-central/rev/f8def2b92b9c
https://hg.mozilla.org/mozilla-central/rev/acdc2d1e7932
https://hg.mozilla.org/mozilla-central/rev/868548dec07b
https://hg.mozilla.org/mozilla-central/rev/1a3fd5ab37a3
https://hg.mozilla.org/mozilla-central/rev/54c1fad1f00a
https://hg.mozilla.org/mozilla-central/rev/74597811818e
https://hg.mozilla.org/mozilla-central/rev/1a5d01572033
https://hg.mozilla.org/mozilla-central/rev/382e905cea6b
https://hg.mozilla.org/mozilla-central/rev/e041b7b649c7
https://hg.mozilla.org/mozilla-central/rev/52152d197dc1
https://hg.mozilla.org/mozilla-central/rev/f88dda635762
https://hg.mozilla.org/mozilla-central/rev/a122e8a111c6
https://hg.mozilla.org/mozilla-central/rev/7dc5ffa47071
| Assignee | ||
Updated•2 months ago
|
Updated•2 months ago
|
Description
•