ui/gtk: Fix GTK assertion failure introduced with clipboard fixes
gtk_clipboard_request_targets actually returns n_targets == -1 when targets == NULL instead of zero. This result in failed assertion within GTK: qemu: Gtk: gtk_targets_include_text: assertion 'targets != NULL || n_targets == 0' failed Extend the check to require non-null targets and positive n_targets. Signed-off-by: Jindrich Makovicka <makovick@gmail.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20260501-clipboard-assert-fix-v1-1-e549243e4583@gmail.com>
This commit is contained in:
committed by
Marc-André Lureau
parent
4dc8407837
commit
960a41fbfd
@@ -175,7 +175,7 @@ static void gd_clipboard_owner_change_targets_received_callback(
|
||||
{
|
||||
QemuClipboardInfo *info = (QemuClipboardInfo *)data;
|
||||
|
||||
if (n_targets) {
|
||||
if (targets && n_targets > 0) {
|
||||
if (gtk_targets_include_text(targets, n_targets)) {
|
||||
info->types[QEMU_CLIPBOARD_TYPE_TEXT].available = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user