summaryrefslogtreecommitdiff
path: root/gtk/gtkclipboard.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-08-20 15:35:58 +0200
committerBenjamin Otte <otte@redhat.com>2013-08-20 16:34:29 +0200
commite38e47d7d38f21aa62ebe7580c6250f327593ef2 (patch)
tree3e9eccf1696967949513dce32ec30ec2aaeaef83 /gtk/gtkclipboard.c
parentaee5bcf9e2dabc1eb21280be2c42a1ac9b5ac39d (diff)
downloadgtk+-e38e47d7d38f21aa62ebe7580c6250f327593ef2.tar.gz
clipboard: Reimplement Wayland clipboard using vfuncs
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.
Diffstat (limited to 'gtk/gtkclipboard.c')
-rw-r--r--gtk/gtkclipboard.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk/gtkclipboard.c b/gtk/gtkclipboard.c
index 24073523cf..a460e477bd 100644
--- a/gtk/gtkclipboard.c
+++ b/gtk/gtkclipboard.c
@@ -23,6 +23,9 @@
#include "gtkclipboard.h"
#include "gtkclipboardprivate.h"
+#ifdef GDK_WINDOWING_WAYLAND
+#include "gtkclipboard-waylandprivate.h"
+#endif
#include "gtkinvisible.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
@@ -1914,7 +1917,13 @@ clipboard_peek (GdkDisplay *display,
if (!tmp_list && !only_if_exists)
{
- clipboard = g_object_new (GTK_TYPE_CLIPBOARD, NULL);
+#ifdef GDK_WINDOWING_WAYLAND
+ if (GDK_IS_WAYLAND_DISPLAY (display))
+ clipboard = g_object_new (GTK_TYPE_CLIPBOARD_WAYLAND, NULL);
+ else
+#endif
+ clipboard = g_object_new (GTK_TYPE_CLIPBOARD, NULL);
+
clipboard->selection = selection;
clipboard->display = display;
clipboard->n_cached_targets = -1;