Mercurial > vim
comparison src/gui_gtk_x11.c @ 1494:58a14bafc1f0 v7.1.209
updated for version 7.1-209
author | vimboss |
---|---|
date | Sun, 06 Jan 2008 14:17:07 +0000 |
parents | c44058ba78bc |
children | 18ee39301b82 |
comparison
equal
deleted
inserted
replaced
1493:3c17132458a1 | 1494:58a14bafc1f0 |
---|---|
6658 { | 6658 { |
6659 GdkAtom target; | 6659 GdkAtom target; |
6660 unsigned i; | 6660 unsigned i; |
6661 int nbytes; | 6661 int nbytes; |
6662 char_u *buffer; | 6662 char_u *buffer; |
6663 time_t start; | |
6663 | 6664 |
6664 for (i = 0; i < N_SELECTION_TARGETS; ++i) | 6665 for (i = 0; i < N_SELECTION_TARGETS; ++i) |
6665 { | 6666 { |
6666 received_selection = RS_NONE; | 6667 received_selection = RS_NONE; |
6667 target = gdk_atom_intern(selection_targets[i].target, FALSE); | 6668 target = gdk_atom_intern(selection_targets[i].target, FALSE); |
6668 | 6669 |
6669 gtk_selection_convert(gui.drawarea, | 6670 gtk_selection_convert(gui.drawarea, |
6670 cbd->gtk_sel_atom, target, | 6671 cbd->gtk_sel_atom, target, |
6671 (guint32)GDK_CURRENT_TIME); | 6672 (guint32)GDK_CURRENT_TIME); |
6672 | 6673 |
6673 while (received_selection == RS_NONE) | 6674 /* Hack: Wait up to three seconds for the selection. A hang was |
6675 * noticed here when using the netrw plugin combined with ":gui" | |
6676 * during the FocusGained event. */ | |
6677 start = time(NULL); | |
6678 while (received_selection == RS_NONE && time(NULL) < start + 3) | |
6674 gtk_main(); /* wait for selection_received_cb */ | 6679 gtk_main(); /* wait for selection_received_cb */ |
6675 | 6680 |
6676 if (received_selection != RS_FAIL) | 6681 if (received_selection != RS_FAIL) |
6677 return; | 6682 return; |
6678 } | 6683 } |