Allow for empty UTF8_STRING to be pasted

The current code doesn't allow for an empty string to be pasted to the
clipboard on the X11 side.  This is done by some lock screen programs
to prevent information leakage.
This commit is contained in:
matt335672
2025-08-04 11:25:54 +01:00
parent 1c854e8afe
commit 8099299ab0
+1 -1
View File
@@ -1810,7 +1810,7 @@ clipboard_event_selection_notify(XEvent *xevent)
{
LOG_DEVEL(LOG_LEVEL_DEBUG, "clipboard_event_selection_notify: UTF8_STRING "
"data_size %d", data_size);
if ((g_clip_s2c.incr_in_progress == 0) && (data_size > 0))
if ((g_clip_s2c.incr_in_progress == 0) && (data_size >= 0))
{
g_free(g_clip_s2c.data);
g_clip_s2c.total_bytes = data_size;