Closed Bug 1504689 Opened 6 years ago Closed 6 years ago

[Wayland/Clipboard] Don't delete clipboard wl_data_offer after keyboard focus out

Categories

(Core :: Widget: Gtk, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: stransky, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Firefox on Wayland suffers issues with copying data to clipboard.

According to https://gitlab.gnome.org/GNOME/gtk/issues/66#note_358097 we should not delete our actual wl_data_offer when we lose keyboard focus.

Gtk+ also does not delete the offer on focus-out, only when a new one comes (wl_data_offer_destroy() call at gdk_wayland_selection_ensure_offer()).

Firefox recently deletes our wl_data_offer on focus-out according to the Wayland documentation [1].

Unfortunately we don't check if the offer comes from Firefox itself (it's owned by us) or from an external source. The problem appears when we copy a data to clipboard by standard Gtk+ interface and then we get a new wl_data_offer for it (because we listen for a new clipboard content). 
When user switches to another app to paste the data, the clipboard content is deleted from clipboard according the doc [1] despite the fact it's actually owed by Firefox and needed at the clipboard to paste it to another application.

I propose to behave as Gtk+ - don't remove the wl_data_offer on focus-out.

[1]
wl_data_device::selection - advertise new selection

id
    wl_data_offer - selection data_offer object

The selection event is sent out to notify the client of a new wl_data_offer for the selection for this device. The data_device.data_offer and the data_offer.offer events are sent out immediately before this event to introduce the data offer object. The selection event is sent to a client immediately before receiving keyboard focus and when a new selection is set while the client has keyboard focus. The data_offer is valid until a new data_offer or NULL is received or until the client loses keyboard focus. The client must destroy the previous selection data_offer, if any, upon receiving this event.
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8827b9a1b90a
[Wayland/Clipboard] Don't delete clipboard wl_data_offer after keyboard focus out, r=jhorak
Keywords: checkin-needed
Depends on: 1505023
https://hg.mozilla.org/mozilla-central/rev/8827b9a1b90a
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: