The way that GtkTextView et al pop up their context menu is to first
query to see if the clipboard has some text, and if so, enable the Paste
menu item. But since the Wayland backend hasn't had the greatest
selection and clipboard code, the callback for the clipboard got dropped
on the floor.
Add some simple code to respond to the TARGETS selection.
This makes right-clicking on a GtkTextView work fine.
This way, the Wayland and the regular clipboard implementation can both
be compiled in and selected based on the display in use.
One thing potentially broken now is text mime type handling as Wayland
seemed to use different mime types in some places.
We now support independent selection and primary clipboards, and avoid
wiping clipboard on modifying its contents from the same owner. This fixes
most of the interaction issues with clipboard and selection.
Signed-off-by: Rob Bradford <rob@linux.intel.com>
This follows the approach used by the Quartz port - that of a separate
implementation matching GtkClipboard.
The simple clipboard tests in gtk3-demo function correctly but there are
almost certainly leaks and bugs.