[Xfce-bugs] review requested: [Bug 11130] History must be cleared twice to be fully cleared : [Attachment 6894] Avoid calling gtk_clipboard_clear()

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Sun Nov 6 21:56:00 CET 2016

Rinat <ibragimovrinat at mail.ru> has asked Simon Steinbeiss <ochosi at xfce.org> for
Bug 11130: History must be cleared twice to be fully cleared

Attachment 6894: Avoid calling gtk_clipboard_clear()

--- Comment #10 from Rinat <ibragimovrinat at mail.ru> ---
Created attachment 6894
  --> https://bugzilla.xfce.org/attachment.cgi?id=6894&action=edit
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.

More information about the Xfce-bugs mailing list