53 |
jstring cp_gtk_filesTarget; |
jstring cp_gtk_filesTarget; |
54 |
|
|
55 |
/* Simple id to keep track of the selection we are currently managing. */ |
/* Simple id to keep track of the selection we are currently managing. */ |
56 |
static int current_selection = 0; |
static gint current_selection = 0; |
57 |
|
|
58 |
/* Whether we "own" the clipboard. And may clear it. */ |
/* Whether we "own" the clipboard. And may clear it. */ |
59 |
static int owner = 0; |
static int owner = 0; |
261 |
clipboard_clear_func (GtkClipboard *clipboard __attribute__((unused)), |
clipboard_clear_func (GtkClipboard *clipboard __attribute__((unused)), |
262 |
gpointer user_data) |
gpointer user_data) |
263 |
{ |
{ |
264 |
if (owner && (int) user_data == current_selection) |
if (owner && GPOINTER_TO_INT(user_data) == current_selection) |
265 |
{ |
{ |
266 |
JNIEnv *env = cp_gtk_gdk_env(); |
JNIEnv *env = cp_gtk_gdk_env(); |
267 |
owner = 0; |
owner = 0; |
351 |
if (gtk_clipboard_set_with_data (cp_gtk_clipboard, targets, n, |
if (gtk_clipboard_set_with_data (cp_gtk_clipboard, targets, n, |
352 |
clipboard_get_func, |
clipboard_get_func, |
353 |
clipboard_clear_func, |
clipboard_clear_func, |
354 |
(gpointer) current_selection)) |
GINT_TO_POINTER(current_selection))) |
355 |
{ |
{ |
356 |
owner = 1; |
owner = 1; |
357 |
if (gtk_clipboard_instance == NULL) |
if (gtk_clipboard_instance == NULL) |