check for empty X11 clipboard data
This commit is contained in:
parent
22a895f45c
commit
a808eaa9bb
@ -536,6 +536,8 @@ static int Handle_SelectionNotify(const XSelectionEvent* xselection)
|
|||||||
GFX2_Log(GFX2_DEBUG, "Clipboard value=%p %lu bytes format=%d type=%s\n",
|
GFX2_Log(GFX2_DEBUG, "Clipboard value=%p %lu bytes format=%d type=%s\n",
|
||||||
value, count, format, type_name);
|
value, count, format, type_name);
|
||||||
XFree(type_name);
|
XFree(type_name);
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
X11_clipboard_size = count;
|
X11_clipboard_size = count;
|
||||||
if (xselection->target == XInternAtom(X11_display, "UTF8_STRING", False))
|
if (xselection->target == XInternAtom(X11_display, "UTF8_STRING", False))
|
||||||
X11_clipboard = strdup((char *)value); // Text Clipboard
|
X11_clipboard = strdup((char *)value); // Text Clipboard
|
||||||
@ -545,6 +547,7 @@ static int Handle_SelectionNotify(const XSelectionEvent* xselection)
|
|||||||
if (X11_clipboard != NULL)
|
if (X11_clipboard != NULL)
|
||||||
memcpy(X11_clipboard, value, count);
|
memcpy(X11_clipboard, value, count);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
XFree(value);
|
XFree(value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user