summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-06-16 16:59:26 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-06-16 17:05:00 -0400
commit5ffe8e53d2412811a93b463d17aaa941ad2b1503 (patch)
treea7c79c65232a734a2c22e4764d32a345c8a3d143
parent777673e933806e1d62fc8878e3c67a4b554a7d3c (diff)
downloadgtk+-wip/clipboard.tar.gz
GdkClipboard: always provide content typeswip/clipboard
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'.
-rw-r--r--gdk/gdkclipboard.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdk/gdkclipboard.c b/gdk/gdkclipboard.c
index 9a52e20b24..7b3c135f64 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);
}