To: vim_dev@googlegroups.com Subject: Patch 8.0.1625 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1625 Problem: Test_quotestar is flaky when run in GTK GUI. Solution: Do not call lose_selection when invoked from selection_clear_event(). Files: src/gui_gtk_x11.c *** ../vim-8.0.1624/src/gui_gtk_x11.c 2018-02-10 18:45:21.060822215 +0100 --- src/gui_gtk_x11.c 2018-03-20 21:14:36.292792283 +0100 *************** *** 1366,1380 **** --- 1366,1386 ---- * 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,7055 **** void clip_mch_lose_selection(VimClipboard *cbd UNUSED) { ! gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time); ! gui_mch_update(); } /* --- 7054,7064 ---- void clip_mch_lose_selection(VimClipboard *cbd UNUSED) { ! if (!in_selection_clear_event) ! { ! gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time); ! gui_mch_update(); ! } } /* *** ../vim-8.0.1624/src/version.c 2018-03-20 18:35:31.162086009 +0100 --- src/version.c 2018-03-20 21:23:24.237579640 +0100 *************** *** 768,769 **** --- 768,771 ---- { /* Add new patch number below this line */ + /**/ + 1625, /**/ -- Q. What happens to programmers when they die? A: MS-Windows programmers are reinstalled. C++ programmers become undefined, anyone who refers to them will die as well. Java programmers reincarnate after being garbage collected, unless they are in permgen, in which case they become zombies. Zimbu programmers leave a stack trace that tells us exactly where they died and how they got there. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///