Created attachment 6894
Avoid calling gtk_clipboard_clear()
I think there is no sense in calling gtk_clipboard_clear() after
gtk_clipboard_set_text(). Latter makes a copy of data, and sets
required reply callback, so other applications will get an empty
string which is fine. Calling _clear() makes GTK+ to call
XSetSelectionOwner() with owner=None, which may cause change of
selection owner with "strikeback" effect.
Also passing length of 1 looks wrong. String is empty, so its
length should be 0. Luckily, GTK+ uses g_strndup() inside, which
makes it an empty string rather than a string of one '\0'.
This patch fixes issue for me. I could reproduce it before the
patch, and can't reproduce after.
Created attachment 6894 clear()
Avoid calling gtk_clipboard_
I think there is no sense in calling gtk_clipboard_ clear() after set_text( ). Latter makes a copy of data, and sets ner() with owner=None, which may cause change of
gtk_clipboard_
required reply callback, so other applications will get an empty
string which is fine. Calling _clear() makes GTK+ to call
XSetSelectionOw
selection owner with "strikeback" effect.
Also passing length of 1 looks wrong. String is empty, so its
length should be 0. Luckily, GTK+ uses g_strndup() inside, which
makes it an empty string rather than a string of one '\0'.
This patch fixes issue for me. I could reproduce it before the
patch, and can't reproduce after.