Copy gtk_clipboard_get_default implementation to gtkclipboard-quartz.c
authorJohn Ralls <jralls@ceridwen.us>
Tue, 18 Jul 2017 18:15:12 +0000 (11:15 -0700)
committerJohn Ralls <jralls@ceridwen.us>
Tue, 18 Jul 2017 18:16:58 +0000 (11:16 -0700)
Fixes bug 784323.

gtk/gtkclipboard-quartz.c

index fec31f523b82b37cddd1b7632b4964813281b6d9..8429c3c50f9196b326f2682502467ae253131999 100644 (file)
@@ -286,6 +286,26 @@ gtk_clipboard_get (GdkAtom selection)
   return gtk_clipboard_get_for_display (gdk_display_get_default (), selection);
 }
 
+/**
+ * gtk_clipboard_get_default:
+ * @display: the #GdkDisplay for which the clipboard is to be retrieved.
+ *
+ * Returns the default clipboard object for use with cut/copy/paste menu items
+ * and keyboard shortcuts.
+ *
+ * Return value: (transfer none): the default clipboard object.
+ *
+ * Since: 3.16
+ **/
+GtkClipboard *
+gtk_clipboard_get_default (GdkDisplay *display)
+{
+  g_return_val_if_fail (display != NULL, NULL);
+  g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
+
+  return gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
+}
+
 static void
 clipboard_owner_destroyed (gpointer data)
 {