Skip to content

Commit 29dfa5a

Browse files
committed
patch 8.0.1625: test_quotestar is flaky when run in GTK GUI
Problem: Test_quotestar is flaky when run in GTK GUI. Solution: Do not call lose_selection when invoked from selection_clear_event().
1 parent 5a3a49e commit 29dfa5a

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

src/gui_gtk_x11.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,15 +1366,21 @@ key_release_event(GtkWidget *widget UNUSED,
13661366
* Selection handlers:
13671367
*/
13681368

1369+
/* Remember when clip_lose_selection was called from here, we must not call
1370+
* gtk_selection_owner_set() then. */
1371+
static int in_selection_clear_event = FALSE;
1372+
13691373
static gint
13701374
selection_clear_event(GtkWidget *widget UNUSED,
13711375
GdkEventSelection *event,
13721376
gpointer user_data UNUSED)
13731377
{
1378+
in_selection_clear_event = TRUE;
13741379
if (event->selection == clip_plus.gtk_sel_atom)
13751380
clip_lose_selection(&clip_plus);
13761381
else
13771382
clip_lose_selection(&clip_star);
1383+
in_selection_clear_event = FALSE;
13781384

13791385
return TRUE;
13801386
}
@@ -7048,8 +7054,11 @@ clip_mch_request_selection(VimClipboard *cbd)
70487054
void
70497055
clip_mch_lose_selection(VimClipboard *cbd UNUSED)
70507056
{
7051-
gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time);
7052-
gui_mch_update();
7057+
if (!in_selection_clear_event)
7058+
{
7059+
gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time);
7060+
gui_mch_update();
7061+
}
70537062
}
70547063

70557064
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ static char *(features[]) =
766766

767767
static int included_patches[] =
768768
{ /* Add new patch number below this line */
769+
/**/
770+
1625,
769771
/**/
770772
1624,
771773
/**/

0 commit comments

Comments
 (0)