diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-03-20 21:24:45 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-03-20 21:24:45 +0100 |
commit | 29dfa5af3c14406573d08609d2e95add4d6b45fb (patch) | |
tree | 64eedb6c602fc6d07f4f52551fc203025a0f2d11 /src/gui_gtk_x11.c | |
parent | 5a3a49ed592e8300553590392721a5e55fede6e7 (diff) | |
download | vim-git-29dfa5af3c14406573d08609d2e95add4d6b45fb.tar.gz |
patch 8.0.1625: test_quotestar is flaky when run in GTK GUIv8.0.1625
Problem: Test_quotestar is flaky when run in GTK GUI.
Solution: Do not call lose_selection when invoked from
selection_clear_event().
Diffstat (limited to 'src/gui_gtk_x11.c')
-rw-r--r-- | src/gui_gtk_x11.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 2f88c2eeb..bb679bd97 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -1366,15 +1366,21 @@ key_release_event(GtkWidget *widget UNUSED, * Selection handlers: */ +/* Remember when clip_lose_selection was called from here, we must not call + * gtk_selection_owner_set() then. */ +static int in_selection_clear_event = FALSE; + static gint selection_clear_event(GtkWidget *widget UNUSED, GdkEventSelection *event, gpointer user_data UNUSED) { + in_selection_clear_event = TRUE; if (event->selection == clip_plus.gtk_sel_atom) clip_lose_selection(&clip_plus); else clip_lose_selection(&clip_star); + in_selection_clear_event = FALSE; return TRUE; } @@ -7048,8 +7054,11 @@ clip_mch_request_selection(VimClipboard *cbd) void clip_mch_lose_selection(VimClipboard *cbd UNUSED) { - gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time); - gui_mch_update(); + if (!in_selection_clear_event) + { + gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time); + gui_mch_update(); + } } /* |