rem: if (result == TRUE) {  window = gdk_window_new_simple (); } else { GdkAtom gdk_atom;   gdk_atom = gdk_atom_intern (selection_name, FALSE); clipboard = gtk_clipboard_get (gdk_atom); gtk_clipboard_request_contents (clipboard, gdk_atom, clipboard_received_func, NULL); }
context: gtk_program_register (const gchar *unique_id){	gboolean result = FALSE;	GtkClipboard *clipboard;	Atom clipboard_atom;	selection_name = gtk_message_make_selection_name (unique_id);	clipboard_atom = gdk_x11_get_xatom_by_name (selection_name);	XGrabServer (GDK_DISPLAY());	if (XGetSelectionOwner (GDK_DISPLAY(), clipboard_atom) != None)		goto out;	clipboard = gtk_clipboard_get (gdk_atom_intern (selection_name, FALSE));	targets[0].target = selection_name;	targets[0].flags = 0;	targets[0].info = 0;	if (!gtk_clipboard_set_with_data  (clipboard, targets,				G_N_ELEMENTS (targets),				selection_get_func,				selection_clear_func, NULL))		goto out;	result = TRUE;out:	XUngrabServer (GDK_DISPLAY());	gdk_flush();	if (result == TRUE)	{		/* Store the GdkWindow, so we can get the XID */		window = gdk_window_new_simple ();	} else {		GdkAtom gdk_atom;		/* Grab the XID for the already running app */		gdk_atom = gdk_atom_intern (selection_name, FALSE);		clipboard = gtk_clipboard_get (gdk_atom);		gtk_clipboard_request_contents (clipboard,				gdk_atom, clipboard_received_func, NULL);	}	return result;}