[gtk+/wip/clipboard] GdkClipboard: always provide content types
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/clipboard] GdkClipboard: always provide content types
- Date: Mon, 16 Jun 2014 21:05:21 +0000 (UTC)
commit 5ffe8e53d2412811a93b463d17aaa941ad2b1503
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jun 16 16:59:26 2014 -0400
GdkClipboard: always provide content types
It is a bit awkward if gdk_clipboard_get_content_types
returns nothing for text or image content. So, just return
the 'standard' content types: 'text/plain' and 'image/png'.
gdk/gdkclipboard.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gdk/gdkclipboard.c b/gdk/gdkclipboard.c
index 9a52e20..7b3c135 100644
--- a/gdk/gdkclipboard.c
+++ b/gdk/gdkclipboard.c
@@ -111,11 +111,20 @@ _gdk_clipboard_set_available_content (GdkClipboard *clipboard,
const gchar **content_types)
{
GdkClipboardPrivate *priv = gdk_clipboard_get_instance_private (clipboard);
+ const gchar *text_content_types[] = { "text/plain", NULL };
+ const gchar *image_content_types[] = { "image/png", NULL };
+
+ if (content_types == NULL)
+ {
+ if (content == TEXT_CONTENT)
+ content_types = text_content_types;
+ else if (content == IMAGE_CONTENT)
+ content_types = image_content_types;
+ }
priv->content = content;
g_strfreev (priv->content_types);
priv->content_types = g_strdupv ((gchar **)content_types);
- /* FIXME: should we automatically set text / image content types ? */
g_signal_emit (clipboard, signals[CHANGED], 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]