mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
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().
This commit is contained in:
@@ -1366,15 +1366,21 @@ key_release_event(GtkWidget *widget UNUSED,
|
|||||||
* Selection handlers:
|
* 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
|
static gint
|
||||||
selection_clear_event(GtkWidget *widget UNUSED,
|
selection_clear_event(GtkWidget *widget UNUSED,
|
||||||
GdkEventSelection *event,
|
GdkEventSelection *event,
|
||||||
gpointer user_data UNUSED)
|
gpointer user_data UNUSED)
|
||||||
{
|
{
|
||||||
|
in_selection_clear_event = TRUE;
|
||||||
if (event->selection == clip_plus.gtk_sel_atom)
|
if (event->selection == clip_plus.gtk_sel_atom)
|
||||||
clip_lose_selection(&clip_plus);
|
clip_lose_selection(&clip_plus);
|
||||||
else
|
else
|
||||||
clip_lose_selection(&clip_star);
|
clip_lose_selection(&clip_star);
|
||||||
|
in_selection_clear_event = FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -7048,8 +7054,11 @@ clip_mch_request_selection(VimClipboard *cbd)
|
|||||||
void
|
void
|
||||||
clip_mch_lose_selection(VimClipboard *cbd UNUSED)
|
clip_mch_lose_selection(VimClipboard *cbd UNUSED)
|
||||||
{
|
{
|
||||||
gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time);
|
if (!in_selection_clear_event)
|
||||||
gui_mch_update();
|
{
|
||||||
|
gtk_selection_owner_set(NULL, cbd->gtk_sel_atom, gui.event_time);
|
||||||
|
gui_mch_update();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -766,6 +766,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1625,
|
||||||
/**/
|
/**/
|
||||||
1624,
|
1624,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user