]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkclipboard.c
Add GtkBubbleWindow
[~andy/gtk] / gtk / gtkclipboard.c
index 02c67c14dac80e37d2d61d0804e9d81719bc0731..cbc497a3f27a1b6e7b58c252ea8144b15105cbe2 100644 (file)
@@ -614,28 +614,10 @@ gtk_clipboard_set_contents (GtkClipboard         *clipboard,
        {
          clipboard_unset (clipboard);
 
-         if (clipboard->get_func)
-           {
-             /* Calling unset() caused the clipboard contents to be reset!
-              * Avoid leaking and return 
-              */
-             if (!(clipboard->have_owner && have_owner) ||
-                 clipboard->user_data != user_data)
-               {
-                 (*clear_func) (clipboard, user_data);
-                 return FALSE;
-               }
-             else
-               return TRUE;
-           }
-         else
-           {
-             clipboard->user_data = user_data;
-             clipboard->have_owner = have_owner;
-             if (have_owner)
-               clipboard_add_owner_notify (clipboard);
-           }
-         
+         clipboard->user_data = user_data;
+         clipboard->have_owner = have_owner;
+         if (have_owner)
+             clipboard_add_owner_notify (clipboard);
        }
 
       clipboard->get_func = get_func;
@@ -1410,9 +1392,9 @@ gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
 
   if (g_main_loop_is_running (results.loop))
     {
-      GDK_THREADS_LEAVE ();
+      gdk_threads_leave ();
       g_main_loop_run (results.loop);
-      GDK_THREADS_ENTER ();
+      gdk_threads_enter ();
     }
 
   g_main_loop_unref (results.loop);
@@ -1463,9 +1445,9 @@ gtk_clipboard_wait_for_text (GtkClipboard *clipboard)
 
   if (g_main_loop_is_running (results.loop))
     {
-      GDK_THREADS_LEAVE ();
+      gdk_threads_leave ();
       g_main_loop_run (results.loop);
-      GDK_THREADS_ENTER ();
+      gdk_threads_enter ();
     }
 
   g_main_loop_unref (results.loop);
@@ -1531,9 +1513,9 @@ gtk_clipboard_wait_for_rich_text (GtkClipboard  *clipboard,
 
   if (g_main_loop_is_running (results.loop))
     {
-      GDK_THREADS_LEAVE ();
+      gdk_threads_leave ();
       g_main_loop_run (results.loop);
-      GDK_THREADS_ENTER ();
+      gdk_threads_enter ();
     }
 
   g_main_loop_unref (results.loop);
@@ -1591,9 +1573,9 @@ gtk_clipboard_wait_for_image (GtkClipboard *clipboard)
 
   if (g_main_loop_is_running (results.loop))
     {
-      GDK_THREADS_LEAVE ();
+      gdk_threads_leave ();
       g_main_loop_run (results.loop);
-      GDK_THREADS_ENTER ();
+      gdk_threads_enter ();
     }
 
   g_main_loop_unref (results.loop);
@@ -1646,9 +1628,9 @@ gtk_clipboard_wait_for_uris (GtkClipboard *clipboard)
 
   if (g_main_loop_is_running (results.loop))
     {
-      GDK_THREADS_LEAVE ();
+      gdk_threads_leave ();
       g_main_loop_run (results.loop);
-      GDK_THREADS_ENTER ();
+      gdk_threads_enter ();
     }
 
   g_main_loop_unref (results.loop);
@@ -1816,7 +1798,7 @@ gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard)
 }
 
 /**
- * gtk_clipboard_wait_for_targets
+ * gtk_clipboard_wait_for_targets:
  * @clipboard: a #GtkClipboard
  * @targets: (out) (array length=n_targets) (transfer container): location
  *           to store an array of targets. The result stored here must
@@ -1824,9 +1806,9 @@ gtk_clipboard_wait_is_uris_available (GtkClipboard *clipboard)
  * @n_targets: location to store number of items in @targets.
  *
  * Returns a list of targets that are present on the clipboard, or %NULL
- * if there aren't any targets available. The returned list must be 
+ * if there aren't any targets available. The returned list must be
  * freed with g_free().
- * This function waits for the data to be received using the main 
+ * This function waits for the data to be received using the main
  * loop, so events, timeouts, etc, may be dispatched during the wait.
  *
  * Return value: %TRUE if any targets are present on the clipboard,
@@ -2132,9 +2114,9 @@ gtk_clipboard_store (GtkClipboard *clipboard)
 
   if (g_main_loop_is_running (clipboard->store_loop))
     {
-      GDK_THREADS_LEAVE ();
+      gdk_threads_leave ();
       g_main_loop_run (clipboard->store_loop);
-      GDK_THREADS_ENTER ();
+      gdk_threads_enter ();
     }
   
   g_main_loop_unref (clipboard->store_loop);