Closed Bug 1449490 Opened 2 years ago Closed 2 years ago

[Wayland] implement gtk_clipboard_request_text() on wayland

Categories

(Core :: Widget: Gtk, enhancement)

Unspecified
Linux
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox60 --- fixed
firefox61 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We need to implement gtk_clipboard_request_text() on wayland clipboard backend to get text pasted correctly.
See Also: → 1447925
X11 counterpart is Bug 1447925.
Depends on: 1417892
We need nsDataOffer implementation (Bug 1417892) to land first.
Comment on attachment 8963050 [details]
Bug 1449490 - [Wayland] Implement gtk_clipboard_request_text() by nsRetrievalContextWayland::GetClipboardText(),

https://reviewboard.mozilla.org/r/231910/#review240556

::: widget/gtk/nsClipboardWayland.cpp:729
(Diff revision 2)
> +    GdkAtom selection = GetSelectionAtom(aWhichClipboard);
> +    DataOffer* dataOffer = (selection == GDK_SELECTION_PRIMARY) ?
> +                              mPrimaryOffer : mClipboardOffer;
> +
> +    for (unsigned int i = 0; i < sizeof(sTextMimeTypes); i++) {
> +        if (dataOffer->HasTarget(sTextMimeTypes[i])) {

Can we ensure that dataOffer is not null there or better test it befor the for loop?

::: widget/gtk/nsClipboardWayland.cpp:730
(Diff revision 2)
> +    DataOffer* dataOffer = (selection == GDK_SELECTION_PRIMARY) ?
> +                              mPrimaryOffer : mClipboardOffer;
> +
> +    for (unsigned int i = 0; i < sizeof(sTextMimeTypes); i++) {
> +        if (dataOffer->HasTarget(sTextMimeTypes[i])) {
> +            uint32_t tmp;

name it 'unused' instead of 'tmp' to make it clear that it's actually not used anywhere.
Attachment #8963050 - Flags: review?(jhorak) → review+
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/b17d0621e2d1
[Wayland] Implement gtk_clipboard_request_text() by nsRetrievalContextWayland::GetClipboardText(), r=jhorak
https://hg.mozilla.org/mozilla-central/rev/b17d0621e2d1
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Comment on attachment 8963050 [details]
Bug 1449490 - [Wayland] Implement gtk_clipboard_request_text() by nsRetrievalContextWayland::GetClipboardText(),

Approval Request Comment
[Feature/Bug causing the regression]: Bug 1447925
[User impact if declined]: Wayland backend fails to build
[Is this code covered by automated tests?]: no
[Has the fix been verified in Nightly?]: yes
[Needs manual test from QE? If yes, steps to reproduce]: no
[List of other uplifts needed for the feature/fix]: none
[Is the change risky?]: no
[Why is the change risky/not risky?]: This code is build by distros only for Wayland backend. Mozilla does not ship that.
[String changes made/needed]: none
Attachment #8963050 - Flags: approval-mozilla-beta?
Martin, from comment 3, do you also need to uplift from bug 1417892?
Flags: needinfo?(stransky)
(In reply to Liz Henry (:lizzard) (needinfo? me) from comment #10)
> Martin, from comment 3, do you also need to uplift from bug 1417892?

Thanks Liz, I was mistaken here. We also need bug 1417892 for this one. I'll file the uplift request.
Flags: needinfo?(stransky)
Comment on attachment 8963050 [details]
Bug 1449490 - [Wayland] Implement gtk_clipboard_request_text() by nsRetrievalContextWayland::GetClipboardText(),

NPOTB, used by other distros, Beta60+
Attachment #8963050 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.