GNOME Bugzilla – Bug 790031
GtkClipboardClearFunc is not being called
Last modified: 2017-11-29 10:49:38 UTC
Created attachment 363167 [details] Testcase GtkClipboardClearFunc supplied with gtk_clipboard_set_with_owner() or gtk_clipboard_set_with_data() is not being called. Likely related: When using gtk_clipboard_set_with_owner(), gtk_clipboard_get_owner() returns non-NULL value even though the clipboard is owned by another application. Affects latest GTK+ from master (version 3.93), as well as stable version 3.22. Concerns both GDK_SELECTION_CLIPBOARD and GDK_SELECTION_PRIMARY. Testcase included. Steps to reproduce: 1) click the "Set clipboard" button in the test program 2) copy (Ctrl+C) something from another application 3) return back to the test program Actual results: GtkClipboardClearFunc is not called at all. gtk_clipboard_get_owner() returns the owner we set in step 1), although it should return NULL, since the clipboard is owned by the app from step 2). Expected results: If the clipboard ownership is lost, GtkClipboardClearFunc should be called subsequently (in this case in step 3)). If the clipboard ownership has been claimed by another application, gtk_clipboard_get_owner() should return NULL. The behavior should correspond to the one on X11. Build 2017-11-07 on Fedora 26
Created attachment 364579 [details] [review] wayland: Remove unused data structure
Created attachment 364580 [details] [review] wayland: emit GDK_SELECTION_CLEAR on owner changes This patch fixes the test case here. One thing I'm not clear about is whether we want to emit GDK_SELECTION_CLEAR from data_source_dnd_finished() as well, I guess not?
Review of attachment 364579 [details] [review]: makes sense. for both gtk-3-22 and master
Review of attachment 364580 [details] [review]: this one too
Pushed both patches to both branches.